mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-01-12 03:54:06 +00:00
Fix compilation errors introduced by latest chronos.
This commit is contained in:
parent
3d10513b3e
commit
1f5d994700
@ -545,7 +545,7 @@ proc getSocket(pattern: string,
|
|||||||
closeSocket(sock)
|
closeSocket(sock)
|
||||||
|
|
||||||
# This is forward declaration needed for newDaemonApi()
|
# This is forward declaration needed for newDaemonApi()
|
||||||
proc listPeers*(api: DaemonAPI): Future[seq[PeerInfo]] {.async.}
|
proc listPeers*(api: DaemonAPI): Future[seq[PeerInfo]] {.async, gcsafe.}
|
||||||
|
|
||||||
proc copyEnv(): StringTableRef =
|
proc copyEnv(): StringTableRef =
|
||||||
## This procedure copy all environment variables into StringTable.
|
## This procedure copy all environment variables into StringTable.
|
||||||
|
@ -26,7 +26,7 @@ type
|
|||||||
data: seq[byte]): Future[void] {.gcsafe.}
|
data: seq[byte]): Future[void] {.gcsafe.}
|
||||||
|
|
||||||
ValidatorHandler* = proc(topic: string,
|
ValidatorHandler* = proc(topic: string,
|
||||||
message: Message): Future[bool] {.closure.}
|
message: Message): Future[bool] {.gcsafe, closure.}
|
||||||
|
|
||||||
TopicPair* = tuple[topic: string, handler: TopicHandler]
|
TopicPair* = tuple[topic: string, handler: TopicHandler]
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ const DefaultBufferSize* = 1024
|
|||||||
|
|
||||||
type
|
type
|
||||||
# TODO: figure out how to make this generic to avoid casts
|
# TODO: figure out how to make this generic to avoid casts
|
||||||
WriteHandler* = proc (data: seq[byte]): Future[void]
|
WriteHandler* = proc (data: seq[byte]): Future[void] {.gcsafe.}
|
||||||
|
|
||||||
BufferStream* = ref object of LPStream
|
BufferStream* = ref object of LPStream
|
||||||
maxSize*: int # buffer's max size in bytes
|
maxSize*: int # buffer's max size in bytes
|
||||||
@ -335,7 +335,7 @@ proc pipe*(s: BufferStream,
|
|||||||
|
|
||||||
s.isPiped = true
|
s.isPiped = true
|
||||||
let oldHandler = target.writeHandler
|
let oldHandler = target.writeHandler
|
||||||
proc handler(data: seq[byte]) {.async, closure.} =
|
proc handler(data: seq[byte]) {.async, closure, gcsafe.} =
|
||||||
if not isNil(oldHandler):
|
if not isNil(oldHandler):
|
||||||
await oldHandler(data)
|
await oldHandler(data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user