mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-02-20 15:08:13 +00:00
Fix chunkedstream documentation.
Remove unnecessary asserts.
This commit is contained in:
parent
f83d1b4da4
commit
5d4338d294
@ -73,7 +73,7 @@ type
|
||||
udata: pointer
|
||||
future: Future[void]
|
||||
|
||||
AsyncStream* = ref object of RootRef
|
||||
AsyncStream* = object of RootObj
|
||||
reader*: AsyncStreamReader
|
||||
writer*: AsyncStreamWriter
|
||||
|
||||
@ -115,7 +115,6 @@ proc `[]`*(sb: AsyncBuffer, index: int): byte {.inline.} =
|
||||
result = sb.buffer[index]
|
||||
|
||||
proc update*(sb: var AsyncBuffer, size: int) {.inline.} =
|
||||
doAssert(sb.offset + size < len(sb.buffer))
|
||||
sb.offset += size
|
||||
|
||||
proc wait*(sb: var AsyncBuffer): Future[void] =
|
||||
@ -140,7 +139,6 @@ proc shift*(sb: var AsyncBuffer, size: int) {.inline.} =
|
||||
sb.offset = 0
|
||||
|
||||
proc copyData*(sb: AsyncBuffer, dest: pointer, offset, length: int) {.inline.} =
|
||||
doAssert(length <= sb.dataLen())
|
||||
copyMem(cast[pointer](cast[uint](dest) + cast[uint](offset)),
|
||||
unsafeAddr sb.buffer[0], length)
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
# Licensed under either of
|
||||
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
||||
# MIT license (LICENSE-MIT)
|
||||
|
||||
## This module implements HTTP/1.1 chunked-encoded stream reading and writing.
|
||||
import ../asyncloop, ../timer
|
||||
import asyncstream, ../transports/stream, ../transports/common
|
||||
export asyncstream, stream, timer, common
|
||||
|
Loading…
x
Reference in New Issue
Block a user