Skip to content

Commit

Permalink
Fix backward compatibility of #822
Browse files Browse the repository at this point in the history
  • Loading branch information
Menduist committed Feb 15, 2023
1 parent 0012b63 commit 15cab5e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions libp2p/transports/tcptransport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,17 @@ 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)
else:
default(set[TransportFlags]),
upgrader: upgrade)

return transport
Expand Down

0 comments on commit 15cab5e

Please sign in to comment.