}
int RGWLCCloudStreamPut::init() {
+ int ret = -1;
/* init output connection */
if (multipart.is_multipart) {
char buf[32];
rgw_http_param_pair params[] = { { "uploadId", multipart.upload_id.c_str() },
{ "partNumber", buf },
{ nullptr, nullptr } };
- conn.put_obj_send_init(dest_obj, params, &out_req);
+ ret = conn.put_obj_send_init(dest_obj, params, &out_req);
} else {
- conn.put_obj_send_init(dest_obj, nullptr, &out_req);
+ ret = conn.put_obj_send_init(dest_obj, nullptr, &out_req);
+ }
+
+ if (ret < 0 || !out_req) {
+ ldpp_dout(dpp, 0) << "ERROR: failed to create RGWRESTStreamS3PutObj request" << dendl;
+ return ret;
}
return 0;
void RGWLCCloudStreamPut::send_ready(const DoutPrefixProvider *dpp, const rgw_rest_obj& rest_obj) {
auto r = static_cast<RGWRESTStreamS3PutObj *>(out_req);
+ ceph_assert(r);
std::map<std::string, std::string> new_attrs;
if (!multipart.is_multipart) {
int init() override {
/* init output connection */
RGWRESTStreamS3PutObj *out_req{nullptr};
+ int ret = -1;
if (multipart.is_multipart) {
char buf[32];
rgw_http_param_pair params[] = { { "uploadId", multipart.upload_id.c_str() },
{ "partNumber", buf },
{ nullptr, nullptr } };
- target->conn->put_obj_send_init(dest_obj, params, &out_req);
+ ret = target->conn->put_obj_send_init(dest_obj, params, &out_req);
} else {
- target->conn->put_obj_send_init(dest_obj, nullptr, &out_req);
+ ret = target->conn->put_obj_send_init(dest_obj, nullptr, &out_req);
+ }
+
+ if (ret < 0 || !out_req) {
+ return ret;
}
set_req(out_req);