]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWMongoose uses RGWStreamIOEngine instead of RGWStreamIO.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 28 Jul 2016 16:16:12 +0000 (18:16 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 21 Oct 2016 20:57:18 +0000 (22:57 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_civetweb.cc
src/rgw/rgw_civetweb.h
src/rgw/rgw_civetweb_frontend.cc

index ebca981165d2e431b239181f02de2af45a6345de..5bc4a3e7c8961f272dfd8b79f5e4f378892d24a6 100644 (file)
@@ -28,7 +28,8 @@ int RGWMongoose::write_data(const char *buf, int len)
 }
 
 RGWMongoose::RGWMongoose(mg_connection *_conn, int _port)
-  : conn(_conn), port(_port), status_num(0), header_done(false),
+  : RGWStreamIOFacade(this),
+    conn(_conn), port(_port), status_num(0), header_done(false),
     sent_header(false), has_content_length(false),
     explicit_keepalive(false), explicit_conn_close(false)
 {
index 67450815f8d66484c53ae2eb3a72f44aeac601c9..de966a5c086f7f58064c00ef75c05fce6605e369 100644 (file)
 
 struct mg_connection;
 
-class RGWMongoose : public RGWStreamIO
+class RGWMongoose : public RGWStreamIOEngine,
+                    private RGWStreamIOFacade
 {
+  RGWEnv env;
   mg_connection *conn;
 
   bufferlist header_data;
@@ -38,8 +40,23 @@ public:
   int complete_request();
   int send_content_length(uint64_t len);
 
+  RGWEnv& get_env() override {
+    return env;
+  }
+
   RGWMongoose(mg_connection *_conn, int _port);
-  void flush();
+  RGWMongoose(const RGWMongoose& rhs)
+    : RGWStreamIOFacade(this),
+      env(rhs.env),
+      conn(rhs.conn),
+      header_data(rhs.header_data),
+      data(rhs.data),
+      header_done(rhs.header_done),
+      sent_header(rhs.sent_header),
+      has_content_length(rhs.has_content_length),
+      explicit_keepalive(rhs.explicit_keepalive),
+      explicit_conn_close(rhs.explicit_conn_close) {
+  }
 };
 
 #endif
index e3df80c619a0f92fbf2f6db176d1a991073b887d..46460c1524163d067a93febe7b7a335ed6eb4167 100644 (file)
@@ -2,6 +2,7 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "rgw_frontend.h"
+#include "rgw_client_io_decoimpl.h"
 
 #define dout_subsys ceph_subsys_rgw
 
@@ -18,7 +19,8 @@ static int civetweb_callback(struct mg_connection* conn) {
     OpsLogSocket* olog = pe->olog;
 
     RGWRequest req(store->get_new_req_id());
-    RGWMongoose client_io(conn, pe->port);
+    RGWMongoose real_client_io(conn, pe->port);
+    RGWStreamIOLegacyWrapper client_io(&real_client_io);
 
     int ret = process_request(pe->store, rest, &req, &client_io, olog);
     if (ret < 0) {