mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-17 15:25:30 +00:00
Fix pickRandConn bad loop
This commit is contained in:
parent
3f5fdae284
commit
99fa812594
@ -113,8 +113,8 @@ func (sb *switchboard) pickRandConn() (uint32, net.Conn, error) {
|
|||||||
var id uint32
|
var id uint32
|
||||||
var conn net.Conn
|
var conn net.Conn
|
||||||
r := rand.Intn(connCount)
|
r := rand.Intn(connCount)
|
||||||
sb.conns.Range(func(connIdI, connI interface{}) bool {
|
|
||||||
var c int
|
var c int
|
||||||
|
sb.conns.Range(func(connIdI, connI interface{}) bool {
|
||||||
if r == c {
|
if r == c {
|
||||||
id = connIdI.(uint32)
|
id = connIdI.(uint32)
|
||||||
conn = connI.(net.Conn)
|
conn = connI.(net.Conn)
|
||||||
|
Loading…
Reference in New Issue
Block a user