From 3912ecba8e843a62802279ca1f5e26a85b675f06 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Wed, 22 Jun 2016 01:36:36 +0800 Subject: [PATCH] accept older connection id --- shadowsocks/obfsplugin/auth.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/shadowsocks/obfsplugin/auth.py b/shadowsocks/obfsplugin/auth.py index 482b13a..a56645c 100644 --- a/shadowsocks/obfsplugin/auth.py +++ b/shadowsocks/obfsplugin/auth.py @@ -88,9 +88,9 @@ class verify_base(plain.plain): class client_queue(object): def __init__(self, begin_id): - self.front = begin_id - self.back = begin_id - self.alloc = {} + self.front = begin_id - 64 + self.back = begin_id + 1 + self.alloc = {begin_id: 1} self.enable = True self.last_update = time.time() @@ -102,10 +102,9 @@ class client_queue(object): def re_enable(self, connection_id): self.enable = True - self.alloc = {} self.front = connection_id - 64 - self.back = connection_id - self.alloc[connection_id] = 1 + self.back = connection_id + 1 + self.alloc = {connection_id: 1} def insert(self, connection_id): self.update()