Fix for race condition in *nix connect().

This commit is contained in:
cheatfate 2019-06-06 21:22:17 +03:00
parent 9160dcdbba
commit a8a1138b8b
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
1 changed files with 17 additions and 16 deletions

View File

@ -1076,6 +1076,7 @@ else:
return retFuture return retFuture
proc continuation(udata: pointer) = proc continuation(udata: pointer) =
if not retFuture.finished:
var data = cast[ptr CompletionData](udata) var data = cast[ptr CompletionData](udata)
var err = 0 var err = 0
let fd = data.fd let fd = data.fd