This module implements HTTP/1.1 chunked-encoded stream reading and writing.
Types
ChunkedStreamError = object of AsyncStreamError
- Source Edit
ChunkedStreamIncompleteError = object of ChunkedStreamError
- Source Edit
ChunkedStreamProtocolError = object of ChunkedStreamError
- Source Edit
ChunkedStreamReader = ref object of AsyncStreamReader
- Source Edit
ChunkedStreamWriter = ref object of AsyncStreamWriter
- Source Edit
Procs
proc init(child: ChunkedStreamReader; rsource: AsyncStreamReader; bufferSize = ChunkBufferSize) {....raises: [], tags: [RootEffect].}
- Source Edit
proc init(child: ChunkedStreamWriter; wsource: AsyncStreamWriter; queueSize = AsyncStreamDefaultQueueSize) {....raises: [], tags: [RootEffect].}
- Source Edit
proc init[T](child: ChunkedStreamReader; rsource: AsyncStreamReader; bufferSize = ChunkBufferSize; udata: ref T) {....raises: [].}
- Source Edit
proc init[T](child: ChunkedStreamWriter; wsource: AsyncStreamWriter; queueSize = AsyncStreamDefaultQueueSize; udata: ref T) {....raises: [].}
- Source Edit
proc newChunkedStreamReader(rsource: AsyncStreamReader; bufferSize = AsyncStreamDefaultBufferSize): ChunkedStreamReader {. ...raises: [], tags: [RootEffect].}
- Source Edit
proc newChunkedStreamReader[T](rsource: AsyncStreamReader; bufferSize = AsyncStreamDefaultBufferSize; udata: ref T): ChunkedStreamReader {....raises: [].}
- Source Edit
proc newChunkedStreamWriter(wsource: AsyncStreamWriter; queueSize = AsyncStreamDefaultQueueSize): ChunkedStreamWriter {. ...raises: [], tags: [RootEffect].}
- Source Edit
proc newChunkedStreamWriter[T](wsource: AsyncStreamWriter; queueSize = AsyncStreamDefaultQueueSize; udata: ref T): ChunkedStreamWriter {....raises: [].}
- Source Edit
Exports
-
setThreadDispatcher, closeSocket, ENOSR, EHOSTUNREACH, EHOSTDOWN, ECONNRESET, EDQUOT, fail, ECANCELED, EMLINK, FuturePendingError, milliseconds, <=, +=, $, asyncTimer, internalRaiseIfError, getSrcLocation, FutureError, fromNow, weeks, ESPIPE, withTimeout, LocationKind, id, <=, FutureCompletedError, ENOEXEC, ESHUTDOWN, fail, EREMOTEIO, toString, EXFULL, waitFor, complete, ==, oneValue, internalInitFutureBase, EPROTONOSUPPORT, Nanosecond, epochNanoSeconds, cancelAndWait, addTimer, Moment, ECOMM, EPROTOTYPE, AsyncExceptionError, milliseconds, getTrackerCounter, ENOENT, millis, removeTimer, FutureFlag, ENOTCONN, EBUSY, init, ENOTUNIQ, days, +=, await, or, ZeroDuration, EKEYREVOKED, AsyncTimeoutError, EUCLEAN, Second, EEXIST, ENOLINK, newInternalRaisesFuture, idleAsync, ==, internalRaiseIfError, SomeIntegerI64, ENOMEM, ENOKEY, +, removeWriter2, ENOMSG, [], trackCounter, EKEYEXPIRED, Week, isCounterLeaked, awaitne, EAFNOSUPPORT, EWOULDBLOCK, EREMOTE, Finished, untrackCounter, AsyncCallback, EHWPOISON, epochSeconds, newDispatcher, EPERM, microseconds, trackerCounters, >=, weeks, Finished, cancelCallback=, ETOOMANYREFS, $, EISCONN, callSoon, ESOCKTNOSUPPORT, setGlobalDispatcher, EXDEV, EBADF, cancelSoon, allFinished, TrackerBase, hours, InternalAsyncCallback, EBFONT, ENETDOWN, EACCES, ELOOP, InfiniteDuration, ETIMEDOUT, >=, EINVAL, value, EBADFD, Future, completed, PDispatcher, ESRCH, EL2NSYNC, EFAULT, low, ESTRPIPE, -=, or, ENOTSOCK, getAsyncTimestamp, await, Hour, EIDRM, removeReader2, secs, getThreadDispatcher, futureContinue, ENOANO, EADV, CallbackFunc, ENFILE, FutureBase, waitFor, high, Microsecond, ENOPKG, ELIBBAD, callSoon, EOWNERDEAD, flags, ERANGE, done, ENONET, completed, callSoon, cancelSoon, EMSGSIZE, EALREADY, EBADMSG, EILSEQ, ENOPROTOOPT, SrcLoc, allFutures, -, complete, FutureState, EBADR, nanos, location, FutureDefect, EDOTDOT, ENOBUFS, EKEYREJECTED, <, Minute, error, ==, one, CancelledError, nanoseconds, EISDIR, EOVERFLOW, FutureSeq, cancelAndWait, micros, all, -, ESRMNT, ENOTEMPTY, EPROTO, TimerCallback, microseconds, error, ENOTRECOVERABLE, wait, callIdle, join, hours, AsyncError, EBADRQC, ENODEV, tryCancel, addTimer, ECHRNG, ENOTDIR, EUNATCH, cancelAndSchedule, failed, nanoseconds, ERESTART, *, ETXTBSY, getTracker, newFutureStr, EMFILE, LocFinishIndex, withTimeout, addTimer, race, EUSERS, ENOTBLK, ENOTTY, EISNAM, ELIBACC, ENAVAIL, init, race, internalCallTick, EDESTADDRREQ, +, cancelSoon, completed, minutes, cancel, FutureFlags, getGlobalDispatcher, ELIBEXEC, stepsAsync, micros, wait, EINPROGRESS, EPFNOSUPPORT, E2BIG, -=, runForever, ENOMEDIUM, secs, value, read, waitFor, EL3HLT, unregisterAndCloseFd, EBADSLT, InternalRaisesFuture, -, <, ENETRESET, fastEpochTime, ENXIO, isZero, EPIPE, allFutures, Day, wait, now, read, asyncSpawn, removeCallback, EAGAIN, raiseOsDefect, trackerCounterKeys, EADDRNOTAVAIL, read, removeCallback, TrackerCounter, async, addCallback, init, async, EREMCHG, finished, addCallback, seconds, noCancel, low, AsyncFD, ECHILD, Raising, init, ECONNABORTED, state, wait, >, callIdle, removeTimer, LocCreateIndex, addReader2, ETIME, ENOLCK, EDEADLK, asyncCheck, Duration, ELNRNG, EDOM, ENOCSI, millis, EBADE, EMEDIUMTYPE, readError, sleepAsync, isInfinite, asyncDiscard, callback=, ENETUNREACH, InternalFutureBase, callIdle, ENOSYS, ELIBSCN, EIO, EROFS, seconds, ELIBMAX, div, init, EL2HLT, EOPNOTSUPP, FutureStr, poll, oneIndex, clearTimer, register2, LocCompleteIndex, days, ENOSTR, EADDRINUSE, one, sleepAsync, ENAMETOOLONG, EMULTIHOP, ESTALE, race, ENODATA, EFBIG, +, minutes, ERFKILL, cancelled, $, toException, join, EDEADLOCK, allFutures, MaxEventsCount, wait, read, raiseAsDefect, ENOSPC, Millisecond, >, setTimer, cancelSoon, unregister2, failed, waitFor, newFutureSeq, addTracker, callback=, orImpl, ECONNREFUSED, high, ENOTNAM, nanos, addWriter2, removeTimer, internalCallTick, EINTR, and, closeHandle, EL3RST, readError, *, newFuture, internalCallTick, EDQUOT, AsyncStreamError, createStreamServer, milliseconds, ==, createStreamServer, EMLINK, createStreamServer, milliseconds, EMFILE, $, fromNow, close, weeks, LocFinishIndex, getTransportOsError, read, id, <=, FutureCompletedError, waitFor, finished, EPROTONOSUPPORT, cancelAndWait, createStreamServer, windowsAnyAddressFix, failed, createStreamServer, newAsyncStreamWriter, removeTimer, race, EAFNOSUPPORT, ENOSPC, TransportUseClosedError, idleAsync, init, initTAddress, ENOKEY, Week, cancelSoon, awaitne, [], EREMOTE, EFAULT, epochSeconds, close, microseconds, AsyncEvent, weeks, cancelCallback=, ETOOMANYREFS, and, raiseAsyncStreamLimitError, TransportInitCallback, localAddress, StreamServerTrackerName, micros, wait, ENETDOWN, EACCES, EINVAL, full, EBADFD, seconds, AsyncStreamWriteError, read, raiseTransportOsError, finish, start, join, AsyncStreamIncorrectDefect, <=, init, completed, FutureBase, ELIBBAD, TransportLimitError, or, cancelSoon, EILSEQ, allFutures, EADV, -, newAsyncStreamWriter, location, addFirstNoWait, ENOLCK, FutureSeq, cancelAndWait, all, EPROTO, getConnectionAbortedError, callIdle, value, ENODEV, close, ECHRNG, ERFKILL, setTimer, nanoseconds, closeWait, get, running, addTimer, ENOTTY, EISNAM, init, createStreamServer, +, FutureFlags, getGlobalDispatcher, ELIBEXEC, $, E2BIG, -=, AsyncStreamReader, AsyncQueueEmptyError, newAsyncStreamWriter, <, checkWriteEof, fastEpochTime, resolveTAddress, read, toHex, fromPipe2, TrackerCounter, write, localAddress2, start2, async, EREMCHG, finished, StreamServer, SocketFlags, low, stopped, removeTimer, createStreamServer, release, Duration, failed, ==, AsyncStreamDefaultQueueSize, initTAddress, getUserData, localAddress, orImpl, EROFS, seconds, init, readerOverflow, nanos, atEof, consume, Nanosecond, race, ENODATA, init, +, $, DefaultStreamBufferSize, read, resolveTAddress, createStreamServer, failed, ELIBSCN, ENOTNAM, nanos, closeHandle, ENOTUNIQ, newFuture, popFirstNoWait, closeSocket, ECONNRESET, [], Second, getSrcLocation, FutureError, getTransportTooManyError, init, withTimeout, EREMOTEIO, oneIndex, oneValue, ENOENT, AsyncStreamReadError, []=, []=, setThreadDispatcher, EEXIST, ENOMSG, ESHUTDOWN, removeWriter2, [], setDualstack, isCounterLeaked, EWOULDBLOCK, Finished, untrackCounter, readMessage, setGlobalDispatcher, TrackerBase, >=, AsyncEventQueue, addCallback, TransportError, ESTRPIPE, $, EISCONN, callSoon, getServerUseClosedError, readUntil, close, EBADF, microseconds, ETIMEDOUT, Future, EL2NSYNC, ETIME, getDomain, EL2HLT, EIDRM, removeReader2, futureContinue, ENOANO, DefaultBacklogSize, register, closed, ERANGE, done, popLastNoWait, init, ENONET, completed, EMSGSIZE, EBADMSG, ENOPROTOOPT, initTAddress, newAsyncStreamWriter, EDOTDOT, one, Minute, CancelledError, readLine, EOVERFLOW, raiseTransportError, newAsyncStreamReader, AnyAddress6, ENOTEMPTY, TimerCallback, EADDRNOTAVAIL, wait, AsyncStreamIncompleteError, WriteType, checkClosed, size, EUNATCH, newAsyncLock, div, ERESTART, newFutureStr, FuturePendingError, unregisterAndCloseFd, newAsyncQueue, newAsyncEvent, ENOTBLK, race, InternalRaisesFuture, cancelSoon, cancel, micros, wait, unregister, EINPROGRESS, -, remoteAddress, new, AsyncStreamDefaultBufferSize, EDOM, EPIPE, AsyncLockError, getNoWait, len, EDESTADDRREQ, shutdownWait, removeCallback, EAGAIN, FutureFlag, read, async, resolveTAddress, emit, ENXIO, noCancel, consume, init, ECONNABORTED, state, EBFONT, EDEADLK, ENOEXEC, asyncCheck, locked, readError, ZeroDuration, ENOSYS, EventQueueKey, ELIBMAX, EOPNOTSUPP, ENOSTR, one, getTransportError, newAsyncStreamReader, AsyncStream, checkClosed, Raising, popFirst, join, read, items, Millisecond, consume, callIdle, ECONNREFUSED, addWriter2, EL3HLT, join, readError, *, asyncTimer, EHOSTUNREACH, EHOSTDOWN, ECANCELED, init, +=, EPFNOSUPPORT, internalRaiseIfError, newInternalRaisesFuture, ESPIPE, LocationKind, TransportAddress, SomeIntegerI64, complete, AsyncBufferRef, internalInitFutureBase, AddressFamily, nanoseconds, host, ECOMM, init, closed, join, getTrackerCounter, millis, AsyncBuffer, ENOTCONN, EBUSY, days, sleepAsync, +=, consume, internalCallTick, checkStreamFinished, isZero, StreamReaderLoop, internalRaiseIfError, ENOMEM, addFirst, EKEYEXPIRED, or, EPERM, AsyncCallback, trackerCounters, fromPipe, newAsyncEventQueue, DefaultDatagramBufferSize, ESOCKTNOSUPPORT, EHWPOISON, AsyncQueue, EXDEV, EKEYREVOKED, toIpAddress, hours, TransportIncompleteError, InfiniteDuration, setDualstack, >=, clear, value, ESRCH, fire, fromSAddr, ENOMEDIUM, secs, getThreadDispatcher, write, isAvailable, AsyncStreamRW, waitFor, isSet, SocketServer, FutureStr, addLastNoWait, getTransportOsError, read, checkStreamClosed, waitFor, epochNanoSeconds, ENOPKG, newAsyncStreamWriter, callSoon, WriteItem, EBADE, len, getAsyncTimestamp, FutureState, EBADR, put, EKEYREJECTED, init, EISDIR, address, StreamWriterLoop, ESRMNT, ENAVAIL, error, write, AsyncError, EBADRQC, ENFILE, createStreamServer, failed, getAutoAddresses, mitems, getUserData, ETXTBSY, withTimeout, flags, ELIBACC, Day, minutes, DualStackType, ReadMessagePredicate, AsyncStreamWriter, runForever, toException, init, EBADSLT, closed, TransportUseEofError, ENETRESET, waitEvents, upload, AsyncStreamState, wait, asyncSpawn, removeCallback, AsyncLock, getConnectionAbortedError, init, addCallback, clearTimer, newAsyncStreamReader, AsyncFD, ECHILD, newAsyncStreamUseClosedError, >, callIdle, LocCreateIndex, AsyncStreamWriterTrackerName, ==, StreamTransportTrackerName, getError, join, millis, EMEDIUMTYPE, sleepAsync, getDomain, asyncDiscard, callback=, EIO, write, tryCancel, high, poll, days, ==, ESTALE, minutes, toException, MaxEventsCount, wait, raiseAsDefect, newAsyncStreamReader, >, addReader2, unregister2, addTracker, callback=, high, toString, internalCallTick, EINTR, internalCallTick, raiseAsyncStreamWriteEOFError, closeWait, fail, popLast, transfer, AsyncStreamWriteEOFError, StreamCallback, readOnce, closeWait, AsyncStreamLimitError, connect, fail, addTimer, Moment, EPROTOTYPE, AsyncExceptionError, SrcLoc, ENOCSI, init, now, await, AsyncTimeoutError, createStreamServer, ENOLINK, +, StreamTransport, newAsyncStreamLimitError, trackCounter, init, newDispatcher, StreamCallback2, TransportFlags, completed, readOnce, newAsyncStreamWriter, error, ServerFlags, TransportTooManyError, readExactly, ELOOP, ENOSR, $, AsyncStreamReaderTrackerName, allFinished, ServerCommand, resolveTAddress, PDispatcher, trackerCounterKeys, Finished, low, toUnchecked, -=, ==, TransportKind, stop2, Hour, init, writeFile, atEof, resolveTAddress, addLast, CallbackFunc, contains, Microsecond, pairs, EOWNERDEAD, connect, readMessage, callSoon, readUntil, EALREADY, TransportOsError, addTimer, initTAddress, FutureDefect, ENOBUFS, <, cancelSoon, -, resolveTAddress, ENOTRECOVERABLE, ENOTDIR, hours, ==, wait, cancelAndSchedule, *, getTracker, getAutoAddress, readLine, ServerStatus, complete, EUSERS, EXFULL, EUCLEAN, raiseEmptyMessageDefect, accept, stepsAsync, clear, EventQueueReader, secs, read, waitFor, newAsyncStreamReader, TransportNoSupport, empty, closeWait, write, raiseAsyncStreamIncompleteError, allFutures, copyOut, raiseOsDefect, toSAddr, acquire, AsyncQueueFullError, write, TransportAbortedError, wait, newAsyncStreamReader, ELNRNG, raiseAsyncStreamUseClosedError, isInfinite, finished, AsyncStreamUseClosedError, InternalAsyncCallback, ENETUNREACH, InternalFutureBase, readExactly, getTransportUseClosedError, resolveTAddress, AsyncEventQueueFullError, init, atEof, resolveTAddress, register2, LocCompleteIndex, forget, EADDRINUSE, EMULTIHOP, putNoWait, AnyAddress, await, EFBIG, TransportAddressError, cancelled, EDEADLOCK, allFutures, running, newFutureSeq, newAsyncStreamIncompleteError, ENOTSOCK, TransportState, remoteAddress2, removeTimer, stop, EL3RST, ENAMETOOLONG, localAddress2, close, createStreamServer, createStreamServer, start2, StreamCallback2, closeWait, fromPipe, readLine, TransportFlags, ReadMessagePredicate, TransportInitCallback, localAddress, createStreamServer, running, StreamTransportTrackerName, StreamCallback, getUserData, createStreamServer, connect, join, finished, readExactly, start, localAddress, TransportKind, write, write, writeFile, SocketFlags, atEof, createStreamServer, readMessage, shutdownWait, closed, StreamServer, accept, remoteAddress2, createStreamServer, close, readOnce, DefaultBacklogSize, write, createStreamServer, closed, connect, toUnchecked, consume, toException, readUntil, read, createStreamServer, stop2, createStreamServer, consume, failed, createStreamServer, closeWait, join, StreamServerTrackerName, StreamTransport, stop, remoteAddress, fromPipe2, read, Hour, init, fromNow, milliseconds, <, fastEpochTime, Minute, secs, Day, micros, >=, ==, nanoseconds, +, >=, nanos, minutes, <=, low, milliseconds, millis, $, micros, asyncTimer, +=, Nanosecond, -, -, Second, >, high, epochNanoSeconds, Microsecond, weeks, microseconds, secs, InfiniteDuration, -=, +, minutes, +=, microseconds, $, hours, toString, hours, Duration, now, <, weeks, Millisecond, <=, millis, >, ==, seconds, isZero, ZeroDuration, isInfinite, SomeIntegerI64, div, +, *, epochSeconds, high, nanoseconds, nanos, low, -, days, -=, Week, days, seconds, *, Moment, ==, DualStackType, toHex, getAutoAddress, address, ==, resolveTAddress, TransportAddress, TransportIncompleteError, getAutoAddresses, ==, initTAddress, AddressFamily, ServerStatus, host, getTransportOsError, getTransportOsError, $, getTransportTooManyError, windowsAnyAddressFix, setDualstack, toIpAddress, $, $, TransportNoSupport, TransportUseClosedError, TransportUseEofError, ServerFlags, resolveTAddress, TransportAbortedError, ==, initTAddress, $, setDualstack, resolveTAddress, getConnectionAbortedError, toSAddr, TransportError, AnyAddress, resolveTAddress, ==, getDomain, getServerUseClosedError, resolveTAddress, fromSAddr, TransportTooManyError, checkClosed, ServerCommand, getTransportUseClosedError, getTransportError, resolveTAddress, initTAddress, raiseTransportOsError, TransportOsError, getDomain, resolveTAddress, checkWriteEof, resolveTAddress, isAvailable, SocketServer, ==, DefaultDatagramBufferSize, getError, TransportAddressError, TransportLimitError, DefaultStreamBufferSize, getConnectionAbortedError, raiseTransportError, AnyAddress6, checkClosed, TransportState, initTAddress