Browse Source

fix a ipv6 bug in mysql mode

dev
BreakWa11 9 years ago
parent
commit
0504fb43cf
  1. 3
      server_pool.py
  2. 4
      shadowsocks/obfsplugin/verify.py

3
server_pool.py

@ -52,6 +52,9 @@ class ServerPool(object):
self.config = shell.get_config(False)
shell.print_shadowsocks()
self.dns_resolver = asyncdns.DNSResolver()
if not self.config.get('dns_ipv6', False):
asyncdns.IPV6_CONNECTION_SUPPORT = False
self.mgr = asyncmgr.ServerMgr()
self.tcp_servers_pool = {}

4
shadowsocks/obfsplugin/verify.py

@ -332,7 +332,7 @@ class verify_sha1(verify_base):
if sha1data != self.recv_buf[head_size:head_size + 10]:
logging.error('server_post_decrype data uncorrect auth HMAC-SHA1')
return b'E'
out_buf = to_bytes(chr(ord(self.recv_buf[0]) & 0xF)) + self.recv_buf[1:head_size]
out_buf = to_bytes(chr(ord(self.recv_buf[0]) & 0xEF)) + self.recv_buf[1:head_size]
self.recv_buf = self.recv_buf[head_size + 10:]
self.has_recv_header = True
while len(self.recv_buf) > 2:
@ -345,7 +345,7 @@ class verify_sha1(verify_base):
if sha1data != self.recv_buf[2:12]:
raise Exception('server_post_decrype data uncorrect chunk HMAC-SHA1')
self.recv_id += 1
self.recv_id = (self.recv_id + 1) & 0xFFFFFFFF
out_buf += data
self.recv_buf = self.recv_buf[length:]

Loading…
Cancel
Save