diff options
author | alaviss <leorize+oss@disroot.org> | 2020-05-07 11:37:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 13:37:54 +0200 |
commit | 1a1e9986a34822d16cd20ec5b2a908a10677f4fd (patch) | |
tree | 9e24644b0104517bfaca60fb2d90f485f18738dd | |
parent | 5a9b3c27c1882eb1b7ab8845e4ff0c8a3c9f5835 (diff) | |
download | Nim-1a1e9986a34822d16cd20ec5b2a908a10677f4fd.tar.gz |
net: remove more erroneous set constructions (#14252) [backport]
Refs #13764
-rw-r--r-- | lib/pure/net.nim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim index 10589ac12..b08629a96 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -180,11 +180,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. |