fix overflow bug

This commit is contained in:
lxsang 2020-11-29 14:39:29 +01:00
parent 929efb45bf
commit ee3cfe92bd
3 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -181,9 +181,9 @@ class AntunnelApi
@ready().then ()=> @ready().then ()=>
# insert it to pending list # insert it to pending list
sub.tunnel = @ sub.tunnel = @
sub.id = Math.floor(Math.random()*100000) + 1 sub.id = Math.floor(Math.random()*1000) + 1
while @subscribers[sub.id] or @pending[sub.id] while @subscribers[sub.id] or @pending[sub.id]
sub.id = Math.floor(Math.random()*100000) + 1 sub.id = Math.floor(Math.random()*1000) + 1
@pending[sub.id] = sub @pending[sub.id] = sub
# send request to connect to a channel # send request to connect to a channel
@send sub.genmsg Msg.SUBSCRIBE, (new TextEncoder()).encode(sub.channel) @send sub.genmsg Msg.SUBSCRIBE, (new TextEncoder()).encode(sub.channel)