mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 21:43:33 +00:00
asyncdispatch: get rid of erroneous set constructions (#13877)
Ref #13764
This commit is contained in:
@@ -1351,7 +1351,8 @@ else:
|
||||
flags.toOSFlags())
|
||||
if res < 0:
|
||||
let lastError = osLastError()
|
||||
if lastError.int32 notin {EINTR, EWOULDBLOCK, EAGAIN}:
|
||||
if lastError.int32 != EINTR and lastError.int32 != EWOULDBLOCK and
|
||||
lastError.int32 != EAGAIN:
|
||||
if flags.isDisconnectionError(lastError):
|
||||
retFuture.complete("")
|
||||
else:
|
||||
@@ -1379,7 +1380,8 @@ else:
|
||||
flags.toOSFlags())
|
||||
if res < 0:
|
||||
let lastError = osLastError()
|
||||
if lastError.int32 notin {EINTR, EWOULDBLOCK, EAGAIN}:
|
||||
if lastError.int32 != EINTR and lastError.int32 != EWOULDBLOCK and
|
||||
lastError.int32 != EAGAIN:
|
||||
if flags.isDisconnectionError(lastError):
|
||||
retFuture.complete(0)
|
||||
else:
|
||||
@@ -1447,7 +1449,8 @@ else:
|
||||
cast[ptr SockAddr](addr(staddr[0])), stalen)
|
||||
if res < 0:
|
||||
let lastError = osLastError()
|
||||
if lastError.int32 notin {EINTR, EWOULDBLOCK, EAGAIN}:
|
||||
if lastError.int32 != EINTR and lastError.int32 != EWOULDBLOCK and
|
||||
lastError.int32 != EAGAIN:
|
||||
retFuture.fail(newException(OSError, osErrorMsg(lastError)))
|
||||
else:
|
||||
result = false # We still want this callback to be called.
|
||||
@@ -1472,7 +1475,8 @@ else:
|
||||
saddr, saddrLen)
|
||||
if res < 0:
|
||||
let lastError = osLastError()
|
||||
if lastError.int32 notin {EINTR, EWOULDBLOCK, EAGAIN}:
|
||||
if lastError.int32 != EINTR and lastError.int32 != EWOULDBLOCK and
|
||||
lastError.int32 != EAGAIN:
|
||||
retFuture.fail(newException(OSError, osErrorMsg(lastError)))
|
||||
else:
|
||||
result = false
|
||||
@@ -1493,7 +1497,7 @@ else:
|
||||
cast[ptr SockAddr](addr(sockAddress)), addr(addrLen))
|
||||
if client == osInvalidSocket:
|
||||
let lastError = osLastError()
|
||||
assert lastError.int32 notin {EWOULDBLOCK, EAGAIN}
|
||||
assert lastError.int32 != EWOULDBLOCK and lastError.int32 != EAGAIN
|
||||
if lastError.int32 == EINTR:
|
||||
return false
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user