nghttp3_conn_read_stream2 ========================= Synopsis -------- *#include * .. function:: nghttp3_ssize nghttp3_conn_read_stream2(nghttp3_conn *conn, int64_t stream_id, const uint8_t *src, size_t srclen, int fin, nghttp3_tstamp ts) `nghttp3_conn_read_stream2` reads data *src* of length *srclen* on stream identified by *stream_id*. It returns the number of bytes consumed. The "consumed" means that application can increase flow control credit (both stream and connection) of underlying QUIC connection by that amount. It does not include the amount of data carried by DATA frame which contains application data (excluding any control or QPACK unidirectional streams). See :type:`nghttp3_recv_data` to handle those bytes. If *fin* is nonzero, this is the last data from remote endpoint in this stream. *ts* is the current timestamp, and must be non-decreasing. It should be obtained from the clock that is steadily increasing. This function returns the number of bytes consumed, or one of the following negative error codes: :macro:`NGHTTP3_ERR_NOMEM` Out of memory. :macro:`NGHTTP3_ERR_CALLBACK_FAILURE` User callback failed. It may return the other error codes. The negative error code means that *conn* encountered a connection error, and the connection must be closed. Calling nghttp3 API other than `nghttp3_conn_del` causes undefined behavior. This function is available since v1.12.0.