From 5d4338d29456769c1655a3c9a3b60970ed0ace03 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Wed, 12 Jun 2019 18:26:20 +0300 Subject: [PATCH] Fix chunkedstream documentation. Remove unnecessary asserts. --- chronos/streams/asyncstream.nim | 4 +--- chronos/streams/chunkstream.nim | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chronos/streams/asyncstream.nim b/chronos/streams/asyncstream.nim index 1c623de..a61874f 100644 --- a/chronos/streams/asyncstream.nim +++ b/chronos/streams/asyncstream.nim @@ -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) diff --git a/chronos/streams/chunkstream.nim b/chronos/streams/chunkstream.nim index d7b817c..d2723f2 100644 --- a/chronos/streams/chunkstream.nim +++ b/chronos/streams/chunkstream.nim @@ -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