no more buffer resets on len prefixed reads
This commit is contained in:
parent
dd3f85965b
commit
5ae37cac98
|
@ -92,7 +92,6 @@ proc readLp*(s: Connection): Future[seq[byte]] {.async, gcsafe.} =
|
||||||
if res == VarintStatus.Success:
|
if res == VarintStatus.Success:
|
||||||
break
|
break
|
||||||
if res != VarintStatus.Success or size > DefaultReadSize:
|
if res != VarintStatus.Success or size > DefaultReadSize:
|
||||||
buffer.setLen(0)
|
|
||||||
result = buffer
|
result = buffer
|
||||||
return
|
return
|
||||||
buffer.setLen(size)
|
buffer.setLen(size)
|
||||||
|
|
|
@ -38,7 +38,6 @@ proc readMplexVarint(conn: Connection): Future[Option[uint]] {.async, gcsafe.} =
|
||||||
if res == VarintStatus.Success:
|
if res == VarintStatus.Success:
|
||||||
return some(varint)
|
return some(varint)
|
||||||
if res != VarintStatus.Success:
|
if res != VarintStatus.Success:
|
||||||
buffer.setLen(0)
|
|
||||||
return
|
return
|
||||||
except LPStreamIncompleteError:
|
except LPStreamIncompleteError:
|
||||||
debug "unable to read varing", exc = getCurrentExceptionMsg()
|
debug "unable to read varing", exc = getCurrentExceptionMsg()
|
||||||
|
|
Loading…
Reference in New Issue