This commit is contained in:
Dmitriy Ryajov 2020-05-29 10:25:25 -06:00
parent 27a7f8c948
commit 4df151a3a3
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ proc writeMsg*(conn: Connection,
let
chunkSize = if left > MaxMsgSize: MaxMsgSize - 64 else: left
chunk = if chunkSize > 0 : data[offset..(offset + chunkSize - 1)] else: data
## write lenght prefixed
## write length prefixed
var buf = initVBuffer()
buf.writePBVarint(id shl 3 or ord(msgType).uint64)
buf.writePBVarint(chunkSize.uint64) # size should be always sent

View File

@ -44,7 +44,7 @@ proc writeLp*(s: StreamTransport, msg: string | seq[byte]): Future[int] {.gcsafe
result = s.write(buf.buffer)
proc readLp*(s: StreamTransport): Future[seq[byte]] {.async, gcsafe.} =
## read lenght prefixed msg
## read length prefixed msg
var
size: uint
length: int