fix some problems raised by Nim 0.20.2
This commit is contained in:
parent
3b02cbd946
commit
8168fcea25
|
@ -52,7 +52,7 @@ macro checkGet(node: JsonNode, fieldName: string,
|
|||
of JObject: result.add(quote do: `n`.getObject)
|
||||
else: discard
|
||||
|
||||
proc processMessage*(self: RpcClient, line: string) =
|
||||
proc processMessage*(self: RpcClient, line: string) {.gcsafe.} =
|
||||
# Note: this doesn't use any transport code so doesn't need to be
|
||||
# differentiated.
|
||||
let node = parseJson(line)
|
||||
|
@ -82,9 +82,10 @@ proc processMessage*(self: RpcClient, line: string) =
|
|||
elif "method" in node:
|
||||
# This could be subscription notification
|
||||
let name = node["method"].getStr()
|
||||
let handler = self.methodHandlers.getOrDefault(name)
|
||||
if not handler.isNil:
|
||||
handler(node{"params"})
|
||||
{.gcsafe.}:
|
||||
let handler = self.methodHandlers.getOrDefault(name)
|
||||
if not handler.isNil:
|
||||
handler(node{"params"})
|
||||
else:
|
||||
raise newException(ValueError, "Invalid jsonrpc message: " & $node)
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ proc httpMethod*(client: RpcHttpClient, m: HttpMethod) =
|
|||
client.options.httpMethod = m
|
||||
|
||||
method call*(client: RpcHttpClient, name: string,
|
||||
params: JsonNode): Future[Response] {.async.} =
|
||||
params: JsonNode): Future[Response] {.async, gcsafe.} =
|
||||
## Remotely calls the specified RPC method.
|
||||
let id = client.getNextId()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ../client, chronos, tables, json
|
||||
import ../client, chronos, tables, json, strtabs
|
||||
|
||||
const newsUseChronos = true
|
||||
include news
|
||||
|
|
Loading…
Reference in New Issue