Remove promotion to raw TCP based on heuristics

This seems terribly dangerous to me. Let's expand explicit control instead.
This commit is contained in:
Aldo Cortesi 2016-11-05 16:20:38 +13:00
parent 3958940420
commit fbaade4298
2 changed files with 2 additions and 11 deletions

View File

@ -138,7 +138,7 @@ class HttpLayer(base.Layer):
def __init__(self, ctx, mode):
super().__init__(ctx)
if mode not in MODES:
raise exceptions.ServerException("Invalid mode: %s"%mode)
raise exceptions.ServerException("Invalid mode: %s" % mode)
self.mode = mode
self.__initial_server_conn = None
"Contains the original destination in transparent mode, which needs to be restored"

View File

@ -90,16 +90,7 @@ class RootContext:
if alpn == b'http/1.1':
return protocol.Http1Layer(top_layer, 'transparent')
# 6. Check for raw tcp mode
is_ascii = (
len(d) == 3 and
# expect A-Za-z
all(65 <= x <= 90 or 97 <= x <= 122 for x in d)
)
if self.config.options.rawtcp and not is_ascii:
return protocol.RawTCPLayer(top_layer)
# 7. Assume HTTP1 by default
# 6. Assume HTTP1 by default
return protocol.Http1Layer(top_layer, 'transparent')
def log(self, msg, level, subs=()):