add proper pragmas

This commit is contained in:
Dmitriy Ryajov 2019-09-02 14:45:52 -06:00
parent 5177bbb492
commit d63e0c003b
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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 =