Skip to content

Commit

Permalink
rgw: should delete in_stream_req if conn->get_obj(...) return not zer…
Browse files Browse the repository at this point in the history
…o value

Signed-off-by: weiqiaomiao <wei.qiaomiao@zte.com.cn>
(cherry picked from commit 494fbe9)
  • Loading branch information
weiqiaomiao authored and smithfarm committed Jun 16, 2017
1 parent 9b12fe0 commit 730c88e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rgw/rgw_rest_conn.cc
Expand Up @@ -168,7 +168,13 @@ int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, rgw
set_header(mod_pg_ver, extra_headers, "HTTP_DEST_PG_VER");
}

return (*req)->get_obj(key, extra_headers, obj);
int r = (*req)->get_obj(key, extra_headers, obj);
if (r < 0) {
delete *req;
*req = nullptr;
}

return r;
}

int RGWRESTConn::complete_request(RGWRESTStreamReadRequest *req, string& etag, real_time *mtime, map<string, string>& attrs)
Expand Down

0 comments on commit 730c88e

Please sign in to comment.