@@ -2625,6 +2625,25 @@ NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_writev_stream(nghttp3_conn *conn,
26252625NGHTTP3_EXTERN int nghttp3_conn_add_write_offset (nghttp3_conn * conn ,
26262626 int64_t stream_id , size_t n );
26272627
2628+ /**
2629+ * @function
2630+ *
2631+ * `nghttp3_conn_is_stream_flushed` returns nonzero if all stream data
2632+ * for a stream identified by |stream_id| so far have been accepted by
2633+ * QUIC stack. This means that the cumulative number of bytes that
2634+ * `nghttp3_conn_add_write_offset` notified covers all stream data
2635+ * currently held. This does not mean more stream data cannot be
2636+ * submitted to this stream via :type:`nghttp3_read_data_callback` and
2637+ * all stream data have been acknowledged.
2638+ *
2639+ * If there is no stream identified by |stream_id|, this function
2640+ * returns nonzero.
2641+ *
2642+ * .. version-added:: 1.17.0
2643+ */
2644+ NGHTTP3_EXTERN int nghttp3_conn_is_stream_flushed (const nghttp3_conn * conn ,
2645+ int64_t stream_id );
2646+
26282647/**
26292648 * @function
26302649 *
@@ -3418,6 +3437,75 @@ NGHTTP3_EXTERN const nghttp3_info *nghttp3_version(int least_version);
34183437 */
34193438NGHTTP3_EXTERN int nghttp3_err_is_fatal (int liberr );
34203439
3440+ /**
3441+ * @function
3442+ *
3443+ * `nghttp3_get_uvarint` reads variable-length unsigned integer from
3444+ * the buffer pointed by |p|, and stores it in the object pointed by
3445+ * |dest| in host byte order. It returns |p| plus the number of bytes
3446+ * read from |p|. This function assumes that |p| points to the buffer
3447+ * that contains a valid variable-length unsigned integer. Use
3448+ * `nghttp3_get_uvarintlen` to get the number of bytes to successfully
3449+ * decode an integer.
3450+ *
3451+ * .. version-added:: 1.17.0
3452+ */
3453+ NGHTTP3_EXTERN const uint8_t * nghttp3_get_uvarint (uint64_t * dest ,
3454+ const uint8_t * p );
3455+
3456+ /**
3457+ * @function
3458+ *
3459+ * `nghttp3_get_uvarintlen` returns the required number of bytes to
3460+ * read variable-length unsigned integer starting at |p|. |p| must
3461+ * not be NULL. This function only reads the single byte from the
3462+ * buffer pointed by |p|, and determines the number of bytes to read.
3463+ *
3464+ * .. version-added:: 1.17.0
3465+ */
3466+ NGHTTP3_EXTERN size_t nghttp3_get_uvarintlen (const uint8_t * p );
3467+
3468+ /**
3469+ * @function
3470+ *
3471+ * `nghttp3_get_varint` reads variable-length unsigned integer from
3472+ * the buffer pointed by |p|, and stores it in the object pointed by
3473+ * |dest| in host byte order. It returns |p| plus the number of bytes
3474+ * read from |p|. This function assumes that |p| points to the buffer
3475+ * that contains a valid variable-length unsigned integer. Use
3476+ * `nghttp3_get_uvarintlen` to get the number of bytes to successfully
3477+ * decode an integer.
3478+ *
3479+ * .. version-added:: 1.17.0
3480+ */
3481+ NGHTTP3_EXTERN const uint8_t * nghttp3_get_varint (int64_t * dest ,
3482+ const uint8_t * p );
3483+
3484+ /**
3485+ * @function
3486+ *
3487+ * `nghttp3_put_uvarint` writes |n| to the buffer pointed by |p| using
3488+ * variable-length unsigned integer encoding. It returns the one
3489+ * beyond of the last written position. This function assumes that
3490+ * the buffer pointed by |p| has sufficient capacity to encode |n|.
3491+ * To know the required capacity, use `nghttp3_put_uvarintlen`. |n|
3492+ * must be less than or equal to (1 << 62) - 1.
3493+ *
3494+ * .. version-added:: 1.17.0
3495+ */
3496+ NGHTTP3_EXTERN uint8_t * nghttp3_put_uvarint (uint8_t * p , uint64_t n );
3497+
3498+ /**
3499+ * @function
3500+ *
3501+ * `nghttp3_put_uvarintlen` returns the required number of bytes to
3502+ * encode |n| in variable-length unsigned integer encoding. |n| must
3503+ * be less than or equal to (1 << 62) - 1.
3504+ *
3505+ * .. version-added:: 1.17.0
3506+ */
3507+ NGHTTP3_EXTERN size_t nghttp3_put_uvarintlen (uint64_t n );
3508+
34213509/*
34223510 * Versioned function wrappers
34233511 */
0 commit comments