From: Yehuda Sadeh Date: Tue, 3 May 2016 19:00:46 +0000 (-0700) Subject: rgw: RGWHTTPManager, avoid referring to req_data->client when completing X-Git-Tag: v11.0.0~611^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ada4df124a71eae413e7dec0e25264a8deffcad;p=ceph.git rgw: RGWHTTPManager, avoid referring to req_data->client when completing this is past calling req_data->finish(), client can be destroyed by now Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 80f3e4e13144..bcb6250b5129 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -138,13 +138,15 @@ struct rgw_http_req_data : public RefCountedObject { int ret; atomic_t done; RGWHTTPClient *client; + void *user_info; RGWHTTPManager *mgr; char error_buf[CURL_ERROR_SIZE]; Mutex lock; Cond cond; - rgw_http_req_data() : easy_handle(NULL), h(NULL), id(-1), ret(0), client(NULL), + rgw_http_req_data() : easy_handle(NULL), h(NULL), id(-1), ret(0), + client(nullptr), user_info(nullptr), mgr(NULL), lock("rgw_http_req_data::lock") { memset(error_buf, 0, sizeof(error_buf)); } @@ -386,7 +388,7 @@ void RGWHTTPManager::_complete_request(rgw_http_req_data *req_data) reqs.erase(iter); } if (completion_mgr) { - completion_mgr->complete(NULL, req_data->client->get_user_info()); + completion_mgr->complete(NULL, req_data->user_info); } req_data->put(); } @@ -461,6 +463,7 @@ int RGWHTTPManager::add_request(RGWHTTPClient *client, const char *method, const req_data->mgr = this; req_data->client = client; + req_data->user_info = client->get_user_info(); register_request(req_data);