From: Casey Bodley Date: Wed, 11 Oct 2017 13:01:35 +0000 (-0400) Subject: rgw: ask beast parser about keepalive/close X-Git-Tag: v13.0.1~300^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5d7f154a77eb2cf82b6e4e49d20687c8ed839113;p=ceph.git rgw: ask beast parser about keepalive/close Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_asio_client.cc b/src/rgw/rgw_asio_client.cc index d0174c9bbbf1..46fe0c0c67d7 100644 --- a/src/rgw/rgw_asio_client.cc +++ b/src/rgw/rgw_asio_client.cc @@ -39,10 +39,6 @@ void ClientIO::init_env(CephContext *cct) env.set("CONTENT_TYPE", value); continue; } - if (field == beast::http::field::connection) { - conn_keepalive = boost::algorithm::iequals(value, "keep-alive"); - conn_close = boost::algorithm::iequals(value, "close"); - } static const boost::string_ref HTTP_{"HTTP_"}; @@ -175,10 +171,10 @@ size_t ClientIO::complete_header() sent += txbuf.sputn(timestr, strlen(timestr)); } - if (conn_keepalive) { + if (parser.is_keep_alive()) { constexpr char CONN_KEEP_ALIVE[] = "Connection: Keep-Alive\r\n"; sent += txbuf.sputn(CONN_KEEP_ALIVE, sizeof(CONN_KEEP_ALIVE) - 1); - } else if (conn_close) { + } else { constexpr char CONN_KEEP_CLOSE[] = "Connection: close\r\n"; sent += txbuf.sputn(CONN_KEEP_CLOSE, sizeof(CONN_KEEP_CLOSE) - 1); } diff --git a/src/rgw/rgw_asio_client.h b/src/rgw/rgw_asio_client.h index f193e17c4964..038be51411c6 100644 --- a/src/rgw/rgw_asio_client.h +++ b/src/rgw/rgw_asio_client.h @@ -24,8 +24,6 @@ class ClientIO : public io::RestfulClient, parser_type& parser; beast::flat_buffer& buffer; //< parse buffer - bool conn_keepalive{false}; - bool conn_close{false}; RGWEnv env; rgw::io::StaticOutputBufferer<> txbuf;