From d63e0c003b03e9e985328b0a4a0e8a708d93473e Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 2 Sep 2019 14:45:52 -0600 Subject: [PATCH] add proper pragmas --- libp2p/identify.nim | 2 +- libp2p/protocol.nim | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libp2p/identify.nim b/libp2p/identify.nim index 83464afba..931153feb 100644 --- a/libp2p/identify.nim +++ b/libp2p/identify.nim @@ -80,7 +80,7 @@ proc decodeMsg*(buf: seq[byte]): IdentifyInfo = discard pb.getString(6, result.agentVersion) method init*(p: Identify) = - proc handle(conn: Connection, proto: string) {.async, gcsafe.} = + proc handle(conn: Connection, proto: string) {.async, gcsafe, closure.} = var pb = encodeMsg(p.peerInfo, await conn.getObservedAddrs()) await conn.writeLp(pb.buffer) diff --git a/libp2p/protocol.nim b/libp2p/protocol.nim index 2c238da2a..1daa17fd6 100644 --- a/libp2p/protocol.nim +++ b/libp2p/protocol.nim @@ -14,12 +14,12 @@ import connection, transport, type LPProtoHandler* = proc (conn: Connection, proto: string): - Future[void] {.gcsafe.} + Future[void] {.gcsafe, closure.} LPProtocol* = ref object of RootObj peerInfo*: PeerInfo codec*: string - handler*: LPProtoHandler + handler*: LPProtoHandler ## this handler gets invoked by the protocol negotiator proc newProtocol*(p: typedesc[LPProtocol], peerInfo: PeerInfo): p =