Browse Source

change err return

dev
BreakWa11 8 years ago
parent
commit
25e9c131d4
  1. 6
      shadowsocks/obfsplugin/http_simple.py
  2. 6
      shadowsocks/obfsplugin/obfs_tls.py

6
shadowsocks/obfsplugin/http_simple.py

@ -145,7 +145,7 @@ class http_simple(plain.plain):
self.has_sent_header = True
self.has_recv_header = True
if self.method == 'http_simple':
return (b'E', False, False)
return (b'E'*64, False, False)
return (buf, True, False)
def server_decode(self, buf):
@ -212,7 +212,7 @@ class http_post(http_simple):
self.has_sent_header = True
self.has_recv_header = True
if self.method == 'http_post':
return (b'E', False, False)
return (b'E'*64, False, False)
return (buf, True, False)
def server_decode(self, buf):
@ -292,7 +292,7 @@ class random_head(plain.plain):
if crc != 0xffffffff:
self.has_sent_header = True
if self.method == 'random_head':
return (b'E', False, False)
return (b'E'*64, False, False)
return (buf, True, False)
# (buffer_to_recv, is_need_decrypt, is_need_to_encode_and_send_back)
return (b'', False, True)

6
shadowsocks/obfsplugin/obfs_tls.py

@ -104,7 +104,7 @@ class tls_simple(plain.plain):
def decode_error_return(self, buf):
self.has_sent_header = True
if self.method == 'tls_simple':
return (b'E', False, False)
return (b'E'*64, False, False)
return (buf, True, False)
def server_decode(self, buf):
@ -205,7 +205,7 @@ class tls_auth(plain.plain):
self.raw_trans_sent = True
self.raw_trans_recv = True
if self.method == 'tls1.0_session_auth':
return (b'E', False, False)
return (b'E'*64, False, False)
return (buf, True, False)
def server_decode(self, buf):
@ -384,7 +384,7 @@ class tls_ticket_auth(plain.plain):
def decode_error_return(self, buf):
self.handshake_status = -1
if self.method == 'tls1.2_session_auth':
return (b'E', False, False)
return (b'E'*64, False, False)
return (buf, True, False)
def server_decode(self, buf):

Loading…
Cancel
Save