mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Release 2.19.9
- [FEATURE] Add lsquic_stream_pwritev(). This function allows one to reduce the number of system calls required to read a file from disk by using lsquic_stream_pwritev() together with preadv(2). - [BUGFIX] When stream is reset, it is writeable -- let user collect the error. - [BUGFIX] Calculate correct conn flow control if reading ends early. - [BUGFIX] Remove stream from read and write queues on internal shutdown. This is a regression introduced in 2.19.7. - [BUGFIX] Swapped arguments in IETF RESET_FRAME generation. - Turn off mini conn history when compiling with Visual Studio; this allows the project to compile on Windows again. - http_client: Add -3 flag to stop reading from streams early; code cleanup. - Don't use -Werror.
This commit is contained in:
parent
49f1f4f620
commit
2f2f436324
25 changed files with 1545 additions and 85 deletions
|
@ -1457,6 +1457,45 @@ Writing To Streams
|
|||
the write functions -- :func:`lsquic_stream_write()` and
|
||||
:func:`lsquic_stream_writev()` utilize the same mechanism.
|
||||
|
||||
.. function:: ssize_t lsquic_stream_pwritev (struct lsquic_stream *stream, ssize_t (*preadv)(void *user_data, const struct iovec *iov, int iovcnt), void *user_data, size_t n_to_write)
|
||||
|
||||
:param stream: Stream to write to.
|
||||
:param preadv: Pointer to a custom ``preadv(2)``-like function.
|
||||
:param user_data: Data to pass to ``preadv`` function.
|
||||
:param n_to_write: Number of bytes to write.
|
||||
:return: Number of bytes written or -1 on error.
|
||||
|
||||
Write to stream using user-supplied ``preadv()`` function.
|
||||
The stream allocates one or more packets and calls ``preadv()``,
|
||||
which then fills the array of buffers. This is a good way to
|
||||
minimize the number of ``read(2)`` system calls; the user can call
|
||||
``preadv(2)`` instead.
|
||||
|
||||
The number of bytes available in the ``iov`` vector passed back to
|
||||
the user callback may be smaller than ``n_to_write``. The expected
|
||||
use pattern is to pass the number of bytes remaining in the file
|
||||
and keep on calling ``preadv(2)``.
|
||||
|
||||
Note that, unlike other stream-writing functions above,
|
||||
``lsquic_stream_pwritev()`` does *not* buffer bytes inside the
|
||||
stream; it only writes to packets. That means the caller must be
|
||||
prepared for this function to return 0 even inside the "on write"
|
||||
stream callback. In that case, the caller should fall back to using
|
||||
another write function.
|
||||
|
||||
It is OK for the ``preadv`` callback to write fewer bytes that
|
||||
``n_to_write``. (This can happen if the underlying data source
|
||||
is truncated.)
|
||||
|
||||
::
|
||||
|
||||
/*
|
||||
* For example, the return value of zero can be handled as follows:
|
||||
*/
|
||||
nw = lsquic_stream_pwritev(stream, my_readv, some_ctx, n_to_write);
|
||||
if (nw == 0)
|
||||
nw = lsquic_stream_write(stream, rem_bytes_buf, rem_bytes_len);
|
||||
|
||||
.. function:: int lsquic_stream_flush (lsquic_stream_t *stream)
|
||||
|
||||
:param stream: Stream to flush.
|
||||
|
|
|
@ -26,7 +26,7 @@ author = u'LiteSpeed Technologies'
|
|||
# The short X.Y version
|
||||
version = u'2.19'
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = u'2.19.8'
|
||||
release = u'2.19.9'
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue