mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-27 20:10:50 +00:00
typos
This commit is contained in:
parent
7e8f0510d6
commit
132f0d7ee4
@ -57,7 +57,7 @@ proc writeMsg*(conn: Connection,
|
|||||||
let
|
let
|
||||||
chunkSize = if left > MaxMsgSize: MaxMsgSize - 64 else: left
|
chunkSize = if left > MaxMsgSize: MaxMsgSize - 64 else: left
|
||||||
chunk = if chunkSize > 0 : data[offset..(offset + chunkSize - 1)] else: data
|
chunk = if chunkSize > 0 : data[offset..(offset + chunkSize - 1)] else: data
|
||||||
## write lenght prefixed
|
## write length prefixed
|
||||||
var buf = initVBuffer()
|
var buf = initVBuffer()
|
||||||
buf.writePBVarint(id shl 3 or ord(msgType).uint64)
|
buf.writePBVarint(id shl 3 or ord(msgType).uint64)
|
||||||
buf.writePBVarint(chunkSize.uint64) # size should be always sent
|
buf.writePBVarint(chunkSize.uint64) # size should be always sent
|
||||||
|
@ -44,7 +44,7 @@ proc writeLp*(s: StreamTransport, msg: string | seq[byte]): Future[int] {.gcsafe
|
|||||||
result = s.write(buf.buffer)
|
result = s.write(buf.buffer)
|
||||||
|
|
||||||
proc readLp*(s: StreamTransport): Future[seq[byte]] {.async, gcsafe.} =
|
proc readLp*(s: StreamTransport): Future[seq[byte]] {.async, gcsafe.} =
|
||||||
## read lenght prefixed msg
|
## read length prefixed msg
|
||||||
var
|
var
|
||||||
size: uint
|
size: uint
|
||||||
length: int
|
length: int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user