Skip to content

Commit e8b4bb0

Browse files
committed
adjust
1 parent 604cbf8 commit e8b4bb0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shadowsocks/obfsplugin/auth_chain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def init_data_size(self, key):
652652
for i in range(0, list_len):
653653
self.data_size_list.append((int)(random.next() % 2340 % 2040 % 1440))
654654
self.data_size_list.sort()
655-
list_len = random.next() % 16 + 16
655+
list_len = random.next() % 16 + 8
656656
for i in range(0, list_len):
657657
self.data_size_list2.append((int)(random.next() % 2340 % 2040 % 1440))
658658
self.data_size_list2.sort()
@@ -671,12 +671,12 @@ def rnd_data_len(self, buf_size, last_hash, random):
671671
return 0
672672
random.init_from_bin_len(last_hash, buf_size)
673673
pos = bisect.bisect_left(self.data_size_list, buf_size + self.server_info.overhead)
674-
final_pos = pos + random.next() % (len(self.data_size_list) + 1 - pos)
674+
final_pos = pos + random.next() % (len(self.data_size_list) * 2)
675675
if final_pos < len(self.data_size_list):
676676
return self.data_size_list[final_pos] - buf_size - self.server_info.overhead
677677

678678
pos = bisect.bisect_left(self.data_size_list2, buf_size + self.server_info.overhead)
679-
final_pos = pos + random.next() % (len(self.data_size_list2) + 1 - pos)
679+
final_pos = pos + random.next() % (len(self.data_size_list2))
680680
if final_pos < len(self.data_size_list2):
681681
return self.data_size_list2[final_pos] - buf_size - self.server_info.overhead
682682

0 commit comments

Comments
 (0)