From 082e414816abc0dc343db3dba254fd4e04526273 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 28 Jul 2016 18:16:12 +0200 Subject: [PATCH] rgw: RGWMongoose uses RGWStreamIOEngine instead of RGWStreamIO. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_civetweb.cc | 3 ++- src/rgw/rgw_civetweb.h | 21 +++++++++++++++++++-- src/rgw/rgw_civetweb_frontend.cc | 4 +++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_civetweb.cc b/src/rgw/rgw_civetweb.cc index ebca981165d2..5bc4a3e7c896 100644 --- a/src/rgw/rgw_civetweb.cc +++ b/src/rgw/rgw_civetweb.cc @@ -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) { diff --git a/src/rgw/rgw_civetweb.h b/src/rgw/rgw_civetweb.h index 67450815f8d6..de966a5c086f 100644 --- a/src/rgw/rgw_civetweb.h +++ b/src/rgw/rgw_civetweb.h @@ -10,8 +10,10 @@ 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 diff --git a/src/rgw/rgw_civetweb_frontend.cc b/src/rgw/rgw_civetweb_frontend.cc index e3df80c619a0..46460c152416 100644 --- a/src/rgw/rgw_civetweb_frontend.cc +++ b/src/rgw/rgw_civetweb_frontend.cc @@ -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) { -- 2.47.3