From 3d9c0bffba3ef50986f4507a5596af0b732c51c6 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 15 May 2020 09:09:08 -0600 Subject: [PATCH] read from stream --- libp2p/protocols/secure/noise.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libp2p/protocols/secure/noise.nim b/libp2p/protocols/secure/noise.nim index e43258c0f..aef219154 100644 --- a/libp2p/protocols/secure/noise.nim +++ b/libp2p/protocols/secure/noise.nim @@ -267,12 +267,12 @@ template read_s: untyped = proc receiveHSMessage(sconn: Connection): Future[seq[byte]] {.async.} = var besize: array[2, byte] - await sconn.readExactly(addr besize[0], besize.len) + await sconn.stream.readExactly(addr besize[0], besize.len) let size = uint16.fromBytesBE(besize).int trace "receiveHSMessage", size var buffer = newSeq[byte](size) if buffer.len > 0: - await sconn.readExactly(addr buffer[0], buffer.len) + await sconn.stream.readExactly(addr buffer[0], buffer.len) return buffer proc sendHSMessage(sconn: Connection; buf: seq[byte]) {.async.} =