This commit is contained in:
Arceliar 2018-06-21 10:39:43 -05:00
parent 19014a198e
commit 254be42614
2 changed files with 45 additions and 45 deletions

View file

@ -17,7 +17,7 @@ package yggdrasil
import (
"errors"
"fmt"
"math/rand"
"math/rand"
"net"
"sync"
"sync/atomic"
@ -113,7 +113,7 @@ func (iface *tcpInterface) call(saddr string, socksaddr *string) {
defer func() {
// Block new calls for a little while, to mitigate livelock scenarios
time.Sleep(tcp_timeout)
time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond)
time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond)
iface.mutex.Lock()
delete(iface.calls, saddr)
iface.mutex.Unlock()