trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinr...@apache.org
Subject trafficserver git commit: TS-3584: SPDY and H2 requests should not trigger connection keep-alive.
Date Tue, 12 May 2015 17:55:29 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master c66e71cb5 -> dda6814f0


TS-3584: SPDY and H2 requests should not trigger connection keep-alive.


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

Branch: refs/heads/master
Commit: dda6814f07ee59c9e3e452a649e6e7f80906457d
Parents: c66e71c
Author: shinrich <shinrich@yahoo-inc.com>
Authored: Tue May 12 12:54:35 2015 -0500
Committer: shinrich <shinrich@yahoo-inc.com>
Committed: Tue May 12 12:54:35 2015 -0500

----------------------------------------------------------------------
 CHANGES                        | 2 ++
 proxy/http2/HTTP2.cc           | 2 ++
 proxy/spdy/SpdyCallbacks.cc    | 3 +++
 proxy/spdy/SpdyClientSession.h | 2 +-
 4 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dda6814f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 1d107dc..e136e4c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
 
+  *) [TS-3584] Turn off keep alive for HTTP request headers created from SPDY and H2
+
   *) [TS-2609] Header rewrite plugin *URL:HOST condition
 
   *) [TS-3565] Only start up the continuation from DoRemap if the request has

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dda6814f/proxy/http2/HTTP2.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index 6a8b290..9390ed8 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -529,6 +529,8 @@ convert_from_2_to_1_1_header(HTTPHdr *headers)
   headers->field_delete(MIME_FIELD_TRANSFER_ENCODING, MIME_LEN_TRANSFER_ENCODING);
   headers->field_delete(MIME_FIELD_UPGRADE, MIME_LEN_UPGRADE);
 
+  headers->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, HTTP_VALUE_CLOSE, HTTP_LEN_CLOSE);
+
   return PARSE_DONE;
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dda6814f/proxy/spdy/SpdyCallbacks.cc
----------------------------------------------------------------------
diff --git a/proxy/spdy/SpdyCallbacks.cc b/proxy/spdy/SpdyCallbacks.cc
index e42921e..a625fd7 100644
--- a/proxy/spdy/SpdyCallbacks.cc
+++ b/proxy/spdy/SpdyCallbacks.cc
@@ -297,6 +297,8 @@ spdy_process_syn_stream_frame(SpdyClientSession *sm, SpdyRequest *req)
   spdy_fetcher_launch(req);
 }
 
+static char const *const no_keep_alive[] = {"Connection", "close", NULL};
+
 void
 spdy_on_ctrl_recv_callback(spdylay_session *session, spdylay_frame_type type, spdylay_frame
*frame, void *user_data)
 {
@@ -312,6 +314,7 @@ spdy_on_ctrl_recv_callback(spdylay_session *session, spdylay_frame_type
type, sp
     req = spdyRequestAllocator.alloc();
     req->init(sm, stream_id);
     req->append_nv(frame->syn_stream.nv);
+    req->append_nv(no_keep_alive);
     sm->req_map[stream_id] = req;
     sm->vc->add_to_keep_alive_lru();
     spdy_process_syn_stream_frame(sm, req);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dda6814f/proxy/spdy/SpdyClientSession.h
----------------------------------------------------------------------
diff --git a/proxy/spdy/SpdyClientSession.h b/proxy/spdy/SpdyClientSession.h
index 556fa42..0b444ba 100644
--- a/proxy/spdy/SpdyClientSession.h
+++ b/proxy/spdy/SpdyClientSession.h
@@ -55,7 +55,7 @@ public:
   void clear();
 
   void
-  append_nv(char **nv)
+  append_nv(const char *const *nv)
   {
     for (int i = 0; nv[i]; i += 2) {
       headers.push_back(make_pair(nv[i], nv[i + 1]));


Mime
View raw message