mirror of https://github.com/cbeuw/Cloak
Fix race in integration test.
This commit is contained in:
parent
4dabcd22eb
commit
22148852dc
|
|
@ -185,7 +185,11 @@ func establishSession(lcc client.LocalConnConfig, rcc client.RemoteConnConfig, a
|
||||||
// whatever connection initiator (including a proper ck-client)
|
// whatever connection initiator (including a proper ck-client)
|
||||||
|
|
||||||
netToCkServerD, ckServerListener := connutil.DialerListener(10 * 1024)
|
netToCkServerD, ckServerListener := connutil.DialerListener(10 * 1024)
|
||||||
|
var sessionCreateMutex sync.Mutex
|
||||||
|
|
||||||
clientSeshMaker := func() *mux.Session {
|
clientSeshMaker := func() *mux.Session {
|
||||||
|
sessionCreateMutex.Lock()
|
||||||
|
defer sessionCreateMutex.Unlock()
|
||||||
quad := make([]byte, 4)
|
quad := make([]byte, 4)
|
||||||
common.RandRead(ai.WorldState.Rand, quad)
|
common.RandRead(ai.WorldState.Rand, quad)
|
||||||
ai.SessionId = binary.BigEndian.Uint32(quad)
|
ai.SessionId = binary.BigEndian.Uint32(quad)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue