]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: rest crs, explicitly call cleanup
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 29 Apr 2016 20:04:13 +0000 (13:04 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 May 2016 21:36:40 +0000 (14:36 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_cr_rest.h

index d6cc8ab389b94a182375c28d54c363c6203e59d7..c10592a0064c8846da1f6e8f251f54e1dda51f4d 100644 (file)
@@ -25,6 +25,10 @@ public:
       path(_path), params(make_param_list(params)), result(_result)
   {}
 
+  ~RGWReadRESTResourceCR() {
+    request_cleanup();
+  }
+
   int send_request() {
     auto op = boost::intrusive_ptr<RGWRESTReadResource>(
         new RGWRESTReadResource(conn, path, params, NULL, http_manager));
@@ -55,6 +59,7 @@ public:
   void request_cleanup() {
     if (http_op) {
       http_op->put();
+      http_op = NULL;
     }
   }
 };
@@ -79,6 +84,10 @@ public:
       input(_input)
   {}
 
+  ~RGWPostRESTResourceCR() {
+    request_cleanup();
+  }
+
   int send_request() {
     auto op = boost::intrusive_ptr<RGWRESTPostResource>(
         new RGWRESTPostResource(conn, path, params, NULL, http_manager));
@@ -126,6 +135,7 @@ public:
   void request_cleanup() {
     if (http_op) {
       http_op->put();
+      http_op = NULL;
     }
   }
 };