Fix backward compatibility of #822 (#862)

This commit is contained in:
Tanguy 2023-02-15 17:18:29 +01:00 committed by GitHub
parent 0012b639c8
commit 408dcf12bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -130,13 +130,18 @@ proc new*(
flags: set[ServerFlags] = {},
upgrade: Upgrade): T {.public.} =
let transport = T(
flags: flags,
clientFlags:
if ServerFlags.TcpNoDelay in flags:
{TransportFlags.TcpNoDelay}
else:
default(set[TransportFlags]),
let
transport = T(
flags: flags,
clientFlags:
if ServerFlags.TcpNoDelay in flags:
compilesOr:
{TransportFlags.TcpNoDelay}
do:
doAssert(false)
default(set[TransportFlags])
else:
default(set[TransportFlags]),
upgrader: upgrade)
return transport