mirror of https://github.com/vacp2p/nim-libp2p.git
add proper pragmas
This commit is contained in:
parent
5177bbb492
commit
d63e0c003b
|
@ -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)
|
||||
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in New Issue