mirror of https://github.com/vacp2p/nim-libp2p.git
Fix appveyor problems.
This commit is contained in:
parent
236c685fb7
commit
c5925d0d9a
|
@ -488,9 +488,8 @@ proc recvMessage(conn: StreamTransport): Future[seq[byte]] {.async.} =
|
||||||
proc newConnection*(api: DaemonAPI): Future[StreamTransport] =
|
proc newConnection*(api: DaemonAPI): Future[StreamTransport] =
|
||||||
result = connect(api.address)
|
result = connect(api.address)
|
||||||
|
|
||||||
proc closeConnection*(api: DaemonAPI, transp: StreamTransport) {.async.} =
|
proc closeConnection*(api: DaemonAPI, transp: StreamTransport): Future[void] =
|
||||||
transp.close()
|
result = transp.closeWait()
|
||||||
await transp.join()
|
|
||||||
|
|
||||||
proc socketExists(address: MultiAddress): Future[bool] {.async.} =
|
proc socketExists(address: MultiAddress): Future[bool] {.async.} =
|
||||||
try:
|
try:
|
||||||
|
@ -726,7 +725,7 @@ proc newDaemonApi*(flags: set[P2PDaemonFlags] = {},
|
||||||
|
|
||||||
# Starting daemon process
|
# Starting daemon process
|
||||||
# echo "Starting ", cmd, " ", args.join(" ")
|
# echo "Starting ", cmd, " ", args.join(" ")
|
||||||
api.process = startProcess(cmd, "", args, env, {poStdErrToStdOut})
|
api.process = startProcess(cmd, "", args, env, {})
|
||||||
# Waiting until daemon will not be bound to control socket.
|
# Waiting until daemon will not be bound to control socket.
|
||||||
while true:
|
while true:
|
||||||
if not api.process.running():
|
if not api.process.running():
|
||||||
|
@ -750,8 +749,7 @@ proc newDaemonApi*(flags: set[P2PDaemonFlags] = {},
|
||||||
proc close*(stream: P2PStream) {.async.} =
|
proc close*(stream: P2PStream) {.async.} =
|
||||||
## Close ``stream``.
|
## Close ``stream``.
|
||||||
if P2PStreamFlags.Closed notin stream.flags:
|
if P2PStreamFlags.Closed notin stream.flags:
|
||||||
stream.transp.close()
|
await stream.transp.closeWait()
|
||||||
await stream.transp.join()
|
|
||||||
stream.transp = nil
|
stream.transp = nil
|
||||||
stream.flags.incl(P2PStreamFlags.Closed)
|
stream.flags.incl(P2PStreamFlags.Closed)
|
||||||
else:
|
else:
|
||||||
|
@ -773,7 +771,7 @@ proc close*(api: DaemonAPI) {.async.} =
|
||||||
discard tryRemoveFile($address)
|
discard tryRemoveFile($address)
|
||||||
api.servers.setLen(0)
|
api.servers.setLen(0)
|
||||||
# Closing daemon's process.
|
# Closing daemon's process.
|
||||||
if NoProcessCtrl in api.flags:
|
if NoProcessCtrl notin api.flags:
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
api.process.kill()
|
api.process.kill()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue