Fixed potential crash

This commit is contained in:
Yuriy Glukhov 2018-05-11 13:00:25 +03:00
parent 128460099a
commit 5523cb44db
1 changed files with 1 additions and 1 deletions

View File

@ -215,7 +215,7 @@ proc dispatchMsg(peer: Peer, msgId: int, msgData: var Rlp) =
proc send(p: Peer, data: BytesRange) {.async.} =
var cipherText = encryptMsg(data, p.secretsState)
GC_ref(cipherText)
result = p.socket.send(addr cipherText[0], cipherText.len)
await p.socket.send(addr cipherText[0], cipherText.len)
GC_unref(cipherText)
proc fullRecvInto(s: AsyncSocket, buffer: pointer, bufferLen: int) {.async.} =