fix overhead

This commit is contained in:
破娃酱
2017-07-26 10:20:17 +08:00
parent 838caa3f1d
commit 7dddf07da4
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -193,6 +193,8 @@ class tls_ticket_auth(plain.plain):
def decode_error_return(self, buf):
self.handshake_status = -1
if self.overhead > 0:
self.server_info.overhead -= self.overhead
self.overhead = 0
if self.method in ['tls1.2_ticket_auth', 'tls1.2_ticket_fastauth']:
return (b'E'*2048, False, False)
+4
View File
@@ -858,6 +858,10 @@ class TCPRelayHandler(object):
if self._encrypt_correct:
try:
obfs_decode = self._obfs.server_decode(data)
if self._stage == STAGE_INIT:
self._overhead = self._obfs.get_overhead(self._is_local) + self._protocol.get_overhead(self._is_local)
server_info = self._protocol.get_server_info()
server_info.overhead = self._overhead
except Exception as e:
shell.print_exception(e)
logging.error("exception from %s:%d" % (self._client_address[0], self._client_address[1]))