mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 19:02:18 +00:00
net: remove more erroneous set constructions (#14252) [backport]
Refs #13764
(cherry picked from commit 1a1e9986a3)
This commit is contained in:
@@ -177,11 +177,16 @@ proc isDisconnectionError*(flags: set[SocketFlag],
|
||||
## if flags contains ``SafeDisconn``.
|
||||
when useWinVersion:
|
||||
SocketFlag.SafeDisconn in flags and
|
||||
lastError.int32 in {WSAECONNRESET, WSAECONNABORTED, WSAENETRESET,
|
||||
WSAEDISCON, ERROR_NETNAME_DELETED}
|
||||
(lastError.int32 == WSAECONNRESET or
|
||||
lastError.int32 == WSAECONNABORTED or
|
||||
lastError.int32 == WSAENETRESET or
|
||||
lastError.int32 == WSAEDISCON or
|
||||
lastError.int32 == ERROR_NETNAME_DELETED)
|
||||
else:
|
||||
SocketFlag.SafeDisconn in flags and
|
||||
lastError.int32 in {ECONNRESET, EPIPE, ENETRESET}
|
||||
(lastError.int32 == ECONNRESET or
|
||||
lastError.int32 == EPIPE or
|
||||
lastError.int32 == ENETRESET)
|
||||
|
||||
proc toOSFlags*(socketFlags: set[SocketFlag]): cint =
|
||||
## Converts the flags into the underlying OS representation.
|
||||
|
||||
Reference in New Issue
Block a user