trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject git commit: TS-2744: remove TSNetAcceptNamedProtocol assertion for unknown protocols
Date Fri, 02 May 2014 20:16:56 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 07a108186 -> ea7849384


TS-2744: remove TSNetAcceptNamedProtocol assertion for unknown protocols

TSNetAcceptNamedProtocol is supposed to accept arbitrary strings
because it lets you implement your own protocol plugin over TLS,
using NPN or ALPN to demux the session. TS-2431 added an assertion
to SSLNextProtocolSet::NextProtocolEndpoint::NextProtocolEndpoint
when an unknown protocol is registered. There's no "unknown" value
in TSProtoType, but it is safe to mark unrecognized protocols as
TS_PROTO_TLS.


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

Branch: refs/heads/master
Commit: ea7849384139a0ae8308fe12dc0741c4390953e1
Parents: 07a1081
Author: James Peach <jpeach@apache.org>
Authored: Thu May 1 10:29:59 2014 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Fri May 2 13:16:28 2014 -0700

----------------------------------------------------------------------
 CHANGES                          |  2 ++
 iocore/net/SSLNextProtocolSet.cc | 16 ++++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ea784938/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 36aed43..7c4cc54 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-2744] Remove TSNetAcceptNamedProtocol assertion for unknown protocols.
+
   *) [TS-898] Stop the esi plugin referencing invalidated strings.
 
   *) [TS-2778] Websockets remap doesn't properly handle the implicit port for wss.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ea784938/iocore/net/SSLNextProtocolSet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNextProtocolSet.cc b/iocore/net/SSLNextProtocolSet.cc
index c0ff61c..b331d51 100644
--- a/iocore/net/SSLNextProtocolSet.cc
+++ b/iocore/net/SSLNextProtocolSet.cc
@@ -132,18 +132,22 @@ SSLNextProtocolSet::unregisterEndpoint(const char * proto, Continuation
* ep)
 }
 
 Continuation *
-SSLNextProtocolSet::findEndpoint(const unsigned char * proto, unsigned len,
-                                 TSClientProtoStack *proto_stack,
-                                 const char **selected_protocol) const
+SSLNextProtocolSet::findEndpoint(
+  const unsigned char * proto, unsigned len,
+  TSClientProtoStack *proto_stack, const char **selected_protocol) const
 {
   for (const NextProtocolEndpoint * ep = this->endpoints.head;
         ep != NULL; ep = this->endpoints.next(ep)) {
     size_t sz = strlen(ep->protocol);
     if (sz == len && memcmp(ep->protocol, proto, len) == 0) {
-      if (proto_stack)
+      if (proto_stack) {
         *proto_stack = ep->proto_stack;
-      if (selected_protocol)
+      }
+
+      if (selected_protocol) {
         *selected_protocol = ep->protocol;
+      }
+
       return ep->endpoint;
     }
   }
@@ -191,7 +195,7 @@ SSLNextProtocolSet::NextProtocolEndpoint::NextProtocolEndpoint(
              proto == TS_NPN_PROTOCOL_SPDY_1) {
     proto_stack = ((1u << TS_PROTO_TLS) | (1u << TS_PROTO_SPDY));
   } else {
-    ink_release_assert(!"Unsupported protocol");
+    proto_stack = (1u << TS_PROTO_TLS);
   }
 }
 


Mime
View raw message