Fix compilation errors introduced by latest chronos.

This commit is contained in:
cheatfate 2020-03-24 09:48:05 +02:00
parent 3d10513b3e
commit 1f5d994700
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
3 changed files with 4 additions and 4 deletions

View File

@ -545,7 +545,7 @@ proc getSocket(pattern: string,
closeSocket(sock)
# 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 =
## This procedure copy all environment variables into StringTable.

View File

@ -26,7 +26,7 @@ type
data: seq[byte]): Future[void] {.gcsafe.}
ValidatorHandler* = proc(topic: string,
message: Message): Future[bool] {.closure.}
message: Message): Future[bool] {.gcsafe, closure.}
TopicPair* = tuple[topic: string, handler: TopicHandler]

View File

@ -38,7 +38,7 @@ const DefaultBufferSize* = 1024
type
# 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
maxSize*: int # buffer's max size in bytes
@ -335,7 +335,7 @@ proc pipe*(s: BufferStream,
s.isPiped = true
let oldHandler = target.writeHandler
proc handler(data: seq[byte]) {.async, closure.} =
proc handler(data: seq[byte]) {.async, closure, gcsafe.} =
if not isNil(oldHandler):
await oldHandler(data)