]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: ask beast parser about keepalive/close 17923/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 11 Oct 2017 13:01:35 +0000 (09:01 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 Oct 2017 15:28:40 +0000 (11:28 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_asio_client.cc
src/rgw/rgw_asio_client.h

index d0174c9bbbf1413fd403b9da91f5c617f3addc56..46fe0c0c67d7c7d0f17d048e8e02cc73e656143f 100644 (file)
@@ -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);
   }
index f193e17c496461ab8483bf0bcfcd8f5d6d59b2ca..038be51411c6a443bece5459fe878ab0e69880cf 100644 (file)
@@ -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;