net: remove more erroneous set constructions (#14252) [backport]
Refs #13764
This commit is contained in:
parent
5a9b3c27c1
commit
1a1e9986a3
1 changed files with 8 additions and 3 deletions
|
|
@ -180,11 +180,16 @@ proc isDisconnectionError*(flags: set[SocketFlag],
|
||||||
## if flags contains ``SafeDisconn``.
|
## if flags contains ``SafeDisconn``.
|
||||||
when useWinVersion:
|
when useWinVersion:
|
||||||
SocketFlag.SafeDisconn in flags and
|
SocketFlag.SafeDisconn in flags and
|
||||||
lastError.int32 in {WSAECONNRESET, WSAECONNABORTED, WSAENETRESET,
|
(lastError.int32 == WSAECONNRESET or
|
||||||
WSAEDISCON, ERROR_NETNAME_DELETED}
|
lastError.int32 == WSAECONNABORTED or
|
||||||
|
lastError.int32 == WSAENETRESET or
|
||||||
|
lastError.int32 == WSAEDISCON or
|
||||||
|
lastError.int32 == ERROR_NETNAME_DELETED)
|
||||||
else:
|
else:
|
||||||
SocketFlag.SafeDisconn in flags and
|
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 =
|
proc toOSFlags*(socketFlags: set[SocketFlag]): cint =
|
||||||
## Converts the flags into the underlying OS representation.
|
## Converts the flags into the underlying OS representation.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue