]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: pubsub: send missing http headers in certain rest requests
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 23 Oct 2018 20:32:20 +0000 (13:32 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 11 Dec 2018 09:00:21 +0000 (01:00 -0800)
PUT and DELETE requests still need to make sure http status code
is returned.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_sync_module_pubsub_rest.cc

index eab7fe7559f8a19d9c1b1274f581f9d3cf0e6401..e93a671bc4059ec3aa1bbe975f3f2a03eed48548 100644 (file)
@@ -6950,6 +6950,14 @@ std::ostream& RGWOp::gen_prefix(std::ostream& out) const
   return s->gen_prefix(out) << s->dialect << ':' << name() << ' ';
 }
 
+void RGWDefaultResponseOp::send_response() {
+  if (op_ret) {
+    set_req_state_err(s, op_ret);
+  }
+  dump_errno(s);
+  end_header(s);
+}
+
 void RGWPutBucketPolicy::send_response()
 {
   if (op_ret) {
index f993c350d26e8f886128b5ad03683c06be229eab..c7deba365173899374c688c7f4fa46dde919f63c 100644 (file)
@@ -199,6 +199,11 @@ public:
   unsigned get_subsys() const override { return ceph_subsys_rgw; }
 };
 
+class RGWDefaultResponseOp : public RGWOp {
+public:
+  void send_response() override;
+};
+
 class RGWGetObj_Filter : public RGWGetDataCB
 {
 protected:
index 96b8f0509292b646120e5f7defc7ab94d6c8f682..d8106df69b5d392217fa51605c80ecb372ff458d 100644 (file)
@@ -8,8 +8,7 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
-
-class RGWPSCreateTopicOp : public RGWOp {
+class RGWPSCreateTopicOp : public RGWDefaultResponseOp {
 protected:
   std::unique_ptr<RGWUserPubSub> ups;
   string topic_name;
@@ -172,7 +171,7 @@ public:
   }
 };
 
-class RGWPSDeleteTopicOp : public RGWOp {
+class RGWPSDeleteTopicOp : public RGWDefaultResponseOp {
 protected:
   string topic_name;
   std::unique_ptr<RGWUserPubSub> ups;
@@ -257,7 +256,7 @@ public:
 };
 
 
-class RGWPSCreateSubOp : public RGWOp {
+class RGWPSCreateSubOp : public RGWDefaultResponseOp {
 protected:
   string sub_name;
   string topic_name;
@@ -389,7 +388,7 @@ public:
   }
 };
 
-class RGWPSDeleteSubOp : public RGWOp {
+class RGWPSDeleteSubOp : public RGWDefaultResponseOp {
 protected:
   string sub_name;
   string topic_name;
@@ -438,7 +437,7 @@ public:
   }
 };
 
-class RGWPSAckSubEventOp : public RGWOp {
+class RGWPSAckSubEventOp : public RGWDefaultResponseOp {
 protected:
   string sub_name;
   string event_id;
@@ -633,7 +632,7 @@ static int notif_bucket_path(const string& path, string *bucket_name)
   return 0;
 }
 
-class RGWPSCreateNotifOp : public RGWOp {
+class RGWPSCreateNotifOp : public RGWDefaultResponseOp {
 protected:
   std::unique_ptr<RGWUserPubSub> ups;
   string topic_name;
@@ -712,7 +711,7 @@ public:
   }
 };
 
-class RGWPSDeleteNotifOp : public RGWOp {
+class RGWPSDeleteNotifOp : public RGWDefaultResponseOp {
 protected:
   std::unique_ptr<RGWUserPubSub> ups;
   string topic_name;