You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2015/08/25 22:31:43 UTC

[1/2] trafficserver git commit: TS-3850: Add accept and no activity timeouts for HTTP/2

Repository: trafficserver
Updated Branches:
  refs/heads/6.0.x e88433608 -> 8e49ab9e0


TS-3850: Add accept and no activity timeouts for HTTP/2

(cherry picked from commit ef0f0e1ae1b9574695050ec370c6f40ccba6c25c)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4f68574f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4f68574f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4f68574f

Branch: refs/heads/6.0.x
Commit: 4f68574f61e6cdca93b79e5baa064158371b8bd7
Parents: e884336
Author: Bryan Call <bc...@apache.org>
Authored: Tue Aug 18 12:08:07 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Tue Aug 25 13:29:38 2015 -0700

----------------------------------------------------------------------
 mgmt/RecordsConfig.cc             | 4 ++++
 proxy/http2/HTTP2.cc              | 4 ++++
 proxy/http2/HTTP2.h               | 2 ++
 proxy/http2/Http2ClientSession.cc | 3 ++-
 4 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4f68574f/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 72e677f..e1c48c1 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1959,6 +1959,10 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.http2.max_header_list_size", RECD_INT, "4294967295", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.http2.accept_no_activity_timeout", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
+  ,
+  {RECT_CONFIG, "proxy.config.http2.no_activity_timeout_in", RECD_INT, "115", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
+  ,
 
   //# Add LOCAL Records Here
   {RECT_LOCAL, "proxy.local.incoming_ip_to_bind", RECD_STRING, NULL, RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4f68574f/proxy/http2/HTTP2.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index b0ced22..7510985 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -739,6 +739,8 @@ uint32_t Http2::max_frame_size = 16384;
 uint32_t Http2::header_table_size = 4096;
 uint32_t Http2::max_header_list_size = 4294967295;
 uint32_t Http2::max_request_header_size = 131072;
+uint32_t Http2::accept_no_activity_timeout = 120;
+uint32_t Http2::no_activity_timeout_in = 115;
 
 void
 Http2::init()
@@ -749,6 +751,8 @@ Http2::init()
   REC_EstablishStaticConfigInt32U(header_table_size, "proxy.config.http2.header_table_size");
   REC_EstablishStaticConfigInt32U(max_header_list_size, "proxy.config.http2.max_header_list_size");
   REC_EstablishStaticConfigInt32U(max_request_header_size, "proxy.config.http.request_header_max_size");
+  REC_EstablishStaticConfigInt32U(accept_no_activity_timeout, "proxy.config.http2.accept_no_activity_timeout");
+  REC_EstablishStaticConfigInt32U(no_activity_timeout_in, "proxy.config.http2.no_activity_timeout_in");
 
   // If any settings is broken, ATS should not start
   ink_release_assert(http2_settings_parameter_is_valid({HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, max_concurrent_streams}) &&

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4f68574f/proxy/http2/HTTP2.h
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.h b/proxy/http2/HTTP2.h
index 5418b9c..1db5585 100644
--- a/proxy/http2/HTTP2.h
+++ b/proxy/http2/HTTP2.h
@@ -344,6 +344,8 @@ public:
   static uint32_t header_table_size;
   static uint32_t max_header_list_size;
   static uint32_t max_request_header_size;
+  static uint32_t accept_no_activity_timeout;
+  static uint32_t no_activity_timeout_in;
 
   static void init();
 };

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4f68574f/proxy/http2/Http2ClientSession.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index 535cfe8..01590cc 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -117,6 +117,7 @@ Http2ClientSession::new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOB
   // Unique client session identifier.
   this->con_id = ProxyClientSession::next_connection_id();
   this->client_vc = new_vc;
+  client_vc->set_inactivity_timeout(HRTIME_SECONDS(Http2::accept_no_activity_timeout));
   this->mutex = new_vc->mutex;
 
   this->connection_state.mutex = new_ProxyMutex();
@@ -288,7 +289,7 @@ Http2ClientSession::state_read_connection_preface(int event, void *edata)
     this->sm_reader->consume(nbytes);
     HTTP2_SET_SESSION_HANDLER(&Http2ClientSession::state_start_frame_read);
 
-    // XXX set activity timeouts ...
+    client_vc->set_inactivity_timeout(HRTIME_SECONDS(Http2::no_activity_timeout_in));
 
     // XXX start the write VIO ...
 


[2/2] trafficserver git commit: TS-3851: Memory leak on the write_buffer for HTTP/2

Posted by bc...@apache.org.
TS-3851: Memory leak on the write_buffer for HTTP/2

(cherry picked from commit 2440f464db61084e0a9895693964887e30e92210)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8e49ab9e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8e49ab9e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8e49ab9e

Branch: refs/heads/6.0.x
Commit: 8e49ab9e0df0ac954c8f34b5bcff8cf4348c0de7
Parents: 4f68574
Author: Bryan Call <bc...@apache.org>
Authored: Tue Aug 18 14:57:29 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Tue Aug 25 13:31:08 2015 -0700

----------------------------------------------------------------------
 proxy/http2/Http2ClientSession.cc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8e49ab9e/proxy/http2/Http2ClientSession.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index 01590cc..2cb83d7 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -77,6 +77,7 @@ Http2ClientSession::destroy()
   super::destroy();
 
   free_MIOBuffer(this->read_buffer);
+  free_MIOBuffer(this->write_buffer);
   http2ClientSessionAllocator.free(this);
 }