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] = {}, flags: set[ServerFlags] = {},
upgrade: Upgrade): T {.public.} = upgrade: Upgrade): T {.public.} =
let transport = T( let
flags: flags, transport = T(
clientFlags: flags: flags,
if ServerFlags.TcpNoDelay in flags: clientFlags:
{TransportFlags.TcpNoDelay} if ServerFlags.TcpNoDelay in flags:
else: compilesOr:
default(set[TransportFlags]), {TransportFlags.TcpNoDelay}
do:
doAssert(false)
default(set[TransportFlags])
else:
default(set[TransportFlags]),
upgrader: upgrade) upgrader: upgrade)
return transport return transport