From 1a1e9986a34822d16cd20ec5b2a908a10677f4fd Mon Sep 17 00:00:00 2001 From: alaviss Date: Thu, 7 May 2020 11:37:54 +0000 Subject: net: remove more erroneous set constructions (#14252) [backport] Refs #13764 --- lib/pure/net.nim | 11 ++++++++--- 1 file 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. -- cgit 1.4.1-2-gfad0