From 6c93be516162758a1380f89f0628c743456c0bb7 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Sun, 7 Jun 2026 01:21:41 +0000 Subject: [PATCH] deps: update nghttp3 to 1.16.0 --- .../nghttp3/lib/includes/nghttp3/nghttp3.h | 332 ++- .../nghttp3/lib/includes/nghttp3/version.h | 4 +- deps/ngtcp2/nghttp3/lib/nghttp3_balloc.c | 12 +- deps/ngtcp2/nghttp3/lib/nghttp3_callbacks.c | 2 +- deps/ngtcp2/nghttp3/lib/nghttp3_conn.c | 301 +-- deps/ngtcp2/nghttp3/lib/nghttp3_conn.h | 19 +- deps/ngtcp2/nghttp3/lib/nghttp3_conv.c | 30 +- deps/ngtcp2/nghttp3/lib/nghttp3_conv.h | 101 +- deps/ngtcp2/nghttp3/lib/nghttp3_frame.c | 68 +- deps/ngtcp2/nghttp3/lib/nghttp3_frame.h | 82 +- deps/ngtcp2/nghttp3/lib/nghttp3_gaptr.c | 10 +- deps/ngtcp2/nghttp3/lib/nghttp3_http.c | 152 +- deps/ngtcp2/nghttp3/lib/nghttp3_http.h | 40 +- deps/ngtcp2/nghttp3/lib/nghttp3_ksl.c | 31 +- deps/ngtcp2/nghttp3/lib/nghttp3_ksl.h | 31 +- deps/ngtcp2/nghttp3/lib/nghttp3_macro.h | 90 +- deps/ngtcp2/nghttp3/lib/nghttp3_map.c | 4 +- deps/ngtcp2/nghttp3/lib/nghttp3_objalloc.h | 4 +- deps/ngtcp2/nghttp3/lib/nghttp3_pq.c | 2 +- deps/ngtcp2/nghttp3/lib/nghttp3_qpack.c | 507 +++-- deps/ngtcp2/nghttp3/lib/nghttp3_qpack.h | 77 +- .../nghttp3/lib/nghttp3_qpack_huffman.c | 6 +- .../nghttp3/lib/nghttp3_qpack_huffman.h | 10 +- .../nghttp3/lib/nghttp3_qpack_huffman_data.c | 1972 ++++++++--------- deps/ngtcp2/nghttp3/lib/nghttp3_range.c | 4 +- deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c | 6 +- deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.h | 2 +- deps/ngtcp2/nghttp3/lib/nghttp3_str.c | 56 +- deps/ngtcp2/nghttp3/lib/nghttp3_stream.c | 79 +- deps/ngtcp2/nghttp3/lib/nghttp3_stream.h | 59 +- deps/ngtcp2/nghttp3/lib/nghttp3_tnode.c | 8 +- deps/ngtcp2/nghttp3/lib/nghttp3_tnode.h | 5 +- deps/ngtcp2/nghttp3/lib/nghttp3_vec.c | 6 +- deps/ngtcp2/nghttp3/lib/nghttp3_vec.h | 8 +- 34 files changed, 2214 insertions(+), 1906 deletions(-) diff --git a/deps/ngtcp2/nghttp3/lib/includes/nghttp3/nghttp3.h b/deps/ngtcp2/nghttp3/lib/includes/nghttp3/nghttp3.h index c38f5e8dad4b26..db001e15369119 100644 --- a/deps/ngtcp2/nghttp3/lib/includes/nghttp3/nghttp3.h +++ b/deps/ngtcp2/nghttp3/lib/includes/nghttp3/nghttp3.h @@ -86,8 +86,9 @@ typedef ptrdiff_t nghttp3_ssize; * * :type:`nghttp3_tstamp` is a timestamp with nanosecond resolution. * ``UINT64_MAX`` is an invalid value, and it is often used to - * indicate that no value is set. This type is available since - * v1.12.0. + * indicate that no value is set. + * + * .. version-added:: 1.12.0 */ typedef uint64_t nghttp3_tstamp; @@ -96,8 +97,9 @@ typedef uint64_t nghttp3_tstamp; * * :type:`nghttp3_duration` is a period of time in nanosecond * resolution. ``UINT64_MAX`` is an invalid value, and it is often - * used to indicate that no value is set. This type is available - * since v1.12.0. + * used to indicate that no value is set. + * + * .. version-added:: 1.12.0. */ typedef uint64_t nghttp3_duration; @@ -105,7 +107,9 @@ typedef uint64_t nghttp3_duration; * @macro * * :macro:`NGHTTP3_NANOSECONDS` is a count of tick which corresponds - * to 1 nanosecond. This macro is available since v1.12.0. + * to 1 nanosecond. + * + * .. version-added:: 1.12.0 */ #define NGHTTP3_NANOSECONDS ((nghttp3_duration)1ULL) @@ -113,7 +117,9 @@ typedef uint64_t nghttp3_duration; * @macro * * :macro:`NGHTTP3_MICROSECONDS` is a count of tick which corresponds - * to 1 microsecond. This macro is available since v1.12.0. + * to 1 microsecond. + * + * .. version-added:: 1.12.0 */ #define NGHTTP3_MICROSECONDS ((nghttp3_duration)(1000ULL * NGHTTP3_NANOSECONDS)) @@ -121,7 +127,9 @@ typedef uint64_t nghttp3_duration; * @macro * * :macro:`NGHTTP3_MILLISECONDS` is a count of tick which corresponds - * to 1 millisecond. This macro is available since v1.12.0. + * to 1 millisecond. + * + * .. version-added:: 1.12.0 */ #define NGHTTP3_MILLISECONDS \ ((nghttp3_duration)(1000ULL * NGHTTP3_MICROSECONDS)) @@ -130,7 +138,9 @@ typedef uint64_t nghttp3_duration; * @macro * * :macro:`NGHTTP3_SECONDS` is a count of tick which corresponds to 1 - * second. This macro is available since v1.12.0. + * second. + * + * .. version-added:: 1.12.0 */ #define NGHTTP3_SECONDS ((nghttp3_duration)(1000ULL * NGHTTP3_MILLISECONDS)) @@ -429,42 +439,42 @@ typedef uint64_t nghttp3_duration; * :macro:`NGHTTP3_H3_MISSING_SETTINGS` is HTTP/3 application error * code ``H3_MISSING_SETTINGS``. */ -#define NGHTTP3_H3_MISSING_SETTINGS 0x010a +#define NGHTTP3_H3_MISSING_SETTINGS 0x010A /** * @macro * * :macro:`NGHTTP3_H3_REQUEST_REJECTED` is HTTP/3 application error * code ``H3_REQUEST_REJECTED``. */ -#define NGHTTP3_H3_REQUEST_REJECTED 0x010b +#define NGHTTP3_H3_REQUEST_REJECTED 0x010B /** * @macro * * :macro:`NGHTTP3_H3_REQUEST_CANCELLED` is HTTP/3 application error * code ``H3_REQUEST_CANCELLED``. */ -#define NGHTTP3_H3_REQUEST_CANCELLED 0x010c +#define NGHTTP3_H3_REQUEST_CANCELLED 0x010C /** * @macro * * :macro:`NGHTTP3_H3_REQUEST_INCOMPLETE` is HTTP/3 application error * code ``H3_REQUEST_INCOMPLETE``. */ -#define NGHTTP3_H3_REQUEST_INCOMPLETE 0x010d +#define NGHTTP3_H3_REQUEST_INCOMPLETE 0x010D /** * @macro * * :macro:`NGHTTP3_H3_MESSAGE_ERROR` is HTTP/3 application error code * ``H3_MESSAGE_ERROR``. */ -#define NGHTTP3_H3_MESSAGE_ERROR 0x010e +#define NGHTTP3_H3_MESSAGE_ERROR 0x010E /** * @macro * * :macro:`NGHTTP3_H3_CONNECT_ERROR` is HTTP/3 application error code * ``H3_CONNECT_ERROR``. */ -#define NGHTTP3_H3_CONNECT_ERROR 0x010f +#define NGHTTP3_H3_CONNECT_ERROR 0x010F /** * @macro * @@ -753,7 +763,7 @@ NGHTTP3_EXTERN void nghttp3_buf_reset(nghttp3_buf *buf); * * :macro:`NGHTTP3_NV_FLAG_NONE` indicates no flag set. */ -#define NGHTTP3_NV_FLAG_NONE 0x00u +#define NGHTTP3_NV_FLAG_NONE 0x00U /** * @macro @@ -762,7 +772,7 @@ NGHTTP3_EXTERN void nghttp3_buf_reset(nghttp3_buf *buf); * pair must not be indexed. Other implementation calls this bit as * "sensitive". */ -#define NGHTTP3_NV_FLAG_NEVER_INDEX 0x01u +#define NGHTTP3_NV_FLAG_NEVER_INDEX 0x01U /** * @macro @@ -771,7 +781,7 @@ NGHTTP3_EXTERN void nghttp3_buf_reset(nghttp3_buf *buf); * If this flag is set, the library does not make a copy of field * name. This could improve performance. */ -#define NGHTTP3_NV_FLAG_NO_COPY_NAME 0x02u +#define NGHTTP3_NV_FLAG_NO_COPY_NAME 0x02U /** * @macro @@ -780,7 +790,7 @@ NGHTTP3_EXTERN void nghttp3_buf_reset(nghttp3_buf *buf); * application. If this flag is set, the library does not make a copy * of field value. This could improve performance. */ -#define NGHTTP3_NV_FLAG_NO_COPY_VALUE 0x04u +#define NGHTTP3_NV_FLAG_NO_COPY_VALUE 0x04U /** * @macro @@ -790,7 +800,7 @@ NGHTTP3_EXTERN void nghttp3_buf_reset(nghttp3_buf *buf); * a hint, and QPACK encoder might not encode the field in various * reasons. */ -#define NGHTTP3_NV_FLAG_TRY_INDEX 0x08u +#define NGHTTP3_NV_FLAG_TRY_INDEX 0x08U /** * @struct @@ -1156,8 +1166,9 @@ typedef struct nghttp3_qpack_nv { * * :type:`nghttp3_qpack_indexing_strat` defines the QPACK dynamic * table indexing strategies for fields not defined in - * :type:`nghttp3_qpack_token`. This type is available since v1.13.0. - + * :type:`nghttp3_qpack_token`. + * + * .. version-added:: 1.13.0 */ typedef enum nghttp3_qpack_indexing_strat { /** @@ -1165,14 +1176,16 @@ typedef enum nghttp3_qpack_indexing_strat { * fields not defined in :type:`nghttp3_qpack_token`. This is the * default strategy. You can still use * :macro:`NGHTTP3_NV_FLAG_TRY_INDEX` to index a particular field. - * This enum is available since v1.13.0. + * + * .. version-added:: 1.13.0 */ NGHTTP3_QPACK_INDEXING_STRAT_NONE, /** * :enum:`NGHTTP3_QPACK_INDEXING_STRAT_EAGER` indexes all fields not * defined in :type:`nghttp3_qpack_token`. Please note that QPACK - * encoder might not index the field in various reasons. This enum - * is available since v1.13.0. + * encoder might not index the field in various reasons. + * + * .. version-added:: 1.13.0 */ NGHTTP3_QPACK_INDEXING_STRAT_EAGER } nghttp3_qpack_indexing_strat; @@ -1233,7 +1246,7 @@ NGHTTP3_EXTERN int nghttp3_qpack_encoder_new(nghttp3_qpack_encoder **pencoder, * :macro:`NGHTTP3_ERR_NOMEM` * Out of memory. * - * This function is available since v1.11.0. + * .. version-added:: 1.11.0 */ NGHTTP3_EXTERN int nghttp3_qpack_encoder_new2(nghttp3_qpack_encoder **pencoder, size_t hard_max_dtable_capacity, @@ -1329,9 +1342,9 @@ nghttp3_qpack_encoder_set_max_blocked_streams(nghttp3_qpack_encoder *encoder, * @function * * `nghttp3_qpack_encoder_set_indexing_strat` sets the dynamic table - * indexing strategy |strat| to |encoder|. This function is available - * since v1.13.0. - + * indexing strategy |strat| to |encoder|. + * + * .. version-added:: 1.13.0 */ NGHTTP3_EXTERN void nghttp3_qpack_encoder_set_indexing_strat(nghttp3_qpack_encoder *encoder, @@ -1352,12 +1365,28 @@ nghttp3_qpack_encoder_ack_everything(nghttp3_qpack_encoder *encoder); /** * @function * + * .. warning:: + * + * .. version-deprecated:: 1.16.0 + * Use `nghttp3_qpack_encoder_get_num_blocked_streams2` instead. + * * `nghttp3_qpack_encoder_get_num_blocked_streams` returns the number * of streams which are potentially blocked at decoder side. */ NGHTTP3_EXTERN size_t nghttp3_qpack_encoder_get_num_blocked_streams(nghttp3_qpack_encoder *encoder); +/** + * @function + * + * `nghttp3_qpack_encoder_get_num_blocked_streams2` returns the number + * of streams which are potentially blocked at decoder side. + * + * .. version-added:: 1.16.0 + */ +NGHTTP3_EXTERN size_t nghttp3_qpack_encoder_get_num_blocked_streams2( + const nghttp3_qpack_encoder *encoder); + /** * @struct * @@ -1401,12 +1430,26 @@ nghttp3_qpack_stream_context_del(nghttp3_qpack_stream_context *sctx); /** * @function * + * .. warning:: + * + * .. version-deprecated:: 1.16.0 + * Use `nghttp3_qpack_stream_context_get_ricnt2` instead. + * * `nghttp3_qpack_stream_context_get_ricnt` returns required insert * count. */ NGHTTP3_EXTERN uint64_t nghttp3_qpack_stream_context_get_ricnt(nghttp3_qpack_stream_context *sctx); +/** + * @function + * + * `nghttp3_qpack_stream_context_get_ricnt2` returns required insert + * count. + */ +NGHTTP3_EXTERN uint64_t nghttp3_qpack_stream_context_get_ricnt2( + const nghttp3_qpack_stream_context *sctx); + /** * @function * @@ -1495,7 +1538,7 @@ nghttp3_qpack_decoder_get_icnt(const nghttp3_qpack_decoder *decoder); * * :macro:`NGHTTP3_QPACK_DECODE_FLAG_NONE` indicates that no flag set. */ -#define NGHTTP3_QPACK_DECODE_FLAG_NONE 0x00u +#define NGHTTP3_QPACK_DECODE_FLAG_NONE 0x00U /** * @macro @@ -1503,7 +1546,7 @@ nghttp3_qpack_decoder_get_icnt(const nghttp3_qpack_decoder *decoder); * :macro:`NGHTTP3_QPACK_DECODE_FLAG_EMIT` indicates that an HTTP * field is successfully decoded. */ -#define NGHTTP3_QPACK_DECODE_FLAG_EMIT 0x01u +#define NGHTTP3_QPACK_DECODE_FLAG_EMIT 0x01U /** * @macro @@ -1511,7 +1554,7 @@ nghttp3_qpack_decoder_get_icnt(const nghttp3_qpack_decoder *decoder); * :macro:`NGHTTP3_QPACK_DECODE_FLAG_FINAL` indicates that an entire * HTTP field section has been decoded. */ -#define NGHTTP3_QPACK_DECODE_FLAG_FINAL 0x02u +#define NGHTTP3_QPACK_DECODE_FLAG_FINAL 0x02U /** * @macro @@ -1519,7 +1562,7 @@ nghttp3_qpack_decoder_get_icnt(const nghttp3_qpack_decoder *decoder); * :macro:`NGHTTP3_QPACK_DECODE_FLAG_BLOCKED` indicates that decoding * has been blocked. */ -#define NGHTTP3_QPACK_DECODE_FLAG_BLOCKED 0x04u +#define NGHTTP3_QPACK_DECODE_FLAG_BLOCKED 0x04U /** * @function @@ -1579,8 +1622,8 @@ NGHTTP3_EXTERN nghttp3_ssize nghttp3_qpack_decoder_read_request( * * The caller must ensure that `nghttp3_buf_left(dbuf) * ` >= - * `nghttp3_qpack_decoder_get_decoder_streamlen(decoder) - * `. + * `nghttp3_qpack_decoder_get_decoder_streamlen2(decoder) + * `. */ NGHTTP3_EXTERN void nghttp3_qpack_decoder_write_decoder(nghttp3_qpack_decoder *decoder, @@ -1589,12 +1632,28 @@ nghttp3_qpack_decoder_write_decoder(nghttp3_qpack_decoder *decoder, /** * @function * + * .. warning:: + * + * .. version-deprecated:: 1.16.0 + * Use `nghttp3_qpack_decoder_get_decoder_streamlen2` instead. + * * `nghttp3_qpack_decoder_get_decoder_streamlen` returns the length of * decoder stream that is currently pending. */ NGHTTP3_EXTERN size_t nghttp3_qpack_decoder_get_decoder_streamlen(nghttp3_qpack_decoder *decoder); +/** + * @function + * + * `nghttp3_qpack_decoder_get_decoder_streamlen2` returns the length + * of decoder stream that is currently pending. + * + * .. version-added:: 1.16.0 + */ +NGHTTP3_EXTERN size_t nghttp3_qpack_decoder_get_decoder_streamlen2( + const nghttp3_qpack_decoder *decoder); + /** * @function * @@ -1714,7 +1773,7 @@ NGHTTP3_EXTERN void nghttp3_set_debug_vprintf_callback( * by a server when it initiates graceful shutdown of the connection * via `nghttp3_conn_submit_shutdown_notice`. */ -#define NGHTTP3_SHUTDOWN_NOTICE_STREAM_ID ((1ull << 62) - 4) +#define NGHTTP3_SHUTDOWN_NOTICE_STREAM_ID ((1ULL << 62) - 4) /** * @macro @@ -1724,7 +1783,7 @@ NGHTTP3_EXTERN void nghttp3_set_debug_vprintf_callback( * `nghttp3_conn_submit_shutdown_notice`. Note that libnghttp3 does * not implement HTTP/3 Server Push. */ -#define NGHTTP3_SHUTDOWN_NOTICE_PUSH_ID ((1ull << 62) - 1) +#define NGHTTP3_SHUTDOWN_NOTICE_PUSH_ID ((1ULL << 62) - 1) /** * @struct @@ -1790,7 +1849,8 @@ typedef struct nghttp3_settings { * Datagrams (see :rfc:`9297`). */ uint8_t h3_datagram; - /* The following fields have been added since NGHTTP3_SETTINGS_V2. */ + /* The following fields have been added since + NGHTTP3_SETTINGS_V2. */ /** * :member:`origin_list`, if set, must contain a serialized HTTP/3 * ORIGIN frame (see :rfc:`9412`) payload. The ORIGIN frame payload @@ -1802,10 +1862,13 @@ typedef struct nghttp3_settings { * until the :type:`nghttp3_conn` to which this field was passed is * freed by `nghttp3_conn_del`. The object pointed to by this field * is copied internally, and does not need to be kept alive. Only - * server uses this field. This field is available since v1.11.0. + * server uses this field. + * + * .. version-added:: 1.11.0 */ const nghttp3_vec *origin_list; - /* The following fields have been added since NGHTTP3_SETTINGS_V3. */ + /* The following fields have been added since + NGHTTP3_SETTINGS_V3. */ /** * :member:`glitch_ratelim_burst` is the maximum number of tokens * available to "glitch" rate limiter. "glitch" is a suspicious @@ -1813,21 +1876,27 @@ typedef struct nghttp3_settings { * tokens are consumed. If no tokens are available to consume, the * connection is closed. The rate of token generation is specified * by :member:`glitch_ratelim_rate`. This feature is enabled only - * when `nghttp3_conn_read_stream2` is used. This field has been - * available since v1.12.0. + * when `nghttp3_conn_read_stream2` is used. + * + * .. version-added:: 1.12.0 */ uint64_t glitch_ratelim_burst; /** * :member:`glitch_ratelim_rate` is the number of tokens generated * per second. See :member:`glitch_ratelim_burst` for "glitch" rate - * limiter. This field has been available since v1.12.0. + * limiter. + * + * .. version-added:: 1.12.0 */ uint64_t glitch_ratelim_rate; + /* The following fields have been added since + NGHTTP3_SETTINGS_V4. */ /** * :member:`qpack_indexing_strat` defines the QPACK dynamic table * indexing strategy for those fields that are not defined in - * :type:`nghttp3_qpack_token`. This field has been available since - * v1.13.0. + * :type:`nghttp3_qpack_token`. + * + * .. version-added:: 1.13.0 */ nghttp3_qpack_indexing_strat qpack_indexing_strat; } nghttp3_settings; @@ -1839,7 +1908,9 @@ typedef struct nghttp3_settings { * @struct * * :type:`nghttp3_proto_settings` contains HTTP/3 settings that this - * library can recognize. This field is available since v1.14.0. + * library can recognize. + * + * .. version-added:: 1.14.0 */ typedef struct nghttp3_proto_settings { /** @@ -2096,8 +2167,9 @@ typedef int (*nghttp3_shutdown)(nghttp3_conn *conn, int64_t id, * * .. warning:: * - * Deprecated since v1.14.0. Use :type:`nghttp3_recv_settings2` - * instead. New settings will not be notified with this callback. + * .. version-deprecated:: 1.14.0 + * Use :type:`nghttp3_recv_settings2` instead. New settings will + * not be notified with this callback. * * :type:`nghttp3_recv_settings` is a callback function which is * invoked when SETTINGS frame is received. |settings| is a received @@ -2160,8 +2232,9 @@ typedef void (*nghttp3_rand)(uint8_t *dest, size_t destlen); * The implementation of this callback must return 0 if it succeeds. * Returning :macro:`NGHTTP3_ERR_CALLBACK_FAILURE` will return to the * caller immediately. Any values other than 0 is treated as - * :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`. This callback is available - * since v1.14.0. + * :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`. + * + * .. version-added:: 1.14.0 */ typedef int (*nghttp3_recv_settings2)(nghttp3_conn *conn, const nghttp3_proto_settings *settings, @@ -2262,24 +2335,27 @@ typedef struct nghttp3_callbacks { /** * .. warning:: * - * Deprecated since v1.14.0. Use :member:`recv_settings2` - * instead. + * .. version-deprecated:: 1.14.0 + * Use :member:`recv_settings2` instead. * * :member:`recv_settings` is a callback function which is invoked * when SETTINGS frame is received. */ nghttp3_recv_settings recv_settings; - /* The following fields have been added since NGHTTP3_CALLBACKS_V2. */ + /* The following fields have been added since + NGHTTP3_CALLBACKS_V2. */ /** * :member:`recv_origin` is a callback function which is invoked - * when a single origin in an ORIGIN frame is received. This field - * is available since v1.11.0. + * when a single origin in an ORIGIN frame is received. + * + * .. version-added:: 1.11.0 */ nghttp3_recv_origin recv_origin; /** * :member:`end_origin` is a callback function which is invoked when - * an ORIGIN frame has been completely processed. This field is - * available since v1.11.0. + * an ORIGIN frame has been completely processed. + * + * .. version-added:: 1.11.0 */ nghttp3_end_origin end_origin; /** @@ -2287,14 +2363,16 @@ typedef struct nghttp3_callbacks { * unpredictable data are needed. Although this field is optional * due to the backward compatibility, it is recommended to specify * this field to harden the runtime behavior against suspicious - * activities of a remote endpoint. This field is available since - * v1.11.0. + * activities of a remote endpoint. + * + * .. version-added:: 1.11.0 */ nghttp3_rand rand; /** * :member:`recv_settings2` is a callback function which is invoked - * when SETTINGS frame is received. This field is available since - * v1.14.0. + * when SETTINGS frame is received. + * + * .. version-added:: 1.14.0 */ nghttp3_recv_settings2 recv_settings2; } nghttp3_callbacks; @@ -2306,7 +2384,7 @@ typedef struct nghttp3_callbacks { * values. * * - :member:`max_field_section_size - * ` = :expr:`((1ull << 62) - 1)` + * ` = :expr:`((1ULL << 62) - 1)` * - :member:`qpack_max_dtable_capacity * ` = 0 * - :member:`qpack_encoder_max_dtable_capacity @@ -2417,8 +2495,8 @@ NGHTTP3_EXTERN int nghttp3_conn_bind_qpack_streams(nghttp3_conn *conn, * * .. warning:: * - * Deprecated since v1.12.0. Use `nghttp3_conn_read_stream2` - * instead. + * .. version-deprecated:: 1.12.0 + * Use `nghttp3_conn_read_stream2` instead. * * `nghttp3_conn_read_stream` reads data |src| of length |srclen| on * stream identified by |stream_id|. It returns the number of bytes @@ -2476,7 +2554,7 @@ NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_read_stream(nghttp3_conn *conn, * be closed. Calling nghttp3 API other than `nghttp3_conn_del` * causes undefined behavior. * - * This function is available since v1.12.0. + * .. version-added:: 1.12.0 */ NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_read_stream2(nghttp3_conn *conn, int64_t stream_id, @@ -2624,6 +2702,11 @@ NGHTTP3_EXTERN int nghttp3_conn_unblock_stream(nghttp3_conn *conn, /** * @function * + * .. warning:: + * + * .. version-deprecated:: 1.16.0 + * Use `nghttp3_conn_is_stream_writable2` instead. + * * `nghttp3_conn_is_stream_writable` returns nonzero if a stream * identified by |stream_id| is writable. It is not writable if: * @@ -2641,6 +2724,28 @@ NGHTTP3_EXTERN int nghttp3_conn_unblock_stream(nghttp3_conn *conn, NGHTTP3_EXTERN int nghttp3_conn_is_stream_writable(nghttp3_conn *conn, int64_t stream_id); +/** + * @function + * + * `nghttp3_conn_is_stream_writable2` returns nonzero if a stream + * identified by |stream_id| is writable. It is not writable if: + * + * - the stream does not exist; or, + * - the stream is closed (e.g., `nghttp3_conn_close_stream` is + * called); or, + * - the stream is QUIC flow control blocked (e.g., + * `nghttp3_conn_block_stream` is called); or, + * - the stream is input data blocked (e.g., + * :macro:`NGHTTP3_ERR_WOULDBLOCK` is returned from + * :type:`nghttp3_read_data_callback`); or, + * - the stream is half-closed local (e.g., + * `nghttp3_conn_shutdown_stream_write` is called). + * + * .. version-added:: 1.16.0 + */ +NGHTTP3_EXTERN int nghttp3_conn_is_stream_writable2(const nghttp3_conn *conn, + int64_t stream_id); + /** * @function * @@ -2729,7 +2834,7 @@ NGHTTP3_EXTERN int nghttp3_conn_close_stream(nghttp3_conn *conn, * * :macro:`NGHTTP3_DATA_FLAG_NONE` indicates no flag set. */ -#define NGHTTP3_DATA_FLAG_NONE 0x00u +#define NGHTTP3_DATA_FLAG_NONE 0x00U /** * @macro @@ -2739,7 +2844,7 @@ NGHTTP3_EXTERN int nghttp3_conn_close_stream(nghttp3_conn *conn, * that sending side of stream is closed unless * :macro:`NGHTTP3_DATA_FLAG_NO_END_STREAM` is given at the same time. */ -#define NGHTTP3_DATA_FLAG_EOF 0x01u +#define NGHTTP3_DATA_FLAG_EOF 0x01U /** * @macro @@ -2751,7 +2856,7 @@ NGHTTP3_EXTERN int nghttp3_conn_close_stream(nghttp3_conn *conn, * has been called, regardless of this flag, the submitted trailer * fields are sent. */ -#define NGHTTP3_DATA_FLAG_NO_END_STREAM 0x02u +#define NGHTTP3_DATA_FLAG_NO_END_STREAM 0x02U /** * @function @@ -2964,6 +3069,29 @@ NGHTTP3_EXTERN int nghttp3_conn_set_stream_user_data(nghttp3_conn *conn, /** * @function * + * `nghttp3_conn_get_stream_user_data` returns the user data + * associated to the stream identified by |stream_id|. If no data is + * associated or the stream is not found, this function returns NULL. + * + * The user data can be associated to the stream by the following + * functions: + * + * - `nghttp3_conn_set_stream_user_data` + * - `nghttp3_conn_submit_request` + * + * .. version-added:: 1.16.0 + */ +NGHTTP3_EXTERN void *nghttp3_conn_get_stream_user_data(const nghttp3_conn *conn, + int64_t stream_id); + +/** + * @function + * + * .. warning:: + * + * .. version-deprecated:: 1.16.0 + * Use `nghttp3_conn_get_frame_payload_left2` instead. + * * `nghttp3_conn_get_frame_payload_left` returns the number of bytes * left to read current frame payload for a stream denoted by * |stream_id|. If no such stream is found, or |stream_id| identifies @@ -2973,6 +3101,20 @@ NGHTTP3_EXTERN int nghttp3_conn_set_stream_user_data(nghttp3_conn *conn, NGHTTP3_EXTERN uint64_t nghttp3_conn_get_frame_payload_left(nghttp3_conn *conn, int64_t stream_id); +/** + * @function + * + * `nghttp3_conn_get_frame_payload_left2` returns the number of bytes + * left to read current frame payload for a stream denoted by + * |stream_id|. If no such stream is found, or |stream_id| identifies + * neither client bidirectional stream nor remote control stream, it + * returns 0. + * + * .. version-added:: 1.16.0 + */ +NGHTTP3_EXTERN uint64_t nghttp3_conn_get_frame_payload_left2( + const nghttp3_conn *conn, int64_t stream_id); + /** * @macrosection * @@ -3034,6 +3176,11 @@ typedef struct NGHTTP3_ALIGN(8) nghttp3_pri { /** * @function * + * .. warning:: + * + * .. version-deprecated:: 1.16.0 + * Use `nghttp3_conn_get_stream_priority2` instead. + * * `nghttp3_conn_get_stream_priority` stores stream priority of a * stream denoted by |stream_id| into |*dest|. |stream_id| must * identify client initiated bidirectional stream. Only server can @@ -3053,6 +3200,32 @@ typedef struct NGHTTP3_ALIGN(8) nghttp3_pri { NGHTTP3_EXTERN int nghttp3_conn_get_stream_priority_versioned( nghttp3_conn *conn, int pri_version, nghttp3_pri *dest, int64_t stream_id); +/** + * @function + * + * `nghttp3_conn_get_stream_priority2` stores stream priority of a + * stream denoted by |stream_id| into |*dest|. |stream_id| must + * identify client initiated bidirectional stream. Only server can + * use this function. + * + * This function must not be called if |conn| is initialized as + * client. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :macro:`NGHTTP3_ERR_INVALID_ARGUMENT` + * |stream_id| is not a client initiated bidirectional stream ID. + * :macro:`NGHTTP3_ERR_STREAM_NOT_FOUND` + * Stream not found. + * + * .. version-added:: 1.16.0 + */ +NGHTTP3_EXTERN int +nghttp3_conn_get_stream_priority2_versioned(const nghttp3_conn *conn, + int pri_version, nghttp3_pri *dest, + int64_t stream_id); + /** * @function * @@ -3139,12 +3312,28 @@ NGHTTP3_EXTERN int nghttp3_check_header_value(const uint8_t *value, size_t len); /** * @function * + * .. warning:: + * + * .. version-deprecated:: 1.16.0 + * Use `nghttp3_conn_is_drained2` instead. + * * `nghttp3_conn_is_drained` returns nonzero if * `nghttp3_conn_shutdown` has been called, and there is no active * remote streams. This function is for server use only. */ NGHTTP3_EXTERN int nghttp3_conn_is_drained(nghttp3_conn *conn); +/** + * @function + * + * `nghttp3_conn_is_drained2` returns nonzero if + * `nghttp3_conn_shutdown` has been called, and there is no active + * remote streams. This function is for server use only. + * + * .. version-added:: 1.16.0 + */ +NGHTTP3_EXTERN int nghttp3_conn_is_drained2(const nghttp3_conn *conn); + /** * @function * @@ -3279,6 +3468,15 @@ NGHTTP3_EXTERN int nghttp3_err_is_fatal(int liberr); nghttp3_conn_get_stream_priority_versioned((CONN), NGHTTP3_PRI_VERSION, \ (DEST), (STREAM_ID)) +/* + * `nghttp3_conn_get_stream_priority2` is a wrapper around + * `nghttp3_conn_get_stream_priority2_versioned` to set the correct + * struct version. + */ +#define nghttp3_conn_get_stream_priority2(CONN, DEST, STREAM_ID) \ + nghttp3_conn_get_stream_priority2_versioned((CONN), NGHTTP3_PRI_VERSION, \ + (DEST), (STREAM_ID)) + /* * `nghttp3_pri_parse_priority` is a wrapper around * `nghttp3_pri_parse_priority_versioned` to set the correct struct diff --git a/deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h b/deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h index 3d38568d9f6519..a0b397f05a8275 100644 --- a/deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h +++ b/deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h @@ -31,7 +31,7 @@ * * Version number of the nghttp3 library release. */ -#define NGHTTP3_VERSION "1.15.0" +#define NGHTTP3_VERSION "1.16.0" /** * @macro @@ -41,6 +41,6 @@ * number, 8 bits for minor and 8 bits for patch. Version 1.2.3 * becomes 0x010203. */ -#define NGHTTP3_VERSION_NUM 0x010f00 +#define NGHTTP3_VERSION_NUM 0x011000 #endif /* !defined(NGHTTP3_VERSION_H) */ diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_balloc.c b/deps/ngtcp2/nghttp3/lib/nghttp3_balloc.c index 25c0fef2f7b187..436310633349a6 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_balloc.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_balloc.c @@ -31,7 +31,7 @@ void nghttp3_balloc_init(nghttp3_balloc *balloc, size_t blklen, const nghttp3_mem *mem) { - assert((blklen & 0xfu) == 0); + assert((blklen & 0xFU) == 0); balloc->mem = mem; balloc->blklen = blklen; @@ -67,7 +67,7 @@ int nghttp3_balloc_get(nghttp3_balloc *balloc, void **pbuf, size_t n) { if (nghttp3_buf_left(&balloc->buf) < n) { p = nghttp3_mem_malloc(balloc->mem, - sizeof(nghttp3_memblock_hd) + 0x8u + balloc->blklen); + sizeof(nghttp3_memblock_hd) + 0x8U + balloc->blklen); if (p == NULL) { return NGHTTP3_ERR_NOMEM; } @@ -77,15 +77,15 @@ int nghttp3_balloc_get(nghttp3_balloc *balloc, void **pbuf, size_t n) { balloc->head = hd; nghttp3_buf_wrap_init( &balloc->buf, - (uint8_t *)(((uintptr_t)p + sizeof(nghttp3_memblock_hd) + 0xfu) & - ~(uintptr_t)0xfu), + (uint8_t *)(((uintptr_t)p + sizeof(nghttp3_memblock_hd) + 0xFU) & + ~(uintptr_t)0xFU), balloc->blklen); } - assert(((uintptr_t)balloc->buf.last & 0xfu) == 0); + assert(((uintptr_t)balloc->buf.last & 0xFU) == 0); *pbuf = balloc->buf.last; - balloc->buf.last += (n + 0xfu) & ~(uintptr_t)0xfu; + balloc->buf.last += (n + 0xFU) & ~(size_t)0xFU; return 0; } diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_callbacks.c b/deps/ngtcp2/nghttp3/lib/nghttp3_callbacks.c index 4e5111c4ca943a..283f479b0d3473 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_callbacks.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_callbacks.c @@ -45,7 +45,7 @@ nghttp3_callbacks_convert_to_latest(nghttp3_callbacks *dest, return src; } - memset(dest, 0, sizeof(*dest)); + *dest = (nghttp3_callbacks){0}; callbacks_copy(dest, src, callbacks_version); diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_conn.c b/deps/ngtcp2/nghttp3/lib/nghttp3_conn.c index a305be2e96414d..05f6973bcafb26 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_conn.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_conn.c @@ -43,7 +43,7 @@ nghttp3_objalloc_def(chunk, nghttp3_chunk, oplent) * conn_remote_stream_uni returns nonzero if |stream_id| is remote * unidirectional stream ID. */ -static int conn_remote_stream_uni(nghttp3_conn *conn, int64_t stream_id) { +static int conn_remote_stream_uni(const nghttp3_conn *conn, int64_t stream_id) { if (conn->server) { return (stream_id & 0x03) == 0x02; } @@ -495,7 +495,7 @@ nghttp3_ssize nghttp3_conn_read_stream2(nghttp3_conn *conn, int64_t stream_id, } conn->rx.max_stream_id_bidi = - nghttp3_max_int64(conn->rx.max_stream_id_bidi, stream_id); + nghttp3_max(conn->rx.max_stream_id_bidi, stream_id); rv = nghttp3_conn_create_stream(conn, &stream, stream_id); if (rv != 0) { return rv; @@ -572,7 +572,7 @@ static nghttp3_ssize conn_read_type(nghttp3_conn *conn, nghttp3_stream *stream, nghttp3_stream_read_state *rstate = &stream->rstate; nghttp3_varint_read_state *rvint = &rstate->rvint; nghttp3_ssize nread; - int64_t stream_type; + uint64_t stream_type; assert(srclen); @@ -649,10 +649,7 @@ nghttp3_ssize nghttp3_conn_read_uni(nghttp3_conn *conn, nghttp3_stream *stream, return NGHTTP3_ERR_H3_EXCESSIVE_LOAD; } - rv = conn_delete_stream(conn, stream); - assert(0 == rv); - - return 0; + return conn_delete_stream(conn, stream); } nread = conn_read_type(conn, stream, src, srclen, fin); if (nread < 0) { @@ -724,8 +721,8 @@ static void conn_reset_rx_originlen(nghttp3_conn *conn) { conn->rx.originlen = 0; } -static int frame_fin(nghttp3_stream_read_state *rstate, size_t len) { - return (int64_t)len >= rstate->left; +static int frame_fin(const nghttp3_stream_read_state *rstate, size_t len) { + return len >= rstate->left; } nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, @@ -909,7 +906,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, } /* Read Identifier */ - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); nread = nghttp3_read_varint(rvint, p, p + len, frame_fin(rstate, len)); if (nread < 0) { @@ -918,12 +915,12 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (rvint->left) { rstate->state = NGHTTP3_CTRL_STREAM_STATE_SETTINGS_ID; return (nghttp3_ssize)nconsumed; } - rstate->fr.settings.iv[0].id = (uint64_t)rvint->acc; + rstate->fr.settings.iv[0].id = rvint->acc; nghttp3_varint_read_state_reset(rvint); /* Read Value */ @@ -944,12 +941,12 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (rvint->left) { rstate->state = NGHTTP3_CTRL_STREAM_STATE_SETTINGS_VALUE; return (nghttp3_ssize)nconsumed; } - rstate->fr.settings.iv[0].value = (uint64_t)rvint->acc; + rstate->fr.settings.iv[0].value = rvint->acc; nghttp3_varint_read_state_reset(rvint); rv = @@ -960,7 +957,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, } break; case NGHTTP3_CTRL_STREAM_STATE_SETTINGS_ID: - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); nread = nghttp3_read_varint(rvint, p, p + len, frame_fin(rstate, len)); if (nread < 0) { @@ -969,11 +966,11 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (rvint->left) { return (nghttp3_ssize)nconsumed; } - rstate->fr.settings.iv[0].id = (uint64_t)rvint->acc; + rstate->fr.settings.iv[0].id = rvint->acc; nghttp3_varint_read_state_reset(rvint); if (rstate->left == 0) { @@ -987,7 +984,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, } /* Fall through */ case NGHTTP3_CTRL_STREAM_STATE_SETTINGS_VALUE: - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); nread = nghttp3_read_varint(rvint, p, p + len, frame_fin(rstate, len)); if (nread < 0) { @@ -996,11 +993,11 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (rvint->left) { return (nghttp3_ssize)nconsumed; } - rstate->fr.settings.iv[0].value = (uint64_t)rvint->acc; + rstate->fr.settings.iv[0].value = rvint->acc; nghttp3_varint_read_state_reset(rvint); rv = nghttp3_conn_on_settings_entry_received(conn, &rstate->fr.settings); @@ -1021,7 +1018,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, nghttp3_stream_read_state_reset(rstate); break; case NGHTTP3_CTRL_STREAM_STATE_GOAWAY: - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); nread = nghttp3_read_varint(rvint, p, p + len, frame_fin(rstate, len)); if (nread < 0) { @@ -1030,26 +1027,26 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (rvint->left) { return (nghttp3_ssize)nconsumed; } - if (!conn->server && !nghttp3_client_stream_bidi(rvint->acc)) { + if (!conn->server && !nghttp3_client_stream_bidi((int64_t)rvint->acc)) { return NGHTTP3_ERR_H3_ID_ERROR; } - if (conn->rx.goaway_id < rvint->acc) { + if (conn->rx.goaway_id < (int64_t)rvint->acc) { return NGHTTP3_ERR_H3_ID_ERROR; } /* Receiving same GOAWAY ID is suspicious. */ - if (conn->rx.goaway_id == rvint->acc && + if (conn->rx.goaway_id == (int64_t)rvint->acc && conn_glitch_ratelim_drain(conn, 1, ts) != 0) { return NGHTTP3_ERR_H3_EXCESSIVE_LOAD; } conn->flags |= NGHTTP3_CONN_FLAG_GOAWAY_RECVED; - conn->rx.goaway_id = rvint->acc; + conn->rx.goaway_id = (int64_t)rvint->acc; nghttp3_varint_read_state_reset(rvint); if (conn->callbacks.shutdown) { @@ -1064,7 +1061,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, break; case NGHTTP3_CTRL_STREAM_STATE_MAX_PUSH_ID: /* server side only */ - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); nread = nghttp3_read_varint(rvint, p, p + len, frame_fin(rstate, len)); if (nread < 0) { @@ -1073,29 +1070,29 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (rvint->left) { return (nghttp3_ssize)nconsumed; } - if (conn->local.uni.max_pushes > (uint64_t)rvint->acc + 1) { + if (conn->local.uni.max_pushes > rvint->acc + 1) { return NGHTTP3_ERR_H3_FRAME_ERROR; } /* Receiving same MAX_PUSH_ID is suspicious. */ - if (conn->local.uni.max_pushes == (uint64_t)rvint->acc + 1 && + if (conn->local.uni.max_pushes == rvint->acc + 1 && conn_glitch_ratelim_drain(conn, 1, ts) != 0) { return NGHTTP3_ERR_H3_EXCESSIVE_LOAD; } - conn->local.uni.max_pushes = (uint64_t)rvint->acc + 1; + conn->local.uni.max_pushes = rvint->acc + 1; nghttp3_varint_read_state_reset(rvint); nghttp3_stream_read_state_reset(rstate); break; case NGHTTP3_CTRL_STREAM_STATE_PRIORITY_UPDATE_PRI_ELEM_ID: /* server side only */ - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); nread = nghttp3_read_varint(rvint, p, p + len, frame_fin(rstate, len)); if (nread < 0) { @@ -1104,12 +1101,12 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (rvint->left) { return (nghttp3_ssize)nconsumed; } - rstate->fr.priority_update.pri_elem_id = rvint->acc; + rstate->fr.priority_update.pri_elem_id = (int64_t)rvint->acc; nghttp3_varint_read_state_reset(rvint); if (rstate->left == 0) { @@ -1138,9 +1135,9 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, case NGHTTP3_CTRL_STREAM_STATE_PRIORITY_UPDATE: /* We need to buffer Priority Field Value because it might be fragmented. */ - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); - if (conn->rx.pri_fieldbuflen == 0 && rstate->left == (int64_t)len) { + if (conn->rx.pri_fieldbuflen == 0 && rstate->left == len) { /* Everything is in the input buffer. Apply same length limit we impose when buffering the field. */ if (len > sizeof(conn->rx.pri_fieldbuf)) { @@ -1160,7 +1157,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, memcpy(conn->rx.pri_fieldbuf + conn->rx.pri_fieldbuflen, p, len); conn->rx.pri_fieldbuflen += len; - if (rstate->left == (int64_t)len) { + if (rstate->left == len) { pri_field_value = conn->rx.pri_fieldbuf; pri_field_valuelen = conn->rx.pri_fieldbuflen; } @@ -1168,7 +1165,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, p += len; nconsumed += len; - rstate->left -= (int64_t)len; + rstate->left -= len; if (rstate->left) { return (nghttp3_ssize)nconsumed; @@ -1193,7 +1190,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, break; case NGHTTP3_CTRL_STREAM_STATE_ORIGIN_ORIGIN_LEN: /* client side only */ - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); assert(len > 0); @@ -1208,7 +1205,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, } nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; len -= (size_t)nread; if (conn->rx.originlen_offset < sizeof(conn->rx.originlen)) { @@ -1240,7 +1237,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, /* No need to update p because we will return very soon. */ nconsumed += len; - rstate->left -= (int64_t)len; + rstate->left -= len; conn->rx.originbuflen = len; @@ -1281,8 +1278,8 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, break; case NGHTTP3_CTRL_STREAM_STATE_ORIGIN_ASCII_ORIGIN: /* client side only */ - len = nghttp3_min_size(conn->rx.originlen - conn->rx.originbuflen, - (size_t)(end - p)); + len = nghttp3_min(conn->rx.originlen - conn->rx.originbuflen, + (size_t)(end - p)); assert(len > 0); @@ -1291,7 +1288,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, conn->rx.originbuflen += len; p += len; nconsumed += len; - rstate->left -= (int64_t)len; + rstate->left -= len; if (conn->rx.originbuflen < conn->rx.originlen) { return (nghttp3_ssize)nconsumed; @@ -1319,10 +1316,10 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, break; case NGHTTP3_CTRL_STREAM_STATE_IGN_FRAME: - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); p += len; nconsumed += len; - rstate->left -= (int64_t)len; + rstate->left -= len; if (rstate->left) { return (nghttp3_ssize)nconsumed; @@ -1339,7 +1336,6 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn, } static int conn_delete_stream(nghttp3_conn *conn, nghttp3_stream *stream) { - int bidi = nghttp3_client_stream_bidi(stream->node.id); int rv; rv = conn_call_deferred_consume(conn, stream, @@ -1348,23 +1344,20 @@ static int conn_delete_stream(nghttp3_conn *conn, nghttp3_stream *stream) { return rv; } - if (bidi) { - if (stream->qpack_blocked_pe.index != NGHTTP3_PQ_BAD_INDEX) { - nghttp3_conn_qpack_blocked_streams_remove(conn, stream); + if (stream->qpack_blocked_pe.index != NGHTTP3_PQ_BAD_INDEX) { + nghttp3_conn_qpack_blocked_streams_remove(conn, stream); - rv = nghttp3_qpack_decoder_cancel_stream(&conn->qdec, stream->node.id); - if (rv != 0) { - return rv; - } + rv = nghttp3_qpack_decoder_cancel_stream(&conn->qdec, stream->node.id); + if (rv != 0) { + return rv; } + } - if (conn->callbacks.stream_close) { - rv = - conn->callbacks.stream_close(conn, stream->node.id, stream->error_code, - conn->user_data, stream->user_data); - if (rv != 0) { - return NGHTTP3_ERR_CALLBACK_FAILURE; - } + if (conn->callbacks.stream_close) { + rv = conn->callbacks.stream_close(conn, stream->node.id, stream->error_code, + conn->user_data, stream->user_data); + if (rv != 0) { + return NGHTTP3_ERR_CALLBACK_FAILURE; } } @@ -1445,7 +1438,7 @@ nghttp3_ssize nghttp3_conn_read_qpack_encoder(nghttp3_conn *conn, for (; !nghttp3_pq_empty(&conn->qpack_blocked_streams);) { stream = nghttp3_struct_of(nghttp3_pq_top(&conn->qpack_blocked_streams), nghttp3_stream, qpack_blocked_pe); - if (nghttp3_qpack_stream_context_get_ricnt(&stream->qpack_sctx) > + if (nghttp3_qpack_stream_context_get_ricnt2(&stream->qpack_sctx) > nghttp3_qpack_decoder_get_icnt(&conn->qdec)) { break; } @@ -1647,13 +1640,13 @@ nghttp3_ssize nghttp3_conn_read_bidi(nghttp3_conn *conn, size_t *pnproc, } break; case NGHTTP3_REQ_STREAM_STATE_DATA: - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); rv = nghttp3_conn_on_data(conn, stream, p, len); if (rv != 0) { return rv; } p += len; - rstate->left -= (int64_t)len; + rstate->left -= len; if (rstate->left) { goto almost_done; @@ -1666,16 +1659,16 @@ nghttp3_ssize nghttp3_conn_read_bidi(nghttp3_conn *conn, size_t *pnproc, nghttp3_stream_read_state_reset(rstate); break; case NGHTTP3_REQ_STREAM_STATE_HEADERS: - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); - nread = nghttp3_conn_on_headers(conn, stream, p, len, - (int64_t)len == rstate->left); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); + nread = + nghttp3_conn_on_headers(conn, stream, p, len, len == rstate->left); if (nread < 0) { return nread; } p += nread; nconsumed += (size_t)nread; - rstate->left -= nread; + rstate->left -= (uint64_t)nread; if (stream->flags & NGHTTP3_STREAM_FLAG_QPACK_DECODE_BLOCKED) { if (p != end && nghttp3_stream_get_buffered_datalen(stream) == 0) { @@ -1748,10 +1741,10 @@ nghttp3_ssize nghttp3_conn_read_bidi(nghttp3_conn *conn, size_t *pnproc, break; case NGHTTP3_REQ_STREAM_STATE_IGN_FRAME: - len = (size_t)nghttp3_min_int64(rstate->left, (int64_t)(end - p)); + len = (size_t)nghttp3_min(rstate->left, (uint64_t)(end - p)); p += len; nconsumed += len; - rstate->left -= (int64_t)len; + rstate->left -= len; if (rstate->left) { goto almost_done; @@ -1975,7 +1968,7 @@ int nghttp3_conn_on_settings_entry_received(nghttp3_conn *conn, dest->qpack_blocked_streams = (size_t)ent->value; nghttp3_qpack_encoder_set_max_blocked_streams( - &conn->qenc, (size_t)nghttp3_min_uint64(100, ent->value)); + &conn->qenc, (size_t)nghttp3_min(100, ent->value)); break; case NGHTTP3_SETTINGS_ID_ENABLE_CONNECT_PROTOCOL: if (conn->server) { @@ -2054,7 +2047,7 @@ conn_on_priority_update_stream(nghttp3_conn *conn, } conn->rx.max_stream_id_bidi = - nghttp3_max_int64(conn->rx.max_stream_id_bidi, stream_id); + nghttp3_max(conn->rx.max_stream_id_bidi, stream_id); rv = nghttp3_conn_create_stream(conn, &stream, stream_id); if (rv != 0) { return rv; @@ -2106,11 +2099,11 @@ int nghttp3_conn_create_stream(nghttp3_conn *conn, nghttp3_stream **pstream, int64_t stream_id) { nghttp3_stream *stream; int rv; + static const nghttp3_stream_callbacks callbacks = { + .acked_data = conn_stream_acked_data, + }; - rv = nghttp3_stream_new(&stream, stream_id, - &(nghttp3_stream_callbacks){ - .acked_data = conn_stream_acked_data, - }, + rv = nghttp3_stream_new(&stream, stream_id, &callbacks, &conn->out_chunk_objalloc, &conn->stream_objalloc, conn->mem); if (rv != 0) { @@ -2135,14 +2128,14 @@ int nghttp3_conn_create_stream(nghttp3_conn *conn, nghttp3_stream **pstream, return 0; } -nghttp3_stream *nghttp3_conn_find_stream(nghttp3_conn *conn, +nghttp3_stream *nghttp3_conn_find_stream(const nghttp3_conn *conn, int64_t stream_id) { return nghttp3_map_find(&conn->streams, (nghttp3_map_key_type)stream_id); } int nghttp3_conn_bind_control_stream(nghttp3_conn *conn, int64_t stream_id) { nghttp3_stream *stream; - nghttp3_frame fr; + nghttp3_frame *fr; int rv; assert(stream_id >= 0); @@ -2168,28 +2161,28 @@ int nghttp3_conn_bind_control_stream(nghttp3_conn *conn, int64_t stream_id) { return rv; } - fr.settings = (nghttp3_frame_settings){ - .type = NGHTTP3_FRAME_SETTINGS, - .local_settings = &conn->local.settings, - }; - - rv = nghttp3_stream_frq_add(stream, &fr); + rv = nghttp3_stream_frq_emplace(stream, &fr); if (rv != 0) { return rv; } + fr->settings = (nghttp3_frame_settings){ + .type = NGHTTP3_FRAME_SETTINGS, + .local_settings = &conn->local.settings, + }; + if (conn->local.settings.origin_list) { assert(conn->server); - fr.origin = (nghttp3_frame_origin){ - .type = NGHTTP3_FRAME_ORIGIN, - .origin_list = *conn->local.settings.origin_list, - }; - - rv = nghttp3_stream_frq_add(stream, &fr); + rv = nghttp3_stream_frq_emplace(stream, &fr); if (rv != 0) { return rv; } + + fr->origin = (nghttp3_frame_origin){ + .type = NGHTTP3_FRAME_ORIGIN, + .origin_list = *conn->local.settings.origin_list, + }; } return 0; @@ -2416,35 +2409,35 @@ static int conn_submit_headers_data(nghttp3_conn *conn, nghttp3_stream *stream, const nghttp3_data_reader *dr) { int rv; nghttp3_nv *nnva; - nghttp3_frame fr; + nghttp3_frame *fr; rv = nghttp3_nva_copy(&nnva, nva, nvlen, conn->mem); if (rv != 0) { return rv; } - fr.headers = (nghttp3_frame_headers){ - .type = NGHTTP3_FRAME_HEADERS, - .nva = nnva, - .nvlen = nvlen, - }; - - rv = nghttp3_stream_frq_add(stream, &fr); + rv = nghttp3_stream_frq_emplace(stream, &fr); if (rv != 0) { nghttp3_nva_del(nnva, conn->mem); return rv; } - if (dr) { - fr.data = (nghttp3_frame_data){ - .type = NGHTTP3_FRAME_DATA, - .dr = *dr, - }; + fr->headers = (nghttp3_frame_headers){ + .type = NGHTTP3_FRAME_HEADERS, + .nva = nnva, + .nvlen = nvlen, + }; - rv = nghttp3_stream_frq_add(stream, &fr); + if (dr) { + rv = nghttp3_stream_frq_emplace(stream, &fr); if (rv != 0) { return rv; } + + fr->data = (nghttp3_frame_data){ + .type = NGHTTP3_FRAME_DATA, + .dr = *dr, + }; } if (nghttp3_stream_require_schedule(stream)) { @@ -2587,51 +2580,51 @@ int nghttp3_conn_submit_trailers(nghttp3_conn *conn, int64_t stream_id, } int nghttp3_conn_submit_shutdown_notice(nghttp3_conn *conn) { - nghttp3_frame fr; + nghttp3_frame *fr; int rv; assert(conn->tx.ctrl); - fr.goaway = (nghttp3_frame_goaway){ + rv = nghttp3_stream_frq_emplace(conn->tx.ctrl, &fr); + if (rv != 0) { + return rv; + } + + fr->goaway = (nghttp3_frame_goaway){ .type = NGHTTP3_FRAME_GOAWAY, .id = conn->server ? NGHTTP3_SHUTDOWN_NOTICE_STREAM_ID : NGHTTP3_SHUTDOWN_NOTICE_PUSH_ID, }; - assert(fr.goaway.id <= conn->tx.goaway_id); + assert(fr->goaway.id <= conn->tx.goaway_id); - rv = nghttp3_stream_frq_add(conn->tx.ctrl, &fr); - if (rv != 0) { - return rv; - } - - conn->tx.goaway_id = fr.goaway.id; + conn->tx.goaway_id = fr->goaway.id; conn->flags |= NGHTTP3_CONN_FLAG_GOAWAY_QUEUED; return 0; } int nghttp3_conn_shutdown(nghttp3_conn *conn) { - nghttp3_frame fr; + nghttp3_frame *fr; int rv; assert(conn->tx.ctrl); - fr.goaway = (nghttp3_frame_goaway){ - .type = NGHTTP3_FRAME_GOAWAY, - .id = conn->server ? nghttp3_min_int64((1ll << 62) - 4, - conn->rx.max_stream_id_bidi + 4) - : 0, - }; - - assert(fr.goaway.id <= conn->tx.goaway_id); - - rv = nghttp3_stream_frq_add(conn->tx.ctrl, &fr); + rv = nghttp3_stream_frq_emplace(conn->tx.ctrl, &fr); if (rv != 0) { return rv; } - conn->tx.goaway_id = fr.goaway.id; + fr->goaway = (nghttp3_frame_goaway){ + .type = NGHTTP3_FRAME_GOAWAY, + .id = conn->server + ? nghttp3_min((1LL << 62) - 4, conn->rx.max_stream_id_bidi + 4) + : 0, + }; + + assert(fr->goaway.id <= conn->tx.goaway_id); + + conn->tx.goaway_id = fr->goaway.id; conn->flags |= NGHTTP3_CONN_FLAG_GOAWAY_QUEUED | NGHTTP3_CONN_FLAG_SHUTDOWN_COMMENCED; @@ -2697,7 +2690,12 @@ int nghttp3_conn_unblock_stream(nghttp3_conn *conn, int64_t stream_id) { } int nghttp3_conn_is_stream_writable(nghttp3_conn *conn, int64_t stream_id) { - nghttp3_stream *stream = nghttp3_conn_find_stream(conn, stream_id); + return nghttp3_conn_is_stream_writable2(conn, stream_id); +} + +int nghttp3_conn_is_stream_writable2(const nghttp3_conn *conn, + int64_t stream_id) { + const nghttp3_stream *stream = nghttp3_conn_find_stream(conn, stream_id); if (stream == NULL) { return 0; @@ -2815,9 +2813,29 @@ int nghttp3_conn_set_stream_user_data(nghttp3_conn *conn, int64_t stream_id, return 0; } +void *nghttp3_conn_get_stream_user_data(const nghttp3_conn *conn, + int64_t stream_id) { + nghttp3_stream *stream; + + assert(stream_id >= 0); + assert(stream_id <= (int64_t)NGHTTP3_MAX_VARINT); + + stream = nghttp3_conn_find_stream(conn, stream_id); + if (stream == NULL) { + return NULL; + } + + return stream->user_data; +} + uint64_t nghttp3_conn_get_frame_payload_left(nghttp3_conn *conn, int64_t stream_id) { - nghttp3_stream *stream; + return nghttp3_conn_get_frame_payload_left2(conn, stream_id); +} + +uint64_t nghttp3_conn_get_frame_payload_left2(const nghttp3_conn *conn, + int64_t stream_id) { + const nghttp3_stream *stream; int uni = 0; assert(stream_id >= 0); @@ -2839,14 +2857,22 @@ uint64_t nghttp3_conn_get_frame_payload_left(nghttp3_conn *conn, return 0; } - return (uint64_t)stream->rstate.left; + return stream->rstate.left; } int nghttp3_conn_get_stream_priority_versioned(nghttp3_conn *conn, int pri_version, nghttp3_pri *dest, int64_t stream_id) { - nghttp3_stream *stream; + return nghttp3_conn_get_stream_priority2_versioned(conn, pri_version, dest, + stream_id); +} + +int nghttp3_conn_get_stream_priority2_versioned(const nghttp3_conn *conn, + int pri_version, + nghttp3_pri *dest, + int64_t stream_id) { + const nghttp3_stream *stream; (void)pri_version; assert(conn->server); @@ -2872,7 +2898,8 @@ int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn, const uint8_t *data, size_t datalen) { nghttp3_stream *stream; - nghttp3_frame fr; + nghttp3_frame *fr; + int rv; uint8_t *buf = NULL; assert(!conn->server); @@ -2897,14 +2924,20 @@ int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn, memcpy(buf, data, datalen); } - fr.priority_update = (nghttp3_frame_priority_update){ + rv = nghttp3_stream_frq_emplace(conn->tx.ctrl, &fr); + if (rv != 0) { + nghttp3_mem_free(conn->mem, buf); + return rv; + } + + fr->priority_update = (nghttp3_frame_priority_update){ .type = NGHTTP3_FRAME_PRIORITY_UPDATE, .pri_elem_id = stream_id, .data = buf, .datalen = datalen, }; - return nghttp3_stream_frq_add(conn->tx.ctrl, &fr); + return 0; } int nghttp3_conn_set_server_stream_priority_versioned(nghttp3_conn *conn, @@ -2935,6 +2968,10 @@ int nghttp3_conn_set_server_stream_priority_versioned(nghttp3_conn *conn, } int nghttp3_conn_is_drained(nghttp3_conn *conn) { + return nghttp3_conn_is_drained2(conn); +} + +int nghttp3_conn_is_drained2(const nghttp3_conn *conn) { assert(conn->server); return (conn->flags & NGHTTP3_CONN_FLAG_SHUTDOWN_COMMENCED) && diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_conn.h b/deps/ngtcp2/nghttp3/lib/nghttp3_conn.h index 4f7f68f777a9be..6841b1c343a305 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_conn.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_conn.h @@ -48,28 +48,28 @@ #define NGHTTP3_QPACK_ENCODER_MAX_BLOCK_STREAMS 100 /* NGHTTP3_CONN_FLAG_NONE indicates that no flag is set. */ -#define NGHTTP3_CONN_FLAG_NONE 0x0000u +#define NGHTTP3_CONN_FLAG_NONE 0x0000U /* NGHTTP3_CONN_FLAG_SETTINGS_RECVED is set when SETTINGS frame has been received. */ -#define NGHTTP3_CONN_FLAG_SETTINGS_RECVED 0x0001u +#define NGHTTP3_CONN_FLAG_SETTINGS_RECVED 0x0001U /* NGHTTP3_CONN_FLAG_CONTROL_OPENED is set when a control stream has opened. */ -#define NGHTTP3_CONN_FLAG_CONTROL_OPENED 0x0002u +#define NGHTTP3_CONN_FLAG_CONTROL_OPENED 0x0002U /* NGHTTP3_CONN_FLAG_QPACK_ENCODER_OPENED is set when a QPACK encoder stream has opened. */ -#define NGHTTP3_CONN_FLAG_QPACK_ENCODER_OPENED 0x0004u +#define NGHTTP3_CONN_FLAG_QPACK_ENCODER_OPENED 0x0004U /* NGHTTP3_CONN_FLAG_QPACK_DECODER_OPENED is set when a QPACK decoder stream has opened. */ -#define NGHTTP3_CONN_FLAG_QPACK_DECODER_OPENED 0x0008u +#define NGHTTP3_CONN_FLAG_QPACK_DECODER_OPENED 0x0008U /* NGHTTP3_CONN_FLAG_SHUTDOWN_COMMENCED is set when graceful shutdown has started. */ -#define NGHTTP3_CONN_FLAG_SHUTDOWN_COMMENCED 0x0010u +#define NGHTTP3_CONN_FLAG_SHUTDOWN_COMMENCED 0x0010U /* NGHTTP3_CONN_FLAG_GOAWAY_RECVED indicates that GOAWAY frame has received. */ -#define NGHTTP3_CONN_FLAG_GOAWAY_RECVED 0x0020u +#define NGHTTP3_CONN_FLAG_GOAWAY_RECVED 0x0020U /* NGHTTP3_CONN_FLAG_GOAWAY_QUEUED indicates that GOAWAY frame has been submitted for transmission. */ -#define NGHTTP3_CONN_FLAG_GOAWAY_QUEUED 0x0040u +#define NGHTTP3_CONN_FLAG_GOAWAY_QUEUED 0x0040U typedef struct nghttp3_chunk { nghttp3_opl_entry oplent; @@ -175,7 +175,8 @@ struct nghttp3_conn { } tx; }; -nghttp3_stream *nghttp3_conn_find_stream(nghttp3_conn *conn, int64_t stream_id); +nghttp3_stream *nghttp3_conn_find_stream(const nghttp3_conn *conn, + int64_t stream_id); int nghttp3_conn_create_stream(nghttp3_conn *conn, nghttp3_stream **pstream, int64_t stream_id); diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_conv.c b/deps/ngtcp2/nghttp3/lib/nghttp3_conv.c index 3e14ffcd394b9b..2a89a3c76e6c13 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_conv.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_conv.c @@ -31,7 +31,7 @@ #include "nghttp3_str.h" #include "nghttp3_unreachable.h" -const uint8_t *nghttp3_get_varint(int64_t *dest, const uint8_t *p) { +const uint8_t *nghttp3_get_uvarint(uint64_t *dest, const uint8_t *p) { uint16_t n16; uint32_t n32; uint64_t n64; @@ -43,22 +43,22 @@ const uint8_t *nghttp3_get_varint(int64_t *dest, const uint8_t *p) { case 1: memcpy(&n16, p, 2); n16 = ntohs(n16); - n16 &= 0x3fff; + n16 &= 0x3FFFU; *dest = n16; return p + 2; case 2: memcpy(&n32, p, 4); n32 = ntohl(n32); - n32 &= 0x3fffffff; + n32 &= 0x3FFFFFFFU; *dest = n32; return p + 4; case 3: memcpy(&n64, p, 8); n64 = nghttp3_ntohl64(n64); - n64 &= 0x3fffffffffffffff; - *dest = (int64_t)n64; + n64 &= 0x3FFFFFFFFFFFFFFFU; + *dest = n64; return p + 8; default: @@ -66,8 +66,8 @@ const uint8_t *nghttp3_get_varint(int64_t *dest, const uint8_t *p) { } } -size_t nghttp3_get_varintlen(const uint8_t *p) { - return (size_t)(1u << (*p >> 6)); +size_t nghttp3_get_uvarintlen(const uint8_t *p) { + return (size_t)(1U << (*p >> 6)); } uint8_t *nghttp3_put_uint64be(uint8_t *p, uint64_t n) { @@ -85,7 +85,7 @@ uint8_t *nghttp3_put_uint16be(uint8_t *p, uint16_t n) { return nghttp3_cpymem(p, (const uint8_t *)&n, sizeof(n)); } -uint8_t *nghttp3_put_varint(uint8_t *p, int64_t n) { +uint8_t *nghttp3_put_uvarint(uint8_t *p, uint64_t n) { uint8_t *rv; if (n < 64) { *p++ = (uint8_t)n; @@ -93,21 +93,21 @@ uint8_t *nghttp3_put_varint(uint8_t *p, int64_t n) { } if (n < 16384) { rv = nghttp3_put_uint16be(p, (uint16_t)n); - *p |= 0x40; + *p |= 0x40U; return rv; } if (n < 1073741824) { rv = nghttp3_put_uint32be(p, (uint32_t)n); - *p |= 0x80; + *p |= 0x80U; return rv; } - assert(n < 4611686018427387904LL); - rv = nghttp3_put_uint64be(p, (uint64_t)n); - *p |= 0xc0; + assert(n < 4611686018427387904ULL); + rv = nghttp3_put_uint64be(p, n); + *p |= 0xC0U; return rv; } -size_t nghttp3_put_varintlen(int64_t n) { +size_t nghttp3_put_uvarintlen(uint64_t n) { if (n < 64) { return 1; } @@ -117,7 +117,7 @@ size_t nghttp3_put_varintlen(int64_t n) { if (n < 1073741824) { return 4; } - assert(n < 4611686018427387904LL); + assert(n < 4611686018427387904ULL); return 8; } diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_conv.h b/deps/ngtcp2/nghttp3/lib/nghttp3_conv.h index 8895fe8d3415d6..47856131049945 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_conv.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_conv.h @@ -56,7 +56,7 @@ #include -#define NGHTTP3_VARINT_MAX ((1ull << 62) - 1) +#define NGHTTP3_VARINT_MAX ((1ULL << 62) - 1) #if HAVE_DECL_BE64TOH # define nghttp3_ntohl64(N) be64toh(N) @@ -67,11 +67,11 @@ # define nghttp3_htonl64(N) (N) # else /* !defined(WORDS_BIGENDIAN) */ # if HAVE_DECL_BSWAP_64 -# define nghttp3_bswap64 bswap_64 +# define nghttp3_bswap64(N) bswap_64(N) # elif defined(WIN32) -# define nghttp3_bswap64 _byteswap_uint64 +# define nghttp3_bswap64(N) _byteswap_uint64(N) # elif defined(__APPLE__) -# define nghttp3_bswap64 OSSwapInt64 +# define nghttp3_bswap64(N) OSSwapInt64(N) # else /* !(HAVE_DECL_BSWAP_64 || defined(WIN32) || defined(__APPLE__)) */ # define nghttp3_bswap64(N) \ ((uint64_t)(ntohl((uint32_t)(N))) << 32 | ntohl((uint32_t)((N) >> 32))) @@ -82,66 +82,43 @@ #endif /* !HAVE_DECL_BE64TOH */ #ifdef WIN32 -/* Windows requires ws2_32 library for ntonl family of functions. We - define inline functions for those functions so that we don't have - dependency on that lib. */ - -# ifdef _MSC_VER -# define STIN static __inline -# else /* !defined(_MSC_VER) */ -# define STIN static inline -# endif /* !defined(_MSC_VER) */ - -STIN uint32_t htonl(uint32_t hostlong) { - uint32_t res; - unsigned char *p = (unsigned char *)&res; - *p++ = (unsigned char)(hostlong >> 24); - *p++ = (hostlong >> 16) & 0xffu; - *p++ = (hostlong >> 8) & 0xffu; - *p = hostlong & 0xffu; - return res; -} - -STIN uint16_t htons(uint16_t hostshort) { - uint16_t res; - unsigned char *p = (unsigned char *)&res; - *p++ = (unsigned char)(hostshort >> 8); - *p = hostshort & 0xffu; - return res; -} - -STIN uint32_t ntohl(uint32_t netlong) { - uint32_t res; - unsigned char *p = (unsigned char *)&netlong; - res = (uint32_t)(*p++ << 24); - res += (uint32_t)(*p++ << 16); - res += (uint32_t)(*p++ << 8); - res += *p; - return res; -} +/* Windows requires ws2_32 library for ntonl family of functions. + Instead of using them, use _byteswap_* functions. This is fine + because all platforms that can run Windows these days are little + endian. */ +# define htonl(N) _byteswap_ulong(N) +# define htons(N) _byteswap_ushort(N) +# define ntohl(N) _byteswap_ulong(N) +# define ntohs(N) _byteswap_ushort(N) +#endif /* defined(WIN32) */ -STIN uint16_t ntohs(uint16_t netshort) { - uint16_t res; - unsigned char *p = (unsigned char *)&netshort; - res = (uint16_t)(*p++ << 8); - res += *p; - return res; -} +/* + * nghttp3_get_uvarint reads variable-length unsigned integer from + * |p|, and stores it in the buffer pointed by |dest| in host byte + * order. It returns |p| plus the number of bytes read from |p|. + */ +const uint8_t *nghttp3_get_uvarint(uint64_t *dest, const uint8_t *p); -#endif /* defined(WIN32) */ +/* + * nghttp3_get_uvarintlen returns the required number of bytes to read + * variable-length integer starting at |p|. + */ +size_t nghttp3_get_uvarintlen(const uint8_t *p); /* * nghttp3_get_varint reads variable-length unsigned integer from |p|, * and stores it in the buffer pointed by |dest| in host byte order. * It returns |p| plus the number of bytes read from |p|. */ -const uint8_t *nghttp3_get_varint(int64_t *dest, const uint8_t *p); +static inline const uint8_t *nghttp3_get_varint(int64_t *dest, + const uint8_t *p) { + uint64_t n; -/* - * nghttp3_get_varintlen returns the required number of bytes to read - * variable-length integer starting at |p|. - */ -size_t nghttp3_get_varintlen(const uint8_t *p); + p = nghttp3_get_uvarint(&n, p); + *dest = (int64_t)n; + + return p; +} /* * nghttp3_put_uint64be writes |n| in host byte order in |p| in @@ -165,26 +142,20 @@ uint8_t *nghttp3_put_uint32be(uint8_t *p, uint32_t n); uint8_t *nghttp3_put_uint16be(uint8_t *p, uint16_t n); /* - * nghttp3_put_varint writes |n| in |p| using variable-length integer + * nghttp3_put_uvarint writes |n| in |p| using variable-length integer * encoding. It returns the one beyond of the last written position. */ -uint8_t *nghttp3_put_varint(uint8_t *p, int64_t n); +uint8_t *nghttp3_put_uvarint(uint8_t *p, uint64_t n); /* - * nghttp3_put_varintlen returns the required number of bytes to + * nghttp3_put_uvarintlen returns the required number of bytes to * encode |n|. */ -size_t nghttp3_put_varintlen(int64_t n); +size_t nghttp3_put_uvarintlen(uint64_t n); /* * nghttp3_ord_stream_id returns the ordinal number of |stream_id|. */ uint64_t nghttp3_ord_stream_id(int64_t stream_id); -/* - * NGHTTP3_PRI_INC_MASK is a bit mask to retrieve incremental bit from - * a value produced by nghttp3_pri_to_uint8. - */ -#define NGHTTP3_PRI_INC_MASK (1 << 7) - #endif /* !defined(NGHTTP3_CONV_H) */ diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_frame.c b/deps/ngtcp2/nghttp3/lib/nghttp3_frame.c index da88b54f96de65..2efba7472c251f 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_frame.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_frame.c @@ -31,69 +31,70 @@ #include "nghttp3_conv.h" #include "nghttp3_str.h" -uint8_t *nghttp3_frame_write_hd(uint8_t *p, int64_t type, int64_t payloadlen) { - p = nghttp3_put_varint(p, type); - p = nghttp3_put_varint(p, payloadlen); +uint8_t *nghttp3_frame_write_hd(uint8_t *p, uint64_t type, + uint64_t payloadlen) { + p = nghttp3_put_uvarint(p, type); + p = nghttp3_put_uvarint(p, payloadlen); return p; } -size_t nghttp3_frame_write_hd_len(int64_t type, int64_t payloadlen) { - return nghttp3_put_varintlen(type) + nghttp3_put_varintlen(payloadlen); +size_t nghttp3_frame_write_hd_len(uint64_t type, uint64_t payloadlen) { + return nghttp3_put_uvarintlen(type) + nghttp3_put_uvarintlen(payloadlen); } uint8_t *nghttp3_frame_write_settings(uint8_t *p, const nghttp3_frame_settings *fr, - int64_t payloadlen) { + uint64_t payloadlen) { size_t i; p = nghttp3_frame_write_hd(p, fr->type, payloadlen); for (i = 0; i < fr->niv; ++i) { - p = nghttp3_put_varint(p, (int64_t)fr->iv[i].id); - p = nghttp3_put_varint(p, (int64_t)fr->iv[i].value); + p = nghttp3_put_uvarint(p, fr->iv[i].id); + p = nghttp3_put_uvarint(p, fr->iv[i].value); } return p; } -size_t nghttp3_frame_write_settings_len(int64_t *ppayloadlen, +size_t nghttp3_frame_write_settings_len(uint64_t *ppayloadlen, const nghttp3_frame_settings *fr) { size_t payloadlen = 0; size_t i; for (i = 0; i < fr->niv; ++i) { - payloadlen += nghttp3_put_varintlen((int64_t)fr->iv[i].id) + - nghttp3_put_varintlen((int64_t)fr->iv[i].value); + payloadlen += nghttp3_put_uvarintlen(fr->iv[i].id) + + nghttp3_put_uvarintlen(fr->iv[i].value); } - *ppayloadlen = (int64_t)payloadlen; + *ppayloadlen = payloadlen; - return nghttp3_put_varintlen(NGHTTP3_FRAME_SETTINGS) + - nghttp3_put_varintlen((int64_t)payloadlen) + payloadlen; + return nghttp3_put_uvarintlen(NGHTTP3_FRAME_SETTINGS) + + nghttp3_put_uvarintlen(payloadlen) + payloadlen; } uint8_t *nghttp3_frame_write_goaway(uint8_t *p, const nghttp3_frame_goaway *fr, - int64_t payloadlen) { + uint64_t payloadlen) { p = nghttp3_frame_write_hd(p, fr->type, payloadlen); - p = nghttp3_put_varint(p, fr->id); + p = nghttp3_put_uvarint(p, (uint64_t)fr->id); return p; } -size_t nghttp3_frame_write_goaway_len(int64_t *ppayloadlen, +size_t nghttp3_frame_write_goaway_len(uint64_t *ppayloadlen, const nghttp3_frame_goaway *fr) { - size_t payloadlen = nghttp3_put_varintlen(fr->id); + size_t payloadlen = nghttp3_put_uvarintlen((uint64_t)fr->id); - *ppayloadlen = (int64_t)payloadlen; + *ppayloadlen = payloadlen; - return nghttp3_put_varintlen(NGHTTP3_FRAME_GOAWAY) + - nghttp3_put_varintlen((int64_t)payloadlen) + payloadlen; + return nghttp3_put_uvarintlen(NGHTTP3_FRAME_GOAWAY) + + nghttp3_put_uvarintlen(payloadlen) + payloadlen; } uint8_t *nghttp3_frame_write_priority_update( - uint8_t *p, const nghttp3_frame_priority_update *fr, int64_t payloadlen) { + uint8_t *p, const nghttp3_frame_priority_update *fr, uint64_t payloadlen) { p = nghttp3_frame_write_hd(p, fr->type, payloadlen); - p = nghttp3_put_varint(p, fr->pri_elem_id); + p = nghttp3_put_uvarint(p, (uint64_t)fr->pri_elem_id); if (fr->datalen) { p = nghttp3_cpymem(p, fr->data, fr->datalen); } @@ -102,17 +103,18 @@ uint8_t *nghttp3_frame_write_priority_update( } size_t nghttp3_frame_write_priority_update_len( - int64_t *ppayloadlen, const nghttp3_frame_priority_update *fr) { - size_t payloadlen = nghttp3_put_varintlen(fr->pri_elem_id) + fr->datalen; + uint64_t *ppayloadlen, const nghttp3_frame_priority_update *fr) { + size_t payloadlen = + nghttp3_put_uvarintlen((uint64_t)fr->pri_elem_id) + fr->datalen; - *ppayloadlen = (int64_t)payloadlen; + *ppayloadlen = payloadlen; - return nghttp3_put_varintlen(fr->type) + - nghttp3_put_varintlen((int64_t)payloadlen) + payloadlen; + return nghttp3_put_uvarintlen(fr->type) + nghttp3_put_uvarintlen(payloadlen) + + payloadlen; } uint8_t *nghttp3_frame_write_origin(uint8_t *p, const nghttp3_frame_origin *fr, - int64_t payloadlen) { + uint64_t payloadlen) { p = nghttp3_frame_write_hd(p, fr->type, payloadlen); if (fr->origin_list.len) { p = nghttp3_cpymem(p, fr->origin_list.base, fr->origin_list.len); @@ -121,14 +123,14 @@ uint8_t *nghttp3_frame_write_origin(uint8_t *p, const nghttp3_frame_origin *fr, return p; } -size_t nghttp3_frame_write_origin_len(int64_t *ppayloadlen, +size_t nghttp3_frame_write_origin_len(uint64_t *ppayloadlen, const nghttp3_frame_origin *fr) { size_t payloadlen = fr->origin_list.len; - *ppayloadlen = (int64_t)payloadlen; + *ppayloadlen = payloadlen; - return nghttp3_put_varintlen(fr->type) + - nghttp3_put_varintlen((int64_t)payloadlen) + payloadlen; + return nghttp3_put_uvarintlen(fr->type) + nghttp3_put_uvarintlen(payloadlen) + + payloadlen; } int nghttp3_nva_copy(nghttp3_nv **pnva, const nghttp3_nv *nva, size_t nvlen, diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_frame.h b/deps/ngtcp2/nghttp3/lib/nghttp3_frame.h index a8b706a7a6af83..7806cadbcf5f5a 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_frame.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_frame.h @@ -34,53 +34,53 @@ #include "nghttp3_buf.h" -#define NGHTTP3_FRAME_DATA 0x00 -#define NGHTTP3_FRAME_HEADERS 0x01 -#define NGHTTP3_FRAME_CANCEL_PUSH 0x03 -#define NGHTTP3_FRAME_SETTINGS 0x04 -#define NGHTTP3_FRAME_PUSH_PROMISE 0x05 -#define NGHTTP3_FRAME_GOAWAY 0x07 -#define NGHTTP3_FRAME_MAX_PUSH_ID 0x0d +#define NGHTTP3_FRAME_DATA 0x00U +#define NGHTTP3_FRAME_HEADERS 0x01U +#define NGHTTP3_FRAME_CANCEL_PUSH 0x03U +#define NGHTTP3_FRAME_SETTINGS 0x04U +#define NGHTTP3_FRAME_PUSH_PROMISE 0x05U +#define NGHTTP3_FRAME_GOAWAY 0x07U +#define NGHTTP3_FRAME_MAX_PUSH_ID 0x0DU /* PRIORITY_UPDATE: https://datatracker.ietf.org/doc/html/rfc9218 */ -#define NGHTTP3_FRAME_PRIORITY_UPDATE 0x0f0700 -#define NGHTTP3_FRAME_PRIORITY_UPDATE_PUSH_ID 0x0f0701 +#define NGHTTP3_FRAME_PRIORITY_UPDATE 0x0F0700U +#define NGHTTP3_FRAME_PRIORITY_UPDATE_PUSH_ID 0x0F0701U /* ORIGIN: https://datatracker.ietf.org/doc/html/rfc9412 */ -#define NGHTTP3_FRAME_ORIGIN 0x0c +#define NGHTTP3_FRAME_ORIGIN 0x0CU /* Frame types that are reserved for HTTP/2, and must not be used in HTTP/3. */ -#define NGHTTP3_H2_FRAME_PRIORITY 0x02 -#define NGHTTP3_H2_FRAME_PING 0x06 -#define NGHTTP3_H2_FRAME_WINDOW_UPDATE 0x08 -#define NGHTTP3_H2_FRAME_CONTINUATION 0x9 +#define NGHTTP3_H2_FRAME_PRIORITY 0x02U +#define NGHTTP3_H2_FRAME_PING 0x06U +#define NGHTTP3_H2_FRAME_WINDOW_UPDATE 0x08U +#define NGHTTP3_H2_FRAME_CONTINUATION 0x9U typedef struct nghttp3_frame_hd { - int64_t type; + uint64_t type; } nghttp3_frame_hd; typedef struct nghttp3_frame_data { - int64_t type; + uint64_t type; /* dr is set when sending DATA frame. It is not used on reception. */ nghttp3_data_reader dr; } nghttp3_frame_data; typedef struct nghttp3_frame_headers { - int64_t type; + uint64_t type; nghttp3_nv *nva; size_t nvlen; } nghttp3_frame_headers; -#define NGHTTP3_SETTINGS_ID_MAX_FIELD_SECTION_SIZE 0x06 -#define NGHTTP3_SETTINGS_ID_QPACK_MAX_TABLE_CAPACITY 0x01 -#define NGHTTP3_SETTINGS_ID_QPACK_BLOCKED_STREAMS 0x07 -#define NGHTTP3_SETTINGS_ID_ENABLE_CONNECT_PROTOCOL 0x08 -#define NGHTTP3_SETTINGS_ID_H3_DATAGRAM 0x33 +#define NGHTTP3_SETTINGS_ID_MAX_FIELD_SECTION_SIZE 0x06U +#define NGHTTP3_SETTINGS_ID_QPACK_MAX_TABLE_CAPACITY 0x01U +#define NGHTTP3_SETTINGS_ID_QPACK_BLOCKED_STREAMS 0x07U +#define NGHTTP3_SETTINGS_ID_ENABLE_CONNECT_PROTOCOL 0x08U +#define NGHTTP3_SETTINGS_ID_H3_DATAGRAM 0x33U -#define NGHTTP3_H2_SETTINGS_ID_ENABLE_PUSH 0x2 -#define NGHTTP3_H2_SETTINGS_ID_MAX_CONCURRENT_STREAMS 0x3 -#define NGHTTP3_H2_SETTINGS_ID_INITIAL_WINDOW_SIZE 0x4 -#define NGHTTP3_H2_SETTINGS_ID_MAX_FRAME_SIZE 0x5 +#define NGHTTP3_H2_SETTINGS_ID_ENABLE_PUSH 0x2U +#define NGHTTP3_H2_SETTINGS_ID_MAX_CONCURRENT_STREAMS 0x3U +#define NGHTTP3_H2_SETTINGS_ID_INITIAL_WINDOW_SIZE 0x4U +#define NGHTTP3_H2_SETTINGS_ID_MAX_FRAME_SIZE 0x5U typedef struct nghttp3_settings_entry { uint64_t id; @@ -88,7 +88,7 @@ typedef struct nghttp3_settings_entry { } nghttp3_settings_entry; typedef struct nghttp3_frame_settings { - int64_t type; + uint64_t type; size_t niv; nghttp3_settings_entry *iv; /* local_settings is set when sending SETTINGS frame. It is not @@ -97,12 +97,12 @@ typedef struct nghttp3_frame_settings { } nghttp3_frame_settings; typedef struct nghttp3_frame_goaway { - int64_t type; + uint64_t type; int64_t id; } nghttp3_frame_goaway; typedef struct nghttp3_frame_priority_update { - int64_t type; + uint64_t type; /* pri_elem_id is stream ID if type == NGHTTP3_FRAME_PRIORITY_UPDATE. It is push ID if type == NGHTTP3_FRAME_PRIORITY_UPDATE_PUSH_ID. It is undefined @@ -126,7 +126,7 @@ typedef struct nghttp3_frame_priority_update { } nghttp3_frame_priority_update; typedef struct nghttp3_frame_origin { - int64_t type; + uint64_t type; /* These fields are only used by server to send ORIGIN frame. Client never use them. */ nghttp3_vec origin_list; @@ -149,14 +149,14 @@ typedef union nghttp3_frame { * * This function returns |dest| plus the number of bytes written. */ -uint8_t *nghttp3_frame_write_hd(uint8_t *dest, int64_t type, - int64_t payloadlen); +uint8_t *nghttp3_frame_write_hd(uint8_t *dest, uint64_t type, + uint64_t payloadlen); /* * nghttp3_frame_write_hd_len returns the number of bytes required to * write a frame header consisting of |type| and |payloadlen|. */ -size_t nghttp3_frame_write_hd_len(int64_t type, int64_t payloadlen); +size_t nghttp3_frame_write_hd_len(uint64_t type, uint64_t payloadlen); /* * nghttp3_frame_write_settings writes SETTINGS frame |fr| to |dest|. @@ -167,14 +167,14 @@ size_t nghttp3_frame_write_hd_len(int64_t type, int64_t payloadlen); */ uint8_t *nghttp3_frame_write_settings(uint8_t *dest, const nghttp3_frame_settings *fr, - int64_t payloadlen); + uint64_t payloadlen); /* * nghttp3_frame_write_settings_len returns the number of bytes * required to write |fr|. This function stores the frame payload * length in |*ppayloadlen|. */ -size_t nghttp3_frame_write_settings_len(int64_t *pppayloadlen, +size_t nghttp3_frame_write_settings_len(uint64_t *pppayloadlen, const nghttp3_frame_settings *fr); /* @@ -186,14 +186,14 @@ size_t nghttp3_frame_write_settings_len(int64_t *pppayloadlen, */ uint8_t *nghttp3_frame_write_goaway(uint8_t *dest, const nghttp3_frame_goaway *fr, - int64_t payloadlen); + uint64_t payloadlen); /* * nghttp3_frame_write_goaway_len returns the number of bytes required * to write |fr|. This function stores the frame payload length in * |*ppayloadlen|. */ -size_t nghttp3_frame_write_goaway_len(int64_t *ppayloadlen, +size_t nghttp3_frame_write_goaway_len(uint64_t *ppayloadlen, const nghttp3_frame_goaway *fr); /* @@ -204,7 +204,7 @@ size_t nghttp3_frame_write_goaway_len(int64_t *ppayloadlen, * This function returns |dest| plus the number of bytes written; */ uint8_t *nghttp3_frame_write_priority_update( - uint8_t *dest, const nghttp3_frame_priority_update *fr, int64_t payloadlen); + uint8_t *dest, const nghttp3_frame_priority_update *fr, uint64_t payloadlen); /* * nghttp3_frame_write_priority_update_len returns the number of bytes @@ -212,7 +212,7 @@ uint8_t *nghttp3_frame_write_priority_update( * length in |*ppayloadlen|. */ size_t nghttp3_frame_write_priority_update_len( - int64_t *ppayloadlen, const nghttp3_frame_priority_update *fr); + uint64_t *ppayloadlen, const nghttp3_frame_priority_update *fr); /* * nghttp3_frame_write_origin writes ORIGIN frame |fr| to |dest|. @@ -223,14 +223,14 @@ size_t nghttp3_frame_write_priority_update_len( */ uint8_t *nghttp3_frame_write_origin(uint8_t *dest, const nghttp3_frame_origin *fr, - int64_t payloadlen); + uint64_t payloadlen); /* * nghttp3_frame_write_origin_len returns the number of bytes required * to write |fr|. This function stores the frame payload length in * |*ppayloadlen|. */ -size_t nghttp3_frame_write_origin_len(int64_t *ppayloadlen, +size_t nghttp3_frame_write_origin_len(uint64_t *ppayloadlen, const nghttp3_frame_origin *fr); /* diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_gaptr.c b/deps/ngtcp2/nghttp3/lib/nghttp3_gaptr.c index 68a4f8f747d682..bd557d08c34d51 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_gaptr.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_gaptr.c @@ -36,11 +36,11 @@ void nghttp3_gaptr_init(nghttp3_gaptr *gaptr, const nghttp3_mem *mem) { } static int gaptr_gap_init(nghttp3_gaptr *gaptr) { - return nghttp3_ksl_insert(&gaptr->gap, NULL, - &(nghttp3_range){ - .end = UINT64_MAX, - }, - NULL); + static const nghttp3_range end = { + .end = UINT64_MAX, + }; + + return nghttp3_ksl_insert(&gaptr->gap, NULL, &end, NULL); } void nghttp3_gaptr_free(nghttp3_gaptr *gaptr) { diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_http.c b/deps/ngtcp2/nghttp3/lib/nghttp3_http.c index 77449154ee2b98..95e1474f9aef5e 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_http.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_http.c @@ -62,27 +62,39 @@ static int memieq(const void *a, const void *b, size_t n) { #define lstrieq(A, B, N) \ (nghttp3_strlen_lit((A)) == (N) && memieq((A), (B), (N))) +static int32_t parse_status_code(const uint8_t *s, size_t len) { + if (len != 3 || '1' > s[0] || s[0] > '9' || '0' > s[1] || s[1] > '9' || + '0' > s[2] || s[2] > '9') { + return -1; + } + + return (s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0'); +} + static int64_t parse_uint(const uint8_t *s, size_t len) { - int64_t n = 0; + uint64_t n = 0; + uint32_t c; size_t i; + if (len == 0) { return -1; } + for (i = 0; i < len; ++i) { - if ('0' <= s[i] && s[i] <= '9') { - if (n > (int64_t)NGHTTP3_MAX_VARINT / 10) { - return -1; - } - n *= 10; - if (n > (int64_t)NGHTTP3_MAX_VARINT - (s[i] - '0')) { - return -1; - } - n += s[i] - '0'; - continue; + if ('0' > s[i] || s[i] > '9') { + return -1; } - return -1; + + c = s[i] - '0'; + + if (n > (NGHTTP3_MAX_VARINT - c) / 10) { + return -1; + } + + n = n * 10 + c; } - return n; + + return (int64_t)n; } static int check_pseudo_header(nghttp3_http_state *http, @@ -94,7 +106,7 @@ static int check_pseudo_header(nghttp3_http_state *http, return 1; } -static int expect_response_body(nghttp3_http_state *http) { +static int expect_response_body(const nghttp3_http_state *http) { return (http->flags & NGHTTP3_HTTP_FLAG_METH_HEAD) == 0 && http->status_code / 100 != 1 && http->status_code != 304 && http->status_code != 204; @@ -105,7 +117,7 @@ static int expect_response_body(nghttp3_http_state *http) { :path header field value must start with "/". This function must be called after ":method" header field was received. This function returns nonzero if path is valid.*/ -static int check_path_flags(nghttp3_http_state *http) { +static int check_path_flags(const nghttp3_http_state *http) { return (http->flags & NGHTTP3_HTTP_FLAG_SCHEME_HTTP) == 0 || ((http->flags & NGHTTP3_HTTP_FLAG_PATH_REGULAR) || ((http->flags & NGHTTP3_HTTP_FLAG_METH_OPTIONS) && @@ -275,26 +287,26 @@ static const int8_t VALID_PATH_CHARS[256] = { ['u'] = 1, ['v'] = 1, ['w'] = 1, ['x'] = 1, ['y'] = 1, ['z'] = 1, ['{'] = 1, ['|'] = 1, ['}'] = 1, ['~'] = 1, [0x80] = 1, [0x81] = 1, [0x82] = 1, [0x83] = 1, [0x84] = 1, [0x85] = 1, [0x86] = 1, [0x87] = 1, - [0x88] = 1, [0x89] = 1, [0x8a] = 1, [0x8b] = 1, [0x8c] = 1, [0x8d] = 1, - [0x8e] = 1, [0x8f] = 1, [0x90] = 1, [0x91] = 1, [0x92] = 1, [0x93] = 1, + [0x88] = 1, [0x89] = 1, [0x8A] = 1, [0x8B] = 1, [0x8C] = 1, [0x8D] = 1, + [0x8E] = 1, [0x8F] = 1, [0x90] = 1, [0x91] = 1, [0x92] = 1, [0x93] = 1, [0x94] = 1, [0x95] = 1, [0x96] = 1, [0x97] = 1, [0x98] = 1, [0x99] = 1, - [0x9a] = 1, [0x9b] = 1, [0x9c] = 1, [0x9d] = 1, [0x9e] = 1, [0x9f] = 1, - [0xa0] = 1, [0xa1] = 1, [0xa2] = 1, [0xa3] = 1, [0xa4] = 1, [0xa5] = 1, - [0xa6] = 1, [0xa7] = 1, [0xa8] = 1, [0xa9] = 1, [0xaa] = 1, [0xab] = 1, - [0xac] = 1, [0xad] = 1, [0xae] = 1, [0xaf] = 1, [0xb0] = 1, [0xb1] = 1, - [0xb2] = 1, [0xb3] = 1, [0xb4] = 1, [0xb5] = 1, [0xb6] = 1, [0xb7] = 1, - [0xb8] = 1, [0xb9] = 1, [0xba] = 1, [0xbb] = 1, [0xbc] = 1, [0xbd] = 1, - [0xbe] = 1, [0xbf] = 1, [0xc0] = 1, [0xc1] = 1, [0xc2] = 1, [0xc3] = 1, - [0xc4] = 1, [0xc5] = 1, [0xc6] = 1, [0xc7] = 1, [0xc8] = 1, [0xc9] = 1, - [0xca] = 1, [0xcb] = 1, [0xcc] = 1, [0xcd] = 1, [0xce] = 1, [0xcf] = 1, - [0xd0] = 1, [0xd1] = 1, [0xd2] = 1, [0xd3] = 1, [0xd4] = 1, [0xd5] = 1, - [0xd6] = 1, [0xd7] = 1, [0xd8] = 1, [0xd9] = 1, [0xda] = 1, [0xdb] = 1, - [0xdc] = 1, [0xdd] = 1, [0xde] = 1, [0xdf] = 1, [0xe0] = 1, [0xe1] = 1, - [0xe2] = 1, [0xe3] = 1, [0xe4] = 1, [0xe5] = 1, [0xe6] = 1, [0xe7] = 1, - [0xe8] = 1, [0xe9] = 1, [0xea] = 1, [0xeb] = 1, [0xec] = 1, [0xed] = 1, - [0xee] = 1, [0xef] = 1, [0xf0] = 1, [0xf1] = 1, [0xf2] = 1, [0xf3] = 1, - [0xf4] = 1, [0xf5] = 1, [0xf6] = 1, [0xf7] = 1, [0xf8] = 1, [0xf9] = 1, - [0xfa] = 1, [0xfb] = 1, [0xfc] = 1, [0xfd] = 1, [0xfe] = 1, [0xff] = 1, + [0x9A] = 1, [0x9B] = 1, [0x9C] = 1, [0x9D] = 1, [0x9E] = 1, [0x9F] = 1, + [0xA0] = 1, [0xA1] = 1, [0xA2] = 1, [0xA3] = 1, [0xA4] = 1, [0xA5] = 1, + [0xA6] = 1, [0xA7] = 1, [0xA8] = 1, [0xA9] = 1, [0xAA] = 1, [0xAB] = 1, + [0xAC] = 1, [0xAD] = 1, [0xAE] = 1, [0xAF] = 1, [0xB0] = 1, [0xB1] = 1, + [0xB2] = 1, [0xB3] = 1, [0xB4] = 1, [0xB5] = 1, [0xB6] = 1, [0xB7] = 1, + [0xB8] = 1, [0xB9] = 1, [0xBA] = 1, [0xBB] = 1, [0xBC] = 1, [0xBD] = 1, + [0xBE] = 1, [0xBF] = 1, [0xC0] = 1, [0xC1] = 1, [0xC2] = 1, [0xC3] = 1, + [0xC4] = 1, [0xC5] = 1, [0xC6] = 1, [0xC7] = 1, [0xC8] = 1, [0xC9] = 1, + [0xCA] = 1, [0xCB] = 1, [0xCC] = 1, [0xCD] = 1, [0xCE] = 1, [0xCF] = 1, + [0xD0] = 1, [0xD1] = 1, [0xD2] = 1, [0xD3] = 1, [0xD4] = 1, [0xD5] = 1, + [0xD6] = 1, [0xD7] = 1, [0xD8] = 1, [0xD9] = 1, [0xDA] = 1, [0xDB] = 1, + [0xDC] = 1, [0xDD] = 1, [0xDE] = 1, [0xDF] = 1, [0xE0] = 1, [0xE1] = 1, + [0xE2] = 1, [0xE3] = 1, [0xE4] = 1, [0xE5] = 1, [0xE6] = 1, [0xE7] = 1, + [0xE8] = 1, [0xE9] = 1, [0xEA] = 1, [0xEB] = 1, [0xEC] = 1, [0xED] = 1, + [0xEE] = 1, [0xEF] = 1, [0xF0] = 1, [0xF1] = 1, [0xF2] = 1, [0xF3] = 1, + [0xF4] = 1, [0xF5] = 1, [0xF6] = 1, [0xF7] = 1, [0xF8] = 1, [0xF9] = 1, + [0xFA] = 1, [0xFB] = 1, [0xFC] = 1, [0xFD] = 1, [0xFE] = 1, [0xFF] = 1, }; static int check_path(const uint8_t *value, size_t len) { @@ -308,7 +320,7 @@ static int check_path(const uint8_t *value, size_t len) { } static int http_request_on_header(nghttp3_http_state *http, - nghttp3_qpack_nv *nv, int trailers, + const nghttp3_qpack_nv *nv, int trailers, int connect_protocol) { nghttp3_pri pri; @@ -452,15 +464,14 @@ static int http_request_on_header(nghttp3_http_state *http, } static int http_response_on_header(nghttp3_http_state *http, - nghttp3_qpack_nv *nv, int trailers) { + const nghttp3_qpack_nv *nv, int trailers) { switch (nv->token) { case NGHTTP3_QPACK_TOKEN__STATUS: { - if (!check_pseudo_header(http, nv, NGHTTP3_HTTP_FLAG__STATUS) || - nv->value->len != 3) { + if (!check_pseudo_header(http, nv, NGHTTP3_HTTP_FLAG__STATUS)) { return NGHTTP3_ERR_MALFORMED_HTTP_HEADER; } - http->status_code = (int16_t)parse_uint(nv->value->base, nv->value->len); - if (http->status_code < 100 || http->status_code == 101) { + http->status_code = parse_status_code(nv->value->base, nv->value->len); + if (http->status_code == -1 || http->status_code == 101) { return NGHTTP3_ERR_MALFORMED_HTTP_HEADER; } break; @@ -527,7 +538,7 @@ static int http_response_on_header(nghttp3_http_state *http, static int http_check_nonempty_header_name(const uint8_t *name, size_t len); -int nghttp3_http_on_header(nghttp3_http_state *http, nghttp3_qpack_nv *nv, +int nghttp3_http_on_header(nghttp3_http_state *http, const nghttp3_qpack_nv *nv, int request, int trailers, int connect_protocol) { if (nv->name->len == 0) { http->flags |= NGHTTP3_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED; @@ -577,10 +588,13 @@ int nghttp3_http_on_request_headers(nghttp3_http_state *http) { (NGHTTP3_HTTP_FLAG__AUTHORITY | NGHTTP3_HTTP_FLAG_HOST)) == 0) { return NGHTTP3_ERR_MALFORMED_HTTP_HEADER; } - if ((http->flags & NGHTTP3_HTTP_FLAG__PROTOCOL) && - ((http->flags & NGHTTP3_HTTP_FLAG_METH_CONNECT) == 0 || - (http->flags & NGHTTP3_HTTP_FLAG__AUTHORITY) == 0)) { - return NGHTTP3_ERR_MALFORMED_HTTP_HEADER; + if (http->flags & NGHTTP3_HTTP_FLAG__PROTOCOL) { + if ((http->flags & NGHTTP3_HTTP_FLAG_METH_CONNECT) == 0 || + (http->flags & NGHTTP3_HTTP_FLAG__AUTHORITY) == 0) { + return NGHTTP3_ERR_MALFORMED_HTTP_HEADER; + } + + http->content_length = -1; } if (!check_path_flags(http)) { return NGHTTP3_ERR_MALFORMED_HTTP_HEADER; @@ -615,7 +629,7 @@ int nghttp3_http_on_response_headers(nghttp3_http_state *http) { return 0; } -int nghttp3_http_on_remote_end_stream(nghttp3_stream *stream) { +int nghttp3_http_on_remote_end_stream(const nghttp3_stream *stream) { if ((stream->rx.http.flags & NGHTTP3_HTTP_FLAG_EXPECT_FINAL_RESPONSE) || (stream->rx.http.content_length != -1 && stream->rx.http.content_length != stream->rx.http.recv_content_length)) { @@ -733,36 +747,36 @@ static const int8_t VALID_HD_VALUE_CHARS[256] = { ['s'] = 1, ['t'] = 1, ['u'] = 1, ['v'] = 1, ['w'] = 1, ['x'] = 1, ['y'] = 1, ['z'] = 1, ['{'] = 1, ['|'] = 1, ['}'] = 1, ['~'] = 1, [0x80] = 1, [0x81] = 1, [0x82] = 1, [0x83] = 1, [0x84] = 1, [0x85] = 1, - [0x86] = 1, [0x87] = 1, [0x88] = 1, [0x89] = 1, [0x8a] = 1, [0x8b] = 1, - [0x8c] = 1, [0x8d] = 1, [0x8e] = 1, [0x8f] = 1, [0x90] = 1, [0x91] = 1, + [0x86] = 1, [0x87] = 1, [0x88] = 1, [0x89] = 1, [0x8A] = 1, [0x8B] = 1, + [0x8C] = 1, [0x8D] = 1, [0x8E] = 1, [0x8F] = 1, [0x90] = 1, [0x91] = 1, [0x92] = 1, [0x93] = 1, [0x94] = 1, [0x95] = 1, [0x96] = 1, [0x97] = 1, - [0x98] = 1, [0x99] = 1, [0x9a] = 1, [0x9b] = 1, [0x9c] = 1, [0x9d] = 1, - [0x9e] = 1, [0x9f] = 1, [0xa0] = 1, [0xa1] = 1, [0xa2] = 1, [0xa3] = 1, - [0xa4] = 1, [0xa5] = 1, [0xa6] = 1, [0xa7] = 1, [0xa8] = 1, [0xa9] = 1, - [0xaa] = 1, [0xab] = 1, [0xac] = 1, [0xad] = 1, [0xae] = 1, [0xaf] = 1, - [0xb0] = 1, [0xb1] = 1, [0xb2] = 1, [0xb3] = 1, [0xb4] = 1, [0xb5] = 1, - [0xb6] = 1, [0xb7] = 1, [0xb8] = 1, [0xb9] = 1, [0xba] = 1, [0xbb] = 1, - [0xbc] = 1, [0xbd] = 1, [0xbe] = 1, [0xbf] = 1, [0xc0] = 1, [0xc1] = 1, - [0xc2] = 1, [0xc3] = 1, [0xc4] = 1, [0xc5] = 1, [0xc6] = 1, [0xc7] = 1, - [0xc8] = 1, [0xc9] = 1, [0xca] = 1, [0xcb] = 1, [0xcc] = 1, [0xcd] = 1, - [0xce] = 1, [0xcf] = 1, [0xd0] = 1, [0xd1] = 1, [0xd2] = 1, [0xd3] = 1, - [0xd4] = 1, [0xd5] = 1, [0xd6] = 1, [0xd7] = 1, [0xd8] = 1, [0xd9] = 1, - [0xda] = 1, [0xdb] = 1, [0xdc] = 1, [0xdd] = 1, [0xde] = 1, [0xdf] = 1, - [0xe0] = 1, [0xe1] = 1, [0xe2] = 1, [0xe3] = 1, [0xe4] = 1, [0xe5] = 1, - [0xe6] = 1, [0xe7] = 1, [0xe8] = 1, [0xe9] = 1, [0xea] = 1, [0xeb] = 1, - [0xec] = 1, [0xed] = 1, [0xee] = 1, [0xef] = 1, [0xf0] = 1, [0xf1] = 1, - [0xf2] = 1, [0xf3] = 1, [0xf4] = 1, [0xf5] = 1, [0xf6] = 1, [0xf7] = 1, - [0xf8] = 1, [0xf9] = 1, [0xfa] = 1, [0xfb] = 1, [0xfc] = 1, [0xfd] = 1, - [0xfe] = 1, [0xff] = 1, + [0x98] = 1, [0x99] = 1, [0x9A] = 1, [0x9B] = 1, [0x9C] = 1, [0x9D] = 1, + [0x9E] = 1, [0x9F] = 1, [0xA0] = 1, [0xA1] = 1, [0xA2] = 1, [0xA3] = 1, + [0xA4] = 1, [0xA5] = 1, [0xA6] = 1, [0xA7] = 1, [0xA8] = 1, [0xA9] = 1, + [0xAA] = 1, [0xAB] = 1, [0xAC] = 1, [0xAD] = 1, [0xAE] = 1, [0xAF] = 1, + [0xB0] = 1, [0xB1] = 1, [0xB2] = 1, [0xB3] = 1, [0xB4] = 1, [0xB5] = 1, + [0xB6] = 1, [0xB7] = 1, [0xB8] = 1, [0xB9] = 1, [0xBA] = 1, [0xBB] = 1, + [0xBC] = 1, [0xBD] = 1, [0xBE] = 1, [0xBF] = 1, [0xC0] = 1, [0xC1] = 1, + [0xC2] = 1, [0xC3] = 1, [0xC4] = 1, [0xC5] = 1, [0xC6] = 1, [0xC7] = 1, + [0xC8] = 1, [0xC9] = 1, [0xCA] = 1, [0xCB] = 1, [0xCC] = 1, [0xCD] = 1, + [0xCE] = 1, [0xCF] = 1, [0xD0] = 1, [0xD1] = 1, [0xD2] = 1, [0xD3] = 1, + [0xD4] = 1, [0xD5] = 1, [0xD6] = 1, [0xD7] = 1, [0xD8] = 1, [0xD9] = 1, + [0xDA] = 1, [0xDB] = 1, [0xDC] = 1, [0xDD] = 1, [0xDE] = 1, [0xDF] = 1, + [0xE0] = 1, [0xE1] = 1, [0xE2] = 1, [0xE3] = 1, [0xE4] = 1, [0xE5] = 1, + [0xE6] = 1, [0xE7] = 1, [0xE8] = 1, [0xE9] = 1, [0xEA] = 1, [0xEB] = 1, + [0xEC] = 1, [0xED] = 1, [0xEE] = 1, [0xEF] = 1, [0xF0] = 1, [0xF1] = 1, + [0xF2] = 1, [0xF3] = 1, [0xF4] = 1, [0xF5] = 1, [0xF6] = 1, [0xF7] = 1, + [0xF8] = 1, [0xF9] = 1, [0xFA] = 1, [0xFB] = 1, [0xFC] = 1, [0xFD] = 1, + [0xFE] = 1, [0xFF] = 1, }; #ifdef __AVX2__ static int contains_bad_header_value_char_avx2(const uint8_t *first, const uint8_t *last) { const __m256i ctll = _mm256_set1_epi8(0x00 - 1); - const __m256i ctlr = _mm256_set1_epi8(0x1f + 1); + const __m256i ctlr = _mm256_set1_epi8(0x1F + 1); const __m256i ht = _mm256_set1_epi8('\t'); - const __m256i del = _mm256_set1_epi8(0x7f); + const __m256i del = _mm256_set1_epi8(0x7F); __m256i s, x; uint32_t m; @@ -809,7 +823,7 @@ int nghttp3_check_header_value(const uint8_t *value, size_t len) { #ifdef __AVX2__ if (len >= 32) { - last32 = value + (len & ~0x1fu); + last32 = value + (len & ~(size_t)0x1FU); if (contains_bad_header_value_char_avx2(value, last32)) { return 0; } diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_http.h b/deps/ngtcp2/nghttp3/lib/nghttp3_http.h index f0bfc69fbade75..2bdf3110027c15 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_http.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_http.h @@ -39,48 +39,48 @@ typedef struct nghttp3_http_state nghttp3_http_state; /* HTTP related flags to enforce HTTP semantics */ /* NGHTTP3_HTTP_FLAG_NONE indicates that no flag is set. */ -#define NGHTTP3_HTTP_FLAG_NONE 0x00u +#define NGHTTP3_HTTP_FLAG_NONE 0x00U /* header field seen so far */ -#define NGHTTP3_HTTP_FLAG__AUTHORITY 0x01u -#define NGHTTP3_HTTP_FLAG__PATH 0x02u -#define NGHTTP3_HTTP_FLAG__METHOD 0x04u -#define NGHTTP3_HTTP_FLAG__SCHEME 0x08u +#define NGHTTP3_HTTP_FLAG__AUTHORITY 0x01U +#define NGHTTP3_HTTP_FLAG__PATH 0x02U +#define NGHTTP3_HTTP_FLAG__METHOD 0x04U +#define NGHTTP3_HTTP_FLAG__SCHEME 0x08U /* host is not pseudo header, but we require either host or :authority */ -#define NGHTTP3_HTTP_FLAG_HOST 0x10u -#define NGHTTP3_HTTP_FLAG__STATUS 0x20u +#define NGHTTP3_HTTP_FLAG_HOST 0x10U +#define NGHTTP3_HTTP_FLAG__STATUS 0x20U /* required header fields for HTTP request except for CONNECT method. */ #define NGHTTP3_HTTP_FLAG_REQ_HEADERS \ (NGHTTP3_HTTP_FLAG__METHOD | NGHTTP3_HTTP_FLAG__PATH | \ NGHTTP3_HTTP_FLAG__SCHEME) -#define NGHTTP3_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED 0x40u +#define NGHTTP3_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED 0x40U /* HTTP method flags */ -#define NGHTTP3_HTTP_FLAG_METH_CONNECT 0x80u -#define NGHTTP3_HTTP_FLAG_METH_HEAD 0x0100u -#define NGHTTP3_HTTP_FLAG_METH_OPTIONS 0x0200u +#define NGHTTP3_HTTP_FLAG_METH_CONNECT 0x80U +#define NGHTTP3_HTTP_FLAG_METH_HEAD 0x0100U +#define NGHTTP3_HTTP_FLAG_METH_OPTIONS 0x0200U #define NGHTTP3_HTTP_FLAG_METH_ALL \ (NGHTTP3_HTTP_FLAG_METH_CONNECT | NGHTTP3_HTTP_FLAG_METH_HEAD | \ NGHTTP3_HTTP_FLAG_METH_OPTIONS) /* :path category */ /* path starts with "/" */ -#define NGHTTP3_HTTP_FLAG_PATH_REGULAR 0x0400u +#define NGHTTP3_HTTP_FLAG_PATH_REGULAR 0x0400U /* path "*" */ -#define NGHTTP3_HTTP_FLAG_PATH_ASTERISK 0x0800u +#define NGHTTP3_HTTP_FLAG_PATH_ASTERISK 0x0800U /* scheme */ /* "http" or "https" scheme */ -#define NGHTTP3_HTTP_FLAG_SCHEME_HTTP 0x1000u +#define NGHTTP3_HTTP_FLAG_SCHEME_HTTP 0x1000U /* set if final response is expected */ -#define NGHTTP3_HTTP_FLAG_EXPECT_FINAL_RESPONSE 0x2000u +#define NGHTTP3_HTTP_FLAG_EXPECT_FINAL_RESPONSE 0x2000U /* NGHTTP3_HTTP_FLAG__PROTOCOL is set when :protocol pseudo header field is seen. */ -#define NGHTTP3_HTTP_FLAG__PROTOCOL 0x4000u +#define NGHTTP3_HTTP_FLAG__PROTOCOL 0x4000U /* NGHTTP3_HTTP_FLAG_PRIORITY is set when priority header field is processed. */ -#define NGHTTP3_HTTP_FLAG_PRIORITY 0x8000u +#define NGHTTP3_HTTP_FLAG_PRIORITY 0x8000U /* NGHTTP3_HTTP_FLAG_BAD_PRIORITY is set when an error is encountered while parsing priority header field. */ -#define NGHTTP3_HTTP_FLAG_BAD_PRIORITY 0x010000u +#define NGHTTP3_HTTP_FLAG_BAD_PRIORITY 0x010000U /* * This function is called when HTTP header field |nv| received for @@ -98,7 +98,7 @@ typedef struct nghttp3_http_state nghttp3_http_state; * Invalid HTTP header field was received but it can be treated as * if it was not received because of compatibility reasons. */ -int nghttp3_http_on_header(nghttp3_http_state *http, nghttp3_qpack_nv *nv, +int nghttp3_http_on_header(nghttp3_http_state *http, const nghttp3_qpack_nv *nv, int request, int trailers, int connect_protocol); /* @@ -131,7 +131,7 @@ int nghttp3_http_on_response_headers(nghttp3_http_state *http); * NGHTTP3_ERR_MALFORMED_HTTP_MESSAGING * HTTP messaging is violated. */ -int nghttp3_http_on_remote_end_stream(nghttp3_stream *stream); +int nghttp3_http_on_remote_end_stream(const nghttp3_stream *stream); /* * This function is called when chunk of data is received. This diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.c b/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.c index fa5d7fdc1c8799..efb4f958a85eb5 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.c @@ -32,7 +32,6 @@ #include "nghttp3_macro.h" #include "nghttp3_mem.h" -#include "nghttp3_range.h" static nghttp3_ksl_blk null_blk; @@ -57,13 +56,12 @@ void nghttp3_ksl_init(nghttp3_ksl *ksl, nghttp3_ksl_compar compar, assert(keylen >= sizeof(uint64_t)); - aligned_keylen = (keylen + 0x7u) & ~0x7u; + aligned_keylen = (keylen + 0x7U) & ~(size_t)0x7U; assert(aligned_keylen <= UINT16_MAX); - nghttp3_objalloc_init(&ksl->blkalloc, - (ksl_blklen(aligned_keylen) + 0xfu) & ~(uintptr_t)0xfu, - mem); + nghttp3_objalloc_init( + &ksl->blkalloc, (ksl_blklen(aligned_keylen) + 0xFU) & ~(size_t)0xFU, mem); ksl->root = NULL; ksl->front = ksl->back = NULL; @@ -817,12 +815,6 @@ int nghttp3_ksl_it_begin(const nghttp3_ksl_it *it) { return it->i == 0 && it->blk->prev == NULL; } -int nghttp3_ksl_range_compar(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs) { - const nghttp3_range *a = lhs, *b = rhs; - return a->begin < b->begin; -} - nghttp3_ksl_search_def(range, nghttp3_ksl_range_compar) size_t nghttp3_ksl_range_search(const nghttp3_ksl *ksl, nghttp3_ksl_blk *blk, @@ -830,13 +822,6 @@ size_t nghttp3_ksl_range_search(const nghttp3_ksl *ksl, nghttp3_ksl_blk *blk, return ksl_range_search(ksl, blk, key); } -int nghttp3_ksl_range_exclusive_compar(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs) { - const nghttp3_range *a = lhs, *b = rhs; - return a->begin < b->begin && !(nghttp3_max_uint64(a->begin, b->begin) < - nghttp3_min_uint64(a->end, b->end)); -} - nghttp3_ksl_search_def(range_exclusive, nghttp3_ksl_range_exclusive_compar) size_t nghttp3_ksl_range_exclusive_search(const nghttp3_ksl *ksl, @@ -845,11 +830,6 @@ size_t nghttp3_ksl_range_exclusive_search(const nghttp3_ksl *ksl, return ksl_range_exclusive_search(ksl, blk, key); } -int nghttp3_ksl_uint64_less(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs) { - return *(uint64_t *)lhs < *(uint64_t *)rhs; -} - nghttp3_ksl_search_def(uint64_less, nghttp3_ksl_uint64_less) size_t nghttp3_ksl_uint64_less_search(const nghttp3_ksl *ksl, @@ -858,11 +838,6 @@ size_t nghttp3_ksl_uint64_less_search(const nghttp3_ksl *ksl, return ksl_uint64_less_search(ksl, blk, key); } -int nghttp3_ksl_int64_greater(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs) { - return *(int64_t *)lhs > *(int64_t *)rhs; -} - nghttp3_ksl_search_def(int64_greater, nghttp3_ksl_int64_greater) size_t nghttp3_ksl_int64_greater_search(const nghttp3_ksl *ksl, diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.h b/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.h index 022cd172a37e67..852e4d471f23d7 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_ksl.h @@ -35,6 +35,7 @@ #include #include "nghttp3_objalloc.h" +#include "nghttp3_range.h" #define NGHTTP3_KSL_DEGR 16 /* NGHTTP3_KSL_MAX_NBLK is the maximum number of nodes which a single @@ -360,8 +361,12 @@ nghttp3_ksl_it_key(const nghttp3_ksl_it *it) { * object, and the function returns nonzero if ((const nghttp3_range * *)lhs)->begin < ((const nghttp3_range *)rhs)->begin. */ -int nghttp3_ksl_range_compar(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs); +static inline int nghttp3_ksl_range_compar(const nghttp3_ksl_key *lhs, + const nghttp3_ksl_key *rhs) { + const nghttp3_range *a = (const nghttp3_range *)lhs, + *b = (const nghttp3_range *)rhs; + return a->begin < b->begin; +} /* * nghttp3_ksl_range_search is an implementation of nghttp3_ksl_search @@ -377,8 +382,14 @@ size_t nghttp3_ksl_range_search(const nghttp3_ksl *ksl, nghttp3_ksl_blk *blk, * *)lhs)->begin < ((const nghttp3_range *)rhs)->begin, and the 2 * ranges do not intersect. */ -int nghttp3_ksl_range_exclusive_compar(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs); +static inline int +nghttp3_ksl_range_exclusive_compar(const nghttp3_ksl_key *lhs, + const nghttp3_ksl_key *rhs) { + const nghttp3_range *a = (const nghttp3_range *)lhs, + *b = (const nghttp3_range *)rhs; + return a->begin < b->begin && + !(nghttp3_max(a->begin, b->begin) < nghttp3_min(a->end, b->end)); +} /* * nghttp3_ksl_range_exclusive_search is an implementation of @@ -393,8 +404,10 @@ size_t nghttp3_ksl_range_exclusive_search(const nghttp3_ksl *ksl, * |lhs| and |rhs| must point to uint64_t objects, and the function * returns nonzero if *(uint64_t *)|lhs| < *(uint64_t *)|rhs|. */ -int nghttp3_ksl_uint64_less(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs); +static inline int nghttp3_ksl_uint64_less(const nghttp3_ksl_key *lhs, + const nghttp3_ksl_key *rhs) { + return *(const uint64_t *)lhs < *(const uint64_t *)rhs; +} /* * nghttp3_ksl_uint64_less_search is an implementation of @@ -410,8 +423,10 @@ size_t nghttp3_ksl_uint64_less_search(const nghttp3_ksl *ksl, * and the function returns nonzero if *(int64_t *)|lhs| > *(int64_t * *)|rhs|. */ -int nghttp3_ksl_int64_greater(const nghttp3_ksl_key *lhs, - const nghttp3_ksl_key *rhs); +static inline int nghttp3_ksl_int64_greater(const nghttp3_ksl_key *lhs, + const nghttp3_ksl_key *rhs) { + return *(const int64_t *)lhs > *(const int64_t *)rhs; +} /* * nghttp3_ksl_int64_greater_search is an implementation of diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_macro.h b/deps/ngtcp2/nghttp3/lib/nghttp3_macro.h index 58a7dfd27570c5..2b03dc53dbb7a0 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_macro.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_macro.h @@ -56,27 +56,81 @@ #define nghttp3_max_def(SUFFIX, T) \ static inline T nghttp3_max_##SUFFIX(T a, T b) { return a < b ? b : a; } -nghttp3_max_def(int8, int8_t) -nghttp3_max_def(int16, int16_t) -nghttp3_max_def(int32, int32_t) -nghttp3_max_def(int64, int64_t) -nghttp3_max_def(uint8, uint8_t) -nghttp3_max_def(uint16, uint16_t) -nghttp3_max_def(uint32, uint32_t) -nghttp3_max_def(uint64, uint64_t) -nghttp3_max_def(size, size_t) +nghttp3_max_def(long_long_int, long long int) +nghttp3_max_def(long_int, long int) +nghttp3_max_def(int, int) +nghttp3_max_def(short_int, short int) +nghttp3_max_def(signed_char, signed char) +nghttp3_max_def(char, char) +nghttp3_max_def(unsigned_long_long_int, unsigned long long int) +nghttp3_max_def(unsigned_long_int, unsigned long int) +nghttp3_max_def(unsigned_int, unsigned int) +nghttp3_max_def(unsigned_short_int, unsigned short int) +nghttp3_max_def(unsigned_char, unsigned char) + +#define nghttp3_max(A, B) \ + _Generic((A), \ + long long int: nghttp3_max_long_long_int, \ + long int: nghttp3_max_long_int, \ + int: _Generic((B), \ + long long int: nghttp3_max_long_long_int, \ + long int: nghttp3_max_long_int, \ + int: nghttp3_max_int, \ + short int: nghttp3_max_short_int, \ + signed char: nghttp3_max_signed_char, \ + char: nghttp3_max_char, \ + unsigned long long int: nghttp3_max_unsigned_long_long_int, \ + unsigned long int: nghttp3_max_unsigned_long_int, \ + unsigned int: nghttp3_max_unsigned_int, \ + unsigned short int: nghttp3_max_unsigned_short_int, \ + unsigned char: nghttp3_max_unsigned_char), \ + short int: nghttp3_max_short_int, \ + signed char: nghttp3_max_signed_char, \ + char: nghttp3_max_char, \ + unsigned long long int: nghttp3_max_unsigned_long_long_int, \ + unsigned long int: nghttp3_max_unsigned_long_int, \ + unsigned int: nghttp3_max_unsigned_int, \ + unsigned short int: nghttp3_max_unsigned_short_int, \ + unsigned char: nghttp3_max_unsigned_char)((A), (B)) #define nghttp3_min_def(SUFFIX, T) \ static inline T nghttp3_min_##SUFFIX(T a, T b) { return a < b ? a : b; } -nghttp3_min_def(int8, int8_t) -nghttp3_min_def(int16, int16_t) -nghttp3_min_def(int32, int32_t) -nghttp3_min_def(int64, int64_t) -nghttp3_min_def(uint8, uint8_t) -nghttp3_min_def(uint16, uint16_t) -nghttp3_min_def(uint32, uint32_t) -nghttp3_min_def(uint64, uint64_t) -nghttp3_min_def(size, size_t) +nghttp3_min_def(long_long_int, long long int) +nghttp3_min_def(long_int, long int) +nghttp3_min_def(int, int) +nghttp3_min_def(short_int, short int) +nghttp3_min_def(signed_char, signed char) +nghttp3_min_def(char, char) +nghttp3_min_def(unsigned_long_long_int, unsigned long long int) +nghttp3_min_def(unsigned_long_int, unsigned long int) +nghttp3_min_def(unsigned_int, unsigned int) +nghttp3_min_def(unsigned_short_int, unsigned short int) +nghttp3_min_def(unsigned_char, unsigned char) + +#define nghttp3_min(A, B) \ + _Generic((A), \ + long long int: nghttp3_min_long_long_int, \ + long int: nghttp3_min_long_int, \ + int: _Generic((B), \ + long long int: nghttp3_min_long_long_int, \ + long int: nghttp3_min_long_int, \ + int: nghttp3_min_int, \ + short int: nghttp3_min_short_int, \ + signed char: nghttp3_min_signed_char, \ + char: nghttp3_min_char, \ + unsigned long long int: nghttp3_min_unsigned_long_long_int, \ + unsigned long int: nghttp3_min_unsigned_long_int, \ + unsigned int: nghttp3_min_unsigned_int, \ + unsigned short int: nghttp3_min_unsigned_short_int, \ + unsigned char: nghttp3_min_unsigned_char), \ + short int: nghttp3_min_short_int, \ + signed char: nghttp3_min_signed_char, \ + char: nghttp3_min_char, \ + unsigned long long int: nghttp3_min_unsigned_long_long_int, \ + unsigned long int: nghttp3_min_unsigned_long_int, \ + unsigned int: nghttp3_min_unsigned_int, \ + unsigned short int: nghttp3_min_unsigned_short_int, \ + unsigned char: nghttp3_min_unsigned_char)((A), (B)) #endif /* !defined(NGHTTP3_MACRO_H) */ diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_map.c b/deps/ngtcp2/nghttp3/lib/nghttp3_map.c index d5b720b148f89a..7858d4cc3eb10b 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_map.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_map.c @@ -78,10 +78,10 @@ int nghttp3_map_each(const nghttp3_map *map, int (*func)(void *data, void *ptr), /* Hasher from https://github.com/rust-lang/rustc-hash/blob/dc5c33f1283de2da64d8d7a06401d91aded03ad4/src/lib.rs to maximize the output's sensitivity to all input bits. */ -#define NGHTTP3_MAP_HASHER 0xf1357aea2e62a9c5ull +#define NGHTTP3_MAP_HASHER 0xF1357AEA2E62A9C5ULL /* 64-bit Fibonacci hashing constant, Golden Ratio constant, to get the high bits with the good distribution. */ -#define NGHTTP3_MAP_FIBO 0x9e3779b97f4a7c15ull +#define NGHTTP3_MAP_FIBO 0x9E3779B97F4A7C15ULL static size_t map_index(const nghttp3_map *map, nghttp3_map_key_type key) { key += map->seed; diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_objalloc.h b/deps/ngtcp2/nghttp3/lib/nghttp3_objalloc.h index 4f8ffa093751a7..b3c17046607218 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_objalloc.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_objalloc.h @@ -70,7 +70,7 @@ void nghttp3_objalloc_clear(nghttp3_objalloc *objalloc); inline static void nghttp3_objalloc_##NAME##_init( \ nghttp3_objalloc *objalloc, size_t nmemb, const nghttp3_mem *mem) { \ nghttp3_objalloc_init( \ - objalloc, ((sizeof(TYPE) + 0xfu) & ~(uintptr_t)0xfu) * nmemb, mem); \ + objalloc, ((sizeof(TYPE) + 0xFU) & ~(size_t)0xFU) * nmemb, mem); \ } \ \ TYPE *nghttp3_objalloc_##NAME##_get(nghttp3_objalloc *objalloc); \ @@ -124,7 +124,7 @@ void nghttp3_objalloc_clear(nghttp3_objalloc *objalloc); inline static void nghttp3_objalloc_##NAME##_init( \ nghttp3_objalloc *objalloc, size_t nmemb, const nghttp3_mem *mem) { \ nghttp3_objalloc_init( \ - objalloc, ((sizeof(TYPE) + 0xfu) & ~(uintptr_t)0xfu) * nmemb, mem); \ + objalloc, ((sizeof(TYPE) + 0xFU) & ~(size_t)0xFU) * nmemb, mem); \ } \ \ inline static TYPE *nghttp3_objalloc_##NAME##_get( \ diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_pq.c b/deps/ngtcp2/nghttp3/lib/nghttp3_pq.c index e35bcac4e43b8f..c5b657bc6d9fb3 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_pq.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_pq.c @@ -76,7 +76,7 @@ int nghttp3_pq_push(nghttp3_pq *pq, nghttp3_pq_entry *item) { void *nq; size_t ncapacity; - ncapacity = nghttp3_max_size(4, pq->capacity * 2); + ncapacity = nghttp3_max(4, pq->capacity * 2); nq = nghttp3_mem_realloc(pq->mem, pq->q, ncapacity * sizeof(nghttp3_pq_entry *)); diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.c b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.c index 30f2cdd719c87c..59b633ea057254 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.c @@ -50,122 +50,122 @@ /* Generated by mkstatichdtbl.py */ static nghttp3_qpack_static_entry token_stable[] = { - MAKE_STATIC_ENT(0, NGHTTP3_QPACK_TOKEN__AUTHORITY, 3153725150u), - MAKE_STATIC_ENT(15, NGHTTP3_QPACK_TOKEN__METHOD, 695666056u), - MAKE_STATIC_ENT(16, NGHTTP3_QPACK_TOKEN__METHOD, 695666056u), - MAKE_STATIC_ENT(17, NGHTTP3_QPACK_TOKEN__METHOD, 695666056u), - MAKE_STATIC_ENT(18, NGHTTP3_QPACK_TOKEN__METHOD, 695666056u), - MAKE_STATIC_ENT(19, NGHTTP3_QPACK_TOKEN__METHOD, 695666056u), - MAKE_STATIC_ENT(20, NGHTTP3_QPACK_TOKEN__METHOD, 695666056u), - MAKE_STATIC_ENT(21, NGHTTP3_QPACK_TOKEN__METHOD, 695666056u), - MAKE_STATIC_ENT(1, NGHTTP3_QPACK_TOKEN__PATH, 3292848686u), - MAKE_STATIC_ENT(22, NGHTTP3_QPACK_TOKEN__SCHEME, 2510477674u), - MAKE_STATIC_ENT(23, NGHTTP3_QPACK_TOKEN__SCHEME, 2510477674u), - MAKE_STATIC_ENT(24, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(25, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(26, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(27, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(28, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(63, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(64, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(65, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(66, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(67, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(68, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(69, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(70, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(71, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983u), - MAKE_STATIC_ENT(29, NGHTTP3_QPACK_TOKEN_ACCEPT, 136609321u), - MAKE_STATIC_ENT(30, NGHTTP3_QPACK_TOKEN_ACCEPT, 136609321u), - MAKE_STATIC_ENT(31, NGHTTP3_QPACK_TOKEN_ACCEPT_ENCODING, 3379649177u), - MAKE_STATIC_ENT(72, NGHTTP3_QPACK_TOKEN_ACCEPT_LANGUAGE, 1979086614u), - MAKE_STATIC_ENT(32, NGHTTP3_QPACK_TOKEN_ACCEPT_RANGES, 1713753958u), + MAKE_STATIC_ENT(0, NGHTTP3_QPACK_TOKEN__AUTHORITY, 3153725150U), + MAKE_STATIC_ENT(15, NGHTTP3_QPACK_TOKEN__METHOD, 695666056U), + MAKE_STATIC_ENT(16, NGHTTP3_QPACK_TOKEN__METHOD, 695666056U), + MAKE_STATIC_ENT(17, NGHTTP3_QPACK_TOKEN__METHOD, 695666056U), + MAKE_STATIC_ENT(18, NGHTTP3_QPACK_TOKEN__METHOD, 695666056U), + MAKE_STATIC_ENT(19, NGHTTP3_QPACK_TOKEN__METHOD, 695666056U), + MAKE_STATIC_ENT(20, NGHTTP3_QPACK_TOKEN__METHOD, 695666056U), + MAKE_STATIC_ENT(21, NGHTTP3_QPACK_TOKEN__METHOD, 695666056U), + MAKE_STATIC_ENT(1, NGHTTP3_QPACK_TOKEN__PATH, 3292848686U), + MAKE_STATIC_ENT(22, NGHTTP3_QPACK_TOKEN__SCHEME, 2510477674U), + MAKE_STATIC_ENT(23, NGHTTP3_QPACK_TOKEN__SCHEME, 2510477674U), + MAKE_STATIC_ENT(24, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(25, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(26, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(27, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(28, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(63, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(64, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(65, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(66, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(67, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(68, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(69, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(70, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(71, NGHTTP3_QPACK_TOKEN__STATUS, 4000288983U), + MAKE_STATIC_ENT(29, NGHTTP3_QPACK_TOKEN_ACCEPT, 136609321U), + MAKE_STATIC_ENT(30, NGHTTP3_QPACK_TOKEN_ACCEPT, 136609321U), + MAKE_STATIC_ENT(31, NGHTTP3_QPACK_TOKEN_ACCEPT_ENCODING, 3379649177U), + MAKE_STATIC_ENT(72, NGHTTP3_QPACK_TOKEN_ACCEPT_LANGUAGE, 1979086614U), + MAKE_STATIC_ENT(32, NGHTTP3_QPACK_TOKEN_ACCEPT_RANGES, 1713753958U), MAKE_STATIC_ENT(73, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_CREDENTIALS, - 901040780u), + 901040780U), MAKE_STATIC_ENT(74, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_CREDENTIALS, - 901040780u), + 901040780U), MAKE_STATIC_ENT(33, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS, - 1524311232u), + 1524311232U), MAKE_STATIC_ENT(34, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS, - 1524311232u), + 1524311232U), MAKE_STATIC_ENT(75, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_HEADERS, - 1524311232u), + 1524311232U), MAKE_STATIC_ENT(76, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_METHODS, - 2175229868u), + 2175229868U), MAKE_STATIC_ENT(77, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_METHODS, - 2175229868u), + 2175229868U), MAKE_STATIC_ENT(78, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_METHODS, - 2175229868u), + 2175229868U), MAKE_STATIC_ENT(35, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_ALLOW_ORIGIN, - 2710797292u), + 2710797292U), MAKE_STATIC_ENT(79, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_EXPOSE_HEADERS, - 2449824425u), + 2449824425U), MAKE_STATIC_ENT(80, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_REQUEST_HEADERS, - 3599549072u), + 3599549072U), MAKE_STATIC_ENT(81, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_REQUEST_METHOD, - 2417078055u), + 2417078055U), MAKE_STATIC_ENT(82, NGHTTP3_QPACK_TOKEN_ACCESS_CONTROL_REQUEST_METHOD, - 2417078055u), - MAKE_STATIC_ENT(2, NGHTTP3_QPACK_TOKEN_AGE, 742476188u), - MAKE_STATIC_ENT(83, NGHTTP3_QPACK_TOKEN_ALT_SVC, 2148877059u), - MAKE_STATIC_ENT(84, NGHTTP3_QPACK_TOKEN_AUTHORIZATION, 2436257726u), - MAKE_STATIC_ENT(36, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669u), - MAKE_STATIC_ENT(37, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669u), - MAKE_STATIC_ENT(38, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669u), - MAKE_STATIC_ENT(39, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669u), - MAKE_STATIC_ENT(40, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669u), - MAKE_STATIC_ENT(41, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669u), - MAKE_STATIC_ENT(3, NGHTTP3_QPACK_TOKEN_CONTENT_DISPOSITION, 3889184348u), - MAKE_STATIC_ENT(42, NGHTTP3_QPACK_TOKEN_CONTENT_ENCODING, 65203592u), - MAKE_STATIC_ENT(43, NGHTTP3_QPACK_TOKEN_CONTENT_ENCODING, 65203592u), - MAKE_STATIC_ENT(4, NGHTTP3_QPACK_TOKEN_CONTENT_LENGTH, 1308181789u), - MAKE_STATIC_ENT(85, NGHTTP3_QPACK_TOKEN_CONTENT_SECURITY_POLICY, 1569039836u), - MAKE_STATIC_ENT(44, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(45, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(46, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(47, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(48, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(49, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(50, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(51, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(52, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(53, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(54, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277u), - MAKE_STATIC_ENT(5, NGHTTP3_QPACK_TOKEN_COOKIE, 2007449791u), - MAKE_STATIC_ENT(6, NGHTTP3_QPACK_TOKEN_DATE, 3564297305u), - MAKE_STATIC_ENT(86, NGHTTP3_QPACK_TOKEN_EARLY_DATA, 4080895051u), - MAKE_STATIC_ENT(7, NGHTTP3_QPACK_TOKEN_ETAG, 113792960u), - MAKE_STATIC_ENT(87, NGHTTP3_QPACK_TOKEN_EXPECT_CT, 1183214960u), - MAKE_STATIC_ENT(88, NGHTTP3_QPACK_TOKEN_FORWARDED, 1485178027u), - MAKE_STATIC_ENT(8, NGHTTP3_QPACK_TOKEN_IF_MODIFIED_SINCE, 2213050793u), - MAKE_STATIC_ENT(9, NGHTTP3_QPACK_TOKEN_IF_NONE_MATCH, 2536202615u), - MAKE_STATIC_ENT(89, NGHTTP3_QPACK_TOKEN_IF_RANGE, 2340978238u), - MAKE_STATIC_ENT(10, NGHTTP3_QPACK_TOKEN_LAST_MODIFIED, 3226950251u), - MAKE_STATIC_ENT(11, NGHTTP3_QPACK_TOKEN_LINK, 232457833u), - MAKE_STATIC_ENT(12, NGHTTP3_QPACK_TOKEN_LOCATION, 200649126u), - MAKE_STATIC_ENT(90, NGHTTP3_QPACK_TOKEN_ORIGIN, 3649018447u), - MAKE_STATIC_ENT(91, NGHTTP3_QPACK_TOKEN_PURPOSE, 4212263681u), - MAKE_STATIC_ENT(55, NGHTTP3_QPACK_TOKEN_RANGE, 4208725202u), - MAKE_STATIC_ENT(13, NGHTTP3_QPACK_TOKEN_REFERER, 3969579366u), - MAKE_STATIC_ENT(92, NGHTTP3_QPACK_TOKEN_SERVER, 1085029842u), - MAKE_STATIC_ENT(14, NGHTTP3_QPACK_TOKEN_SET_COOKIE, 1848371000u), + 2417078055U), + MAKE_STATIC_ENT(2, NGHTTP3_QPACK_TOKEN_AGE, 742476188U), + MAKE_STATIC_ENT(83, NGHTTP3_QPACK_TOKEN_ALT_SVC, 2148877059U), + MAKE_STATIC_ENT(84, NGHTTP3_QPACK_TOKEN_AUTHORIZATION, 2436257726U), + MAKE_STATIC_ENT(36, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669U), + MAKE_STATIC_ENT(37, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669U), + MAKE_STATIC_ENT(38, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669U), + MAKE_STATIC_ENT(39, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669U), + MAKE_STATIC_ENT(40, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669U), + MAKE_STATIC_ENT(41, NGHTTP3_QPACK_TOKEN_CACHE_CONTROL, 1355326669U), + MAKE_STATIC_ENT(3, NGHTTP3_QPACK_TOKEN_CONTENT_DISPOSITION, 3889184348U), + MAKE_STATIC_ENT(42, NGHTTP3_QPACK_TOKEN_CONTENT_ENCODING, 65203592U), + MAKE_STATIC_ENT(43, NGHTTP3_QPACK_TOKEN_CONTENT_ENCODING, 65203592U), + MAKE_STATIC_ENT(4, NGHTTP3_QPACK_TOKEN_CONTENT_LENGTH, 1308181789U), + MAKE_STATIC_ENT(85, NGHTTP3_QPACK_TOKEN_CONTENT_SECURITY_POLICY, 1569039836U), + MAKE_STATIC_ENT(44, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(45, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(46, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(47, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(48, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(49, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(50, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(51, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(52, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(53, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(54, NGHTTP3_QPACK_TOKEN_CONTENT_TYPE, 4244048277U), + MAKE_STATIC_ENT(5, NGHTTP3_QPACK_TOKEN_COOKIE, 2007449791U), + MAKE_STATIC_ENT(6, NGHTTP3_QPACK_TOKEN_DATE, 3564297305U), + MAKE_STATIC_ENT(86, NGHTTP3_QPACK_TOKEN_EARLY_DATA, 4080895051U), + MAKE_STATIC_ENT(7, NGHTTP3_QPACK_TOKEN_ETAG, 113792960U), + MAKE_STATIC_ENT(87, NGHTTP3_QPACK_TOKEN_EXPECT_CT, 1183214960U), + MAKE_STATIC_ENT(88, NGHTTP3_QPACK_TOKEN_FORWARDED, 1485178027U), + MAKE_STATIC_ENT(8, NGHTTP3_QPACK_TOKEN_IF_MODIFIED_SINCE, 2213050793U), + MAKE_STATIC_ENT(9, NGHTTP3_QPACK_TOKEN_IF_NONE_MATCH, 2536202615U), + MAKE_STATIC_ENT(89, NGHTTP3_QPACK_TOKEN_IF_RANGE, 2340978238U), + MAKE_STATIC_ENT(10, NGHTTP3_QPACK_TOKEN_LAST_MODIFIED, 3226950251U), + MAKE_STATIC_ENT(11, NGHTTP3_QPACK_TOKEN_LINK, 232457833U), + MAKE_STATIC_ENT(12, NGHTTP3_QPACK_TOKEN_LOCATION, 200649126U), + MAKE_STATIC_ENT(90, NGHTTP3_QPACK_TOKEN_ORIGIN, 3649018447U), + MAKE_STATIC_ENT(91, NGHTTP3_QPACK_TOKEN_PURPOSE, 4212263681U), + MAKE_STATIC_ENT(55, NGHTTP3_QPACK_TOKEN_RANGE, 4208725202U), + MAKE_STATIC_ENT(13, NGHTTP3_QPACK_TOKEN_REFERER, 3969579366U), + MAKE_STATIC_ENT(92, NGHTTP3_QPACK_TOKEN_SERVER, 1085029842U), + MAKE_STATIC_ENT(14, NGHTTP3_QPACK_TOKEN_SET_COOKIE, 1848371000U), MAKE_STATIC_ENT(56, NGHTTP3_QPACK_TOKEN_STRICT_TRANSPORT_SECURITY, - 4138147361u), + 4138147361U), MAKE_STATIC_ENT(57, NGHTTP3_QPACK_TOKEN_STRICT_TRANSPORT_SECURITY, - 4138147361u), + 4138147361U), MAKE_STATIC_ENT(58, NGHTTP3_QPACK_TOKEN_STRICT_TRANSPORT_SECURITY, - 4138147361u), - MAKE_STATIC_ENT(93, NGHTTP3_QPACK_TOKEN_TIMING_ALLOW_ORIGIN, 2432297564u), + 4138147361U), + MAKE_STATIC_ENT(93, NGHTTP3_QPACK_TOKEN_TIMING_ALLOW_ORIGIN, 2432297564U), MAKE_STATIC_ENT(94, NGHTTP3_QPACK_TOKEN_UPGRADE_INSECURE_REQUESTS, - 2479169413u), - MAKE_STATIC_ENT(95, NGHTTP3_QPACK_TOKEN_USER_AGENT, 606444526u), - MAKE_STATIC_ENT(59, NGHTTP3_QPACK_TOKEN_VARY, 1085005381u), - MAKE_STATIC_ENT(60, NGHTTP3_QPACK_TOKEN_VARY, 1085005381u), - MAKE_STATIC_ENT(61, NGHTTP3_QPACK_TOKEN_X_CONTENT_TYPE_OPTIONS, 3644557769u), - MAKE_STATIC_ENT(96, NGHTTP3_QPACK_TOKEN_X_FORWARDED_FOR, 2914187656u), - MAKE_STATIC_ENT(97, NGHTTP3_QPACK_TOKEN_X_FRAME_OPTIONS, 3993834824u), - MAKE_STATIC_ENT(98, NGHTTP3_QPACK_TOKEN_X_FRAME_OPTIONS, 3993834824u), - MAKE_STATIC_ENT(62, NGHTTP3_QPACK_TOKEN_X_XSS_PROTECTION, 2501058888u), + 2479169413U), + MAKE_STATIC_ENT(95, NGHTTP3_QPACK_TOKEN_USER_AGENT, 606444526U), + MAKE_STATIC_ENT(59, NGHTTP3_QPACK_TOKEN_VARY, 1085005381U), + MAKE_STATIC_ENT(60, NGHTTP3_QPACK_TOKEN_VARY, 1085005381U), + MAKE_STATIC_ENT(61, NGHTTP3_QPACK_TOKEN_X_CONTENT_TYPE_OPTIONS, 3644557769U), + MAKE_STATIC_ENT(96, NGHTTP3_QPACK_TOKEN_X_FORWARDED_FOR, 2914187656U), + MAKE_STATIC_ENT(97, NGHTTP3_QPACK_TOKEN_X_FRAME_OPTIONS, 3993834824U), + MAKE_STATIC_ENT(98, NGHTTP3_QPACK_TOKEN_X_FRAME_OPTIONS, 3993834824U), + MAKE_STATIC_ENT(62, NGHTTP3_QPACK_TOKEN_X_XSS_PROTECTION, 2501058888U), }; /* Make scalar initialization form of nghttp3_qpack_static_entry */ @@ -749,7 +749,7 @@ static int qpack_nv_value_eq(const nghttp3_qpack_nv *a, const nghttp3_nv *b) { } static void qpack_map_init(nghttp3_qpack_map *map) { - memset(map, 0, sizeof(nghttp3_qpack_map)); + *map = (nghttp3_qpack_map){0}; } static void qpack_map_insert(nghttp3_qpack_map *map, nghttp3_qpack_entry *ent) { @@ -940,8 +940,8 @@ void nghttp3_qpack_encoder_free(nghttp3_qpack_encoder *encoder) { void nghttp3_qpack_encoder_set_max_dtable_capacity( nghttp3_qpack_encoder *encoder, size_t max_dtable_capacity) { - max_dtable_capacity = nghttp3_min_size(max_dtable_capacity, - encoder->ctx.hard_max_dtable_capacity); + max_dtable_capacity = + nghttp3_min(max_dtable_capacity, encoder->ctx.hard_max_dtable_capacity); if (encoder->ctx.max_dtable_capacity == max_dtable_capacity) { return; @@ -966,7 +966,8 @@ void nghttp3_qpack_encoder_set_indexing_strat( encoder->indexing_strat = strat; } -uint64_t nghttp3_qpack_encoder_get_min_cnt(nghttp3_qpack_encoder *encoder) { +uint64_t +nghttp3_qpack_encoder_get_min_cnt(const nghttp3_qpack_encoder *encoder) { assert(!nghttp3_pq_empty(&encoder->min_cnts)); return nghttp3_struct_of(nghttp3_pq_top(&encoder->min_cnts), @@ -1111,15 +1112,15 @@ static int reserve_buf(nghttp3_buf *buf, size_t extra_size, return 0; } - n = nghttp3_max_size(n, nghttp3_buf_cap(buf) + extra_size - left); + n = nghttp3_max(n, nghttp3_buf_cap(buf) + extra_size - left); /* Check whether we are requesting too much memory */ - if (n > (1u << 31)) { + if (n > (1U << 31)) { return NGHTTP3_ERR_NOMEM; } #ifndef WIN32 - n = 1u << (32 - __builtin_clz((uint32_t)n - 1)); + n = 1U << (32 - __builtin_clz((uint32_t)n - 1)); #else /* defined(WIN32) */ /* Round up to the next highest power of 2 from Bit Twiddling Hacks */ @@ -1271,23 +1272,23 @@ int nghttp3_qpack_encoder_process_dtable_update(nghttp3_qpack_encoder *encoder, int nghttp3_qpack_encoder_write_set_dtable_cap(nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, size_t cap) { DEBUGF("qpack::encode: Set Dynamic Table Capacity capacity=%zu\n", cap); - return qpack_write_number(ebuf, 0x20, cap, 5, encoder->ctx.mem); + return qpack_write_number(ebuf, 0x20U, cap, 5, encoder->ctx.mem); } nghttp3_qpack_stream * -nghttp3_qpack_encoder_find_stream(nghttp3_qpack_encoder *encoder, +nghttp3_qpack_encoder_find_stream(const nghttp3_qpack_encoder *encoder, int64_t stream_id) { return nghttp3_map_find(&encoder->streams, (nghttp3_map_key_type)stream_id); } -int nghttp3_qpack_encoder_stream_is_blocked(nghttp3_qpack_encoder *encoder, - nghttp3_qpack_stream *stream) { +int nghttp3_qpack_encoder_stream_is_blocked( + const nghttp3_qpack_encoder *encoder, const nghttp3_qpack_stream *stream) { return stream && encoder->krcnt < nghttp3_qpack_stream_get_max_cnt(stream); } static uint32_t qpack_hash_name(const nghttp3_nv *nv) { /* 32 bit FNV-1a: http://isthe.com/chongo/tech/comp/fnv/ */ - uint32_t h = 2166136261u; + uint32_t h = 2166136261U; size_t i; for (i = 0; i < nv->namelen; ++i) { @@ -1304,7 +1305,7 @@ static uint32_t qpack_hash_name(const nghttp3_nv *nv) { * name. */ static nghttp3_qpack_indexing_mode -qpack_encoder_decide_indexing_mode(nghttp3_qpack_encoder *encoder, +qpack_encoder_decide_indexing_mode(const nghttp3_qpack_encoder *encoder, const nghttp3_nv *nv, int32_t token) { if (nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) { return NGHTTP3_QPACK_INDEXING_MODE_NEVER; @@ -1391,7 +1392,7 @@ static int qpack_encoder_can_index(nghttp3_qpack_encoder *encoder, size_t need, if (!nghttp3_pq_empty(&encoder->min_cnts)) { gmin_cnt = nghttp3_qpack_encoder_get_min_cnt(encoder); - min_cnt = nghttp3_min_uint64(min_cnt, gmin_cnt); + min_cnt = nghttp3_min(min_cnt, gmin_cnt); } if (min_cnt == UINT64_MAX) { @@ -1445,7 +1446,7 @@ static int qpack_encoder_can_index_duplicate(nghttp3_qpack_encoder *encoder, static int qpack_context_check_draining(nghttp3_qpack_context *ctx, uint64_t absidx) { const size_t safe = ctx->max_dtable_capacity - - nghttp3_min_size(512, ctx->max_dtable_capacity * 1 / 8); + nghttp3_min(512, ctx->max_dtable_capacity * 1 / 8); nghttp3_qpack_entry *ent = nghttp3_qpack_context_dtable_get(ctx, absidx); return ctx->dtable_sum - ent->sum > safe; @@ -1490,16 +1491,16 @@ int nghttp3_qpack_encoder_encode_nv(nghttp3_qpack_encoder *encoder, } else { switch (token) { case NGHTTP3_QPACK_TOKEN_HOST: - hash = 2952701295u; + hash = 2952701295U; break; case NGHTTP3_QPACK_TOKEN_TE: - hash = 1011170994u; + hash = 1011170994U; break; case NGHTTP3_QPACK_TOKEN__PROTOCOL: - hash = 1128642621u; + hash = 1128642621U; break; case NGHTTP3_QPACK_TOKEN_PRIORITY: - hash = 2498028297u; + hash = 2498028297U; break; default: hash = qpack_hash_name(nv); @@ -1532,8 +1533,8 @@ int nghttp3_qpack_encoder_encode_nv(nghttp3_qpack_encoder *encoder, new_ent = nghttp3_qpack_context_dtable_top(&encoder->ctx); dres.index = (nghttp3_ssize)new_ent->absidx; } - *pmax_cnt = nghttp3_max_uint64(*pmax_cnt, (uint64_t)(dres.index + 1)); - *pmin_cnt = nghttp3_min_uint64(*pmin_cnt, (uint64_t)(dres.index + 1)); + *pmax_cnt = nghttp3_max(*pmax_cnt, (uint64_t)(dres.index + 1)); + *pmin_cnt = nghttp3_min(*pmin_cnt, (uint64_t)(dres.index + 1)); return nghttp3_qpack_encoder_write_dynamic_indexed( encoder, rbuf, (size_t)dres.index, base); @@ -1553,8 +1554,8 @@ int nghttp3_qpack_encoder_encode_nv(nghttp3_qpack_encoder *encoder, } if (allow_blocking) { new_ent = nghttp3_qpack_context_dtable_top(&encoder->ctx); - *pmax_cnt = nghttp3_max_uint64(*pmax_cnt, new_ent->absidx + 1); - *pmin_cnt = nghttp3_min_uint64(*pmin_cnt, new_ent->absidx + 1); + *pmax_cnt = nghttp3_max(*pmax_cnt, new_ent->absidx + 1); + *pmin_cnt = nghttp3_min(*pmin_cnt, new_ent->absidx + 1); return nghttp3_qpack_encoder_write_dynamic_indexed( encoder, rbuf, new_ent->absidx, base); @@ -1569,9 +1570,8 @@ int nghttp3_qpack_encoder_encode_nv(nghttp3_qpack_encoder *encoder, if (just_index && qpack_encoder_can_index_nv( encoder, nv, - allow_blocking - ? *pmin_cnt - : nghttp3_min_uint64((uint64_t)dres.index + 1, *pmin_cnt))) { + allow_blocking ? *pmin_cnt + : nghttp3_min((uint64_t)dres.index + 1, *pmin_cnt))) { rv = nghttp3_qpack_encoder_write_dynamic_insert(encoder, ebuf, (size_t)dres.index, nv); if (rv != 0) { @@ -1579,7 +1579,7 @@ int nghttp3_qpack_encoder_encode_nv(nghttp3_qpack_encoder *encoder, } if (!allow_blocking) { - *pmin_cnt = nghttp3_min_uint64(*pmin_cnt, (uint64_t)dres.index + 1); + *pmin_cnt = nghttp3_min(*pmin_cnt, (uint64_t)dres.index + 1); } rv = nghttp3_qpack_encoder_dtable_dynamic_add(encoder, (size_t)dres.index, @@ -1590,16 +1590,16 @@ int nghttp3_qpack_encoder_encode_nv(nghttp3_qpack_encoder *encoder, if (allow_blocking) { new_ent = nghttp3_qpack_context_dtable_top(&encoder->ctx); - *pmax_cnt = nghttp3_max_uint64(*pmax_cnt, new_ent->absidx + 1); - *pmin_cnt = nghttp3_min_uint64(*pmin_cnt, new_ent->absidx + 1); + *pmax_cnt = nghttp3_max(*pmax_cnt, new_ent->absidx + 1); + *pmin_cnt = nghttp3_min(*pmin_cnt, new_ent->absidx + 1); return nghttp3_qpack_encoder_write_dynamic_indexed( encoder, rbuf, new_ent->absidx, base); } } - *pmax_cnt = nghttp3_max_uint64(*pmax_cnt, (uint64_t)(dres.index + 1)); - *pmin_cnt = nghttp3_min_uint64(*pmin_cnt, (uint64_t)(dres.index + 1)); + *pmax_cnt = nghttp3_max(*pmax_cnt, (uint64_t)(dres.index + 1)); + *pmin_cnt = nghttp3_min(*pmin_cnt, (uint64_t)(dres.index + 1)); return nghttp3_qpack_encoder_write_dynamic_indexed_name( encoder, rbuf, (size_t)dres.index, base, nv); @@ -1616,8 +1616,8 @@ int nghttp3_qpack_encoder_encode_nv(nghttp3_qpack_encoder *encoder, } if (allow_blocking) { new_ent = nghttp3_qpack_context_dtable_top(&encoder->ctx); - *pmax_cnt = nghttp3_max_uint64(*pmax_cnt, new_ent->absidx + 1); - *pmin_cnt = nghttp3_min_uint64(*pmin_cnt, new_ent->absidx + 1); + *pmax_cnt = nghttp3_max(*pmax_cnt, new_ent->absidx + 1); + *pmin_cnt = nghttp3_min(*pmin_cnt, new_ent->absidx + 1); return nghttp3_qpack_encoder_write_dynamic_indexed(encoder, rbuf, new_ent->absidx, base); @@ -1782,8 +1782,7 @@ int nghttp3_qpack_stream_add_ref(nghttp3_qpack_stream *stream, if (nghttp3_ringbuf_full(&stream->refs)) { rv = nghttp3_ringbuf_reserve( - &stream->refs, - nghttp3_max_size(4, nghttp3_ringbuf_len(&stream->refs) * 2)); + &stream->refs, nghttp3_max(4, nghttp3_ringbuf_len(&stream->refs) * 2)); if (rv != 0) { return rv; } @@ -1815,28 +1814,26 @@ void nghttp3_qpack_stream_pop_ref(nghttp3_qpack_stream *stream) { nghttp3_ringbuf_pop_front(&stream->refs); } -int nghttp3_qpack_encoder_write_static_indexed(nghttp3_qpack_encoder *encoder, - nghttp3_buf *rbuf, - uint64_t absidx) { +int nghttp3_qpack_encoder_write_static_indexed( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx) { DEBUGF("qpack::encode: Indexed Field Line (static) absidx=%" PRIu64 "\n", absidx); - return qpack_write_number(rbuf, 0xc0, absidx, 6, encoder->ctx.mem); + return qpack_write_number(rbuf, 0xC0U, absidx, 6, encoder->ctx.mem); } -int nghttp3_qpack_encoder_write_dynamic_indexed(nghttp3_qpack_encoder *encoder, - nghttp3_buf *rbuf, - uint64_t absidx, - uint64_t base) { +int nghttp3_qpack_encoder_write_dynamic_indexed( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, + uint64_t base) { DEBUGF("qpack::encode: Indexed Field Line (dynamic) absidx=%" PRIu64 " base=%" PRIu64 "\n", absidx, base); if (absidx < base) { - return qpack_write_number(rbuf, 0x80, base - absidx - 1, 6, + return qpack_write_number(rbuf, 0x80U, base - absidx - 1, 6, encoder->ctx.mem); } - return qpack_write_number(rbuf, 0x10, absidx - base, 4, encoder->ctx.mem); + return qpack_write_number(rbuf, 0x10U, absidx - base, 4, encoder->ctx.mem); } /* @@ -1851,10 +1848,10 @@ int nghttp3_qpack_encoder_write_dynamic_indexed(nghttp3_qpack_encoder *encoder, * NGHTTP3_ERR_NOMEM * Out of memory. */ -static int qpack_encoder_write_indexed_name(nghttp3_qpack_encoder *encoder, - nghttp3_buf *buf, uint8_t fb, - uint64_t nameidx, size_t prefix, - const nghttp3_nv *nv) { +static int +qpack_encoder_write_indexed_name(const nghttp3_qpack_encoder *encoder, + nghttp3_buf *buf, uint8_t fb, uint64_t nameidx, + size_t prefix, const nghttp3_nv *nv) { int rv; size_t len = nghttp3_qpack_put_varint_len(nameidx, prefix); uint8_t *p; @@ -1880,7 +1877,7 @@ static int qpack_encoder_write_indexed_name(nghttp3_qpack_encoder *encoder, p = nghttp3_qpack_put_varint(p, nameidx, prefix); if (h) { - *p = 0x80; + *p = 0x80U; p = nghttp3_qpack_put_varint(p, hlen, 7); p = nghttp3_qpack_huffman_encode(p, nv->value, nv->valuelen); } else { @@ -1899,10 +1896,11 @@ static int qpack_encoder_write_indexed_name(nghttp3_qpack_encoder *encoder, } int nghttp3_qpack_encoder_write_static_indexed_name( - nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, const nghttp3_nv *nv) { uint8_t fb = - (uint8_t)(0x50 | ((nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x20 : 0)); + (uint8_t)(0x50U | + ((nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x20U : 0x00U)); DEBUGF("qpack::encode: Literal Field Line With Name Reference (static) " "absidx=%" PRIu64 " never=%d\n", @@ -1911,7 +1909,7 @@ int nghttp3_qpack_encoder_write_static_indexed_name( } int nghttp3_qpack_encoder_write_dynamic_indexed_name( - nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, uint64_t base, const nghttp3_nv *nv) { uint8_t fb; @@ -1920,13 +1918,13 @@ int nghttp3_qpack_encoder_write_dynamic_indexed_name( absidx, base, (nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) != 0); if (absidx < base) { - fb = - (uint8_t)(0x40 | ((nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x20 : 0)); + fb = (uint8_t)(0x40U | + ((nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x20U : 0x00U)); return qpack_encoder_write_indexed_name(encoder, rbuf, fb, base - absidx - 1, 4, nv); } - fb = (nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x08 : 0; + fb = (nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x08U : 0x0U; return qpack_encoder_write_indexed_name(encoder, rbuf, fb, absidx - base, 3, nv); } @@ -1943,7 +1941,7 @@ int nghttp3_qpack_encoder_write_dynamic_indexed_name( * NGHTTP3_ERR_NOMEM * Out of memory. */ -static int qpack_encoder_write_literal(nghttp3_qpack_encoder *encoder, +static int qpack_encoder_write_literal(const nghttp3_qpack_encoder *encoder, nghttp3_buf *buf, uint8_t fb, size_t prefix, const nghttp3_nv *nv) { int rv; @@ -1990,7 +1988,7 @@ static int qpack_encoder_write_literal(nghttp3_qpack_encoder *encoder, *p = 0; if (vh) { - *p |= 0x80; + *p |= 0x80U; p = nghttp3_qpack_put_varint(p, vhlen, 7); p = nghttp3_qpack_huffman_encode(p, nv->value, nv->valuelen); } else { @@ -2007,40 +2005,38 @@ static int qpack_encoder_write_literal(nghttp3_qpack_encoder *encoder, return 0; } -int nghttp3_qpack_encoder_write_literal(nghttp3_qpack_encoder *encoder, +int nghttp3_qpack_encoder_write_literal(const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, const nghttp3_nv *nv) { uint8_t fb = - (uint8_t)(0x20 | ((nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x10 : 0)); + (uint8_t)(0x20U | + ((nv->flags & NGHTTP3_NV_FLAG_NEVER_INDEX) ? 0x10U : 0x0U)); DEBUGF("qpack::encode: Literal Field Line With Literal Name\n"); return qpack_encoder_write_literal(encoder, rbuf, fb, 3, nv); } -int nghttp3_qpack_encoder_write_static_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - uint64_t absidx, - const nghttp3_nv *nv) { +int nghttp3_qpack_encoder_write_static_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, uint64_t absidx, + const nghttp3_nv *nv) { DEBUGF("qpack::encode: Insert With Name Reference (static) absidx=%" PRIu64 "\n", absidx); - return qpack_encoder_write_indexed_name(encoder, ebuf, 0xc0, absidx, 6, nv); + return qpack_encoder_write_indexed_name(encoder, ebuf, 0xC0U, absidx, 6, nv); } -int nghttp3_qpack_encoder_write_dynamic_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - uint64_t absidx, - const nghttp3_nv *nv) { +int nghttp3_qpack_encoder_write_dynamic_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, uint64_t absidx, + const nghttp3_nv *nv) { DEBUGF("qpack::encode: Insert With Name Reference (dynamic) absidx=%" PRIu64 "\n", absidx); return qpack_encoder_write_indexed_name( - encoder, ebuf, 0x80, encoder->ctx.next_absidx - absidx - 1, 6, nv); + encoder, ebuf, 0x80U, encoder->ctx.next_absidx - absidx - 1, 6, nv); } -int nghttp3_qpack_encoder_write_duplicate_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - uint64_t absidx) { +int nghttp3_qpack_encoder_write_duplicate_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, uint64_t absidx) { uint64_t idx = encoder->ctx.next_absidx - absidx - 1; size_t len = nghttp3_qpack_put_varint_len(idx, 5); uint8_t *p; @@ -2065,11 +2061,11 @@ int nghttp3_qpack_encoder_write_duplicate_insert(nghttp3_qpack_encoder *encoder, return 0; } -int nghttp3_qpack_encoder_write_literal_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - const nghttp3_nv *nv) { +int nghttp3_qpack_encoder_write_literal_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, + const nghttp3_nv *nv) { DEBUGF("qpack::encode: Insert With Literal Name\n"); - return qpack_encoder_write_literal(encoder, ebuf, 0x40, 5, nv); + return qpack_encoder_write_literal(encoder, ebuf, 0x40U, 5, nv); } int nghttp3_qpack_context_dtable_add(nghttp3_qpack_context *ctx, @@ -2112,8 +2108,7 @@ int nghttp3_qpack_context_dtable_add(nghttp3_qpack_context *ctx, if (nghttp3_ringbuf_full(&ctx->dtable)) { rv = nghttp3_ringbuf_reserve( - &ctx->dtable, - nghttp3_max_size(128, nghttp3_ringbuf_len(&ctx->dtable) * 2)); + &ctx->dtable, nghttp3_max(128, nghttp3_ringbuf_len(&ctx->dtable) * 2)); if (rv != 0) { goto fail; } @@ -2418,11 +2413,16 @@ void nghttp3_qpack_encoder_cancel_stream(nghttp3_qpack_encoder *encoder, size_t nghttp3_qpack_encoder_get_num_blocked_streams(nghttp3_qpack_encoder *encoder) { + return nghttp3_qpack_encoder_get_num_blocked_streams2(encoder); +} + +size_t nghttp3_qpack_encoder_get_num_blocked_streams2( + const nghttp3_qpack_encoder *encoder) { return nghttp3_ksl_len(&encoder->blocked_streams); } int nghttp3_qpack_encoder_write_field_section_prefix( - nghttp3_qpack_encoder *encoder, nghttp3_buf *pbuf, uint64_t ricnt, + const nghttp3_qpack_encoder *encoder, nghttp3_buf *pbuf, uint64_t ricnt, uint64_t base) { size_t max_ents = encoder->ctx.hard_max_dtable_capacity / NGHTTP3_QPACK_ENTRY_OVERHEAD; @@ -2446,7 +2446,7 @@ int nghttp3_qpack_encoder_write_field_section_prefix( p = nghttp3_qpack_put_varint(p, encricnt, 8); if (sign) { - *p = 0x80; + *p = 0x80U; } else { *p = 0; } @@ -2507,7 +2507,7 @@ static nghttp3_ssize qpack_read_varint(int *fin, } for (; p != end; ++p, shift += 7) { - add = (*p) & 0x7f; + add = (*p) & 0x7FU; if (shift > 62) { return NGHTTP3_ERR_QPACK_FATAL; @@ -2568,15 +2568,15 @@ nghttp3_ssize nghttp3_qpack_encoder_read_decoder(nghttp3_qpack_encoder *encoder, for (; p != end;) { switch (encoder->state) { case NGHTTP3_QPACK_DS_STATE_OPCODE: - switch ((*p) & 0xc0) { - case 0x80: - case 0xc0: + switch ((*p) & 0xC0U) { + case 0x80U: + case 0xC0U: DEBUGF("qpack::encode: OPCODE_SECTION_ACK\n"); encoder->opcode = NGHTTP3_QPACK_DS_OPCODE_SECTION_ACK; encoder->rstate.prefix = 7; break; - case 0x40: + case 0x40U: DEBUGF("qpack::encode: OPCODE_STREAM_CANCEL\n"); encoder->opcode = NGHTTP3_QPACK_DS_OPCODE_STREAM_CANCEL; encoder->rstate.prefix = 6; @@ -2673,7 +2673,7 @@ uint8_t *nghttp3_qpack_put_varint(uint8_t *buf, uint64_t n, size_t prefix) { n -= k; for (; n >= 128; n >>= 7) { - *buf++ = (uint8_t)((1 << 7) | (n & 0x7f)); + *buf++ = (uint8_t)(0x80U | (n & 0x7FU)); } *buf++ = (uint8_t)n; @@ -2766,7 +2766,7 @@ static nghttp3_ssize qpack_read_string(nghttp3_qpack_read_state *rstate, nghttp3_buf *dest, const uint8_t *begin, const uint8_t *end) { size_t len = (size_t)(end - begin); - size_t n = (size_t)nghttp3_min_uint64((uint64_t)len, rstate->left); + size_t n = (size_t)nghttp3_min((uint64_t)len, rstate->left); dest->last = nghttp3_cpymem(dest->last, begin, n); @@ -2783,8 +2783,9 @@ static nghttp3_ssize qpack_read_string(nghttp3_qpack_read_state *rstate, * NGHTTP3_ERR_QPACK_FATAL * rstate->absidx is invalid. */ -static int qpack_decoder_validate_index(nghttp3_qpack_decoder *decoder, - nghttp3_qpack_read_state *rstate) { +static int +qpack_decoder_validate_index(const nghttp3_qpack_decoder *decoder, + const nghttp3_qpack_read_state *rstate) { if (rstate->dynamic) { return rstate->absidx < decoder->ctx.next_absidx && decoder->ctx.next_absidx - rstate->absidx - 1 < @@ -2840,20 +2841,20 @@ nghttp3_ssize nghttp3_qpack_decoder_read_encoder(nghttp3_qpack_decoder *decoder, busy = 0; switch (decoder->state) { case NGHTTP3_QPACK_ES_STATE_OPCODE: - switch ((*p) & 0xe0) { - case 0x80: - case 0xa0: - case 0xc0: - case 0xe0: + switch ((*p) & 0xE0U) { + case 0x80U: + case 0xA0U: + case 0xC0U: + case 0xE0U: DEBUGF("qpack::decode: OPCODE_INSERT_INDEXED\n"); decoder->opcode = NGHTTP3_QPACK_ES_OPCODE_INSERT_INDEXED; - decoder->rstate.dynamic = !((*p) & 0x40); + decoder->rstate.dynamic = !((*p) & 0x40U); decoder->rstate.prefix = 6; decoder->state = NGHTTP3_QPACK_ES_STATE_READ_INDEX; break; - case 0x40: - case 0x60: + case 0x40U: + case 0x60U: DEBUGF("qpack::decode: OPCODE_INSERT\n"); decoder->opcode = NGHTTP3_QPACK_ES_OPCODE_INSERT; decoder->rstate.dynamic = 0; @@ -2861,7 +2862,7 @@ nghttp3_ssize nghttp3_qpack_decoder_read_encoder(nghttp3_qpack_decoder *decoder, decoder->state = NGHTTP3_QPACK_ES_STATE_CHECK_NAME_HUFFMAN; break; - case 0x20: + case 0x20U: DEBUGF("qpack::decode: OPCODE_SET_DTABLE_TABLE_CAP\n"); decoder->opcode = NGHTTP3_QPACK_ES_OPCODE_SET_DTABLE_CAP; decoder->rstate.prefix = 5; @@ -2960,7 +2961,10 @@ nghttp3_ssize nghttp3_qpack_decoder_read_encoder(nghttp3_qpack_decoder *decoder, decoder->state = NGHTTP3_QPACK_ES_STATE_READ_NAME_HUFFMAN; nghttp3_qpack_huffman_decode_context_init(&decoder->rstate.huffman_ctx); rv = nghttp3_rcbuf_new(&decoder->rstate.name, - (size_t)decoder->rstate.left * 2 + 1, mem); + nghttp3_qpack_huffman_estimate_decode_length( + (size_t)decoder->rstate.left) + + 1, + mem); } else { decoder->state = NGHTTP3_QPACK_ES_STATE_READ_NAME; rv = nghttp3_rcbuf_new(&decoder->rstate.name, @@ -3042,7 +3046,10 @@ nghttp3_ssize nghttp3_qpack_decoder_read_encoder(nghttp3_qpack_decoder *decoder, decoder->state = NGHTTP3_QPACK_ES_STATE_READ_VALUE_HUFFMAN; nghttp3_qpack_huffman_decode_context_init(&decoder->rstate.huffman_ctx); rv = nghttp3_rcbuf_new(&decoder->rstate.value, - (size_t)decoder->rstate.left * 2 + 1, mem); + nghttp3_qpack_huffman_estimate_decode_length( + (size_t)decoder->rstate.left) + + 1, + mem); } else { decoder->state = NGHTTP3_QPACK_ES_STATE_READ_VALUE; rv = nghttp3_rcbuf_new(&decoder->rstate.value, @@ -3288,7 +3295,7 @@ int nghttp3_qpack_decoder_dtable_literal_add(nghttp3_qpack_decoder *decoder) { void nghttp3_qpack_decoder_set_max_concurrent_streams( nghttp3_qpack_decoder *decoder, size_t max_concurrent_streams) { decoder->max_concurrent_streams = - nghttp3_max_size(decoder->max_concurrent_streams, max_concurrent_streams); + nghttp3_max(decoder->max_concurrent_streams, max_concurrent_streams); } void nghttp3_qpack_stream_context_init(nghttp3_qpack_stream_context *sctx, @@ -3316,6 +3323,11 @@ void nghttp3_qpack_stream_context_reset(nghttp3_qpack_stream_context *sctx) { uint64_t nghttp3_qpack_stream_context_get_ricnt(nghttp3_qpack_stream_context *sctx) { + return nghttp3_qpack_stream_context_get_ricnt2(sctx); +} + +uint64_t nghttp3_qpack_stream_context_get_ricnt2( + const nghttp3_qpack_stream_context *sctx) { return sctx->ricnt; } @@ -3363,7 +3375,7 @@ nghttp3_qpack_decoder_read_request(nghttp3_qpack_decoder *decoder, sctx->state = NGHTTP3_QPACK_RS_STATE_DBASE_SIGN; break; case NGHTTP3_QPACK_RS_STATE_DBASE_SIGN: - if ((*p) & 0x80) { + if ((*p) & 0x80U) { sctx->dbase_sign = 1; } sctx->state = NGHTTP3_QPACK_RS_STATE_DBASE; @@ -3413,45 +3425,45 @@ nghttp3_qpack_decoder_read_request(nghttp3_qpack_decoder *decoder, case NGHTTP3_QPACK_RS_STATE_OPCODE: assert(sctx->rstate.left == 0); assert(sctx->rstate.shift == 0); - switch ((*p) & 0xf0) { - case 0x80: - case 0x90: - case 0xa0: - case 0xb0: - case 0xc0: - case 0xd0: - case 0xe0: - case 0xf0: + switch ((*p) & 0xF0U) { + case 0x80U: + case 0x90U: + case 0xA0U: + case 0xB0U: + case 0xC0U: + case 0xD0U: + case 0xE0U: + case 0xF0U: DEBUGF("qpack::decode: OPCODE_INDEXED\n"); sctx->opcode = NGHTTP3_QPACK_RS_OPCODE_INDEXED; - sctx->rstate.dynamic = !((*p) & 0x40); + sctx->rstate.dynamic = !((*p) & 0x40U); sctx->rstate.prefix = 6; sctx->state = NGHTTP3_QPACK_RS_STATE_READ_INDEX; break; - case 0x40: - case 0x50: - case 0x60: - case 0x70: + case 0x40U: + case 0x50U: + case 0x60U: + case 0x70U: DEBUGF("qpack::decode: OPCODE_INDEXED_NAME\n"); sctx->opcode = NGHTTP3_QPACK_RS_OPCODE_INDEXED_NAME; - sctx->rstate.never = (*p) & 0x20; - sctx->rstate.dynamic = !((*p) & 0x10); + sctx->rstate.never = (*p) & 0x20U; + sctx->rstate.dynamic = !((*p) & 0x10U); sctx->rstate.prefix = 4; sctx->state = NGHTTP3_QPACK_RS_STATE_READ_INDEX; break; - case 0x20: - case 0x30: + case 0x20U: + case 0x30U: DEBUGF("qpack::decode: OPCODE_LITERAL\n"); sctx->opcode = NGHTTP3_QPACK_RS_OPCODE_LITERAL; - sctx->rstate.never = (*p) & 0x10; + sctx->rstate.never = (*p) & 0x10U; sctx->rstate.dynamic = 0; sctx->rstate.prefix = 3; sctx->state = NGHTTP3_QPACK_RS_STATE_CHECK_NAME_HUFFMAN; break; - case 0x10: + case 0x10U: DEBUGF("qpack::decode: OPCODE_INDEXED_PB\n"); sctx->opcode = NGHTTP3_QPACK_RS_OPCODE_INDEXED_PB; sctx->rstate.dynamic = 1; @@ -3462,7 +3474,7 @@ nghttp3_qpack_decoder_read_request(nghttp3_qpack_decoder *decoder, default: DEBUGF("qpack::decode: OPCODE_INDEXED_NAME_PB\n"); sctx->opcode = NGHTTP3_QPACK_RS_OPCODE_INDEXED_NAME_PB; - sctx->rstate.never = (*p) & 0x08; + sctx->rstate.never = (*p) & 0x08U; sctx->rstate.dynamic = 1; sctx->rstate.prefix = 3; sctx->state = NGHTTP3_QPACK_RS_STATE_READ_INDEX; @@ -3556,7 +3568,10 @@ nghttp3_qpack_decoder_read_request(nghttp3_qpack_decoder *decoder, sctx->state = NGHTTP3_QPACK_RS_STATE_READ_NAME_HUFFMAN; nghttp3_qpack_huffman_decode_context_init(&sctx->rstate.huffman_ctx); rv = nghttp3_rcbuf_new(&sctx->rstate.name, - (size_t)sctx->rstate.left * 2 + 1, mem); + nghttp3_qpack_huffman_estimate_decode_length( + (size_t)sctx->rstate.left) + + 1, + mem); } else { sctx->state = NGHTTP3_QPACK_RS_STATE_READ_NAME; rv = nghttp3_rcbuf_new(&sctx->rstate.name, @@ -3636,7 +3651,10 @@ nghttp3_qpack_decoder_read_request(nghttp3_qpack_decoder *decoder, sctx->state = NGHTTP3_QPACK_RS_STATE_READ_VALUE_HUFFMAN; nghttp3_qpack_huffman_decode_context_init(&sctx->rstate.huffman_ctx); rv = nghttp3_rcbuf_new(&sctx->rstate.value, - (size_t)sctx->rstate.left * 2 + 1, mem); + nghttp3_qpack_huffman_estimate_decode_length( + (size_t)sctx->rstate.left) + + 1, + mem); } else { sctx->state = NGHTTP3_QPACK_RS_STATE_READ_VALUE; rv = nghttp3_rcbuf_new(&sctx->rstate.value, @@ -3766,8 +3784,8 @@ nghttp3_qpack_decoder_read_request(nghttp3_qpack_decoder *decoder, return rv; } -static int qpack_decoder_dbuf_overflow(nghttp3_qpack_decoder *decoder) { - size_t limit = nghttp3_max_size(decoder->max_concurrent_streams, 100); +static int qpack_decoder_dbuf_overflow(const nghttp3_qpack_decoder *decoder) { + size_t limit = nghttp3_max(decoder->max_concurrent_streams, 100); /* 10 = nghttp3_qpack_put_varint_len((1ULL << 62) - 1, 2)) */ return nghttp3_buf_len(&decoder->dbuf) > limit * 2 * 10; } @@ -3790,7 +3808,7 @@ int nghttp3_qpack_decoder_write_section_ack( } p = dbuf->last; - *p = 0x80; + *p = 0x80U; dbuf->last = nghttp3_qpack_put_varint(p, (uint64_t)sctx->stream_id, 7); if (decoder->written_icnt < sctx->ricnt) { @@ -3802,6 +3820,11 @@ int nghttp3_qpack_decoder_write_section_ack( size_t nghttp3_qpack_decoder_get_decoder_streamlen(nghttp3_qpack_decoder *decoder) { + return nghttp3_qpack_decoder_get_decoder_streamlen2(decoder); +} + +size_t nghttp3_qpack_decoder_get_decoder_streamlen2( + const nghttp3_qpack_decoder *decoder) { uint64_t n; size_t len = 0; @@ -3863,14 +3886,14 @@ int nghttp3_qpack_decoder_cancel_stream(nghttp3_qpack_decoder *decoder, } p = decoder->dbuf.last; - *p = 0x40; + *p = 0x40U; decoder->dbuf.last = nghttp3_qpack_put_varint(p, (uint64_t)stream_id, 6); return 0; } -int nghttp3_qpack_decoder_reconstruct_ricnt(nghttp3_qpack_decoder *decoder, - uint64_t *dest, uint64_t encricnt) { +int nghttp3_qpack_decoder_reconstruct_ricnt( + const nghttp3_qpack_decoder *decoder, uint64_t *dest, uint64_t encricnt) { uint64_t max_ents, full, max, max_wrapped, ricnt; if (encricnt == 0) { @@ -3906,7 +3929,7 @@ int nghttp3_qpack_decoder_reconstruct_ricnt(nghttp3_qpack_decoder *decoder, return 0; } -int nghttp3_qpack_decoder_rel2abs(nghttp3_qpack_decoder *decoder, +int nghttp3_qpack_decoder_rel2abs(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_read_state *rstate) { DEBUGF("qpack::decode: dynamic=%d relidx=%" PRIu64 " icnt=%" PRIu64 "\n", rstate->dynamic, rstate->left, decoder->ctx.next_absidx); @@ -3925,7 +3948,7 @@ int nghttp3_qpack_decoder_rel2abs(nghttp3_qpack_decoder *decoder, return 0; } -int nghttp3_qpack_decoder_brel2abs(nghttp3_qpack_decoder *decoder, +int nghttp3_qpack_decoder_brel2abs(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx) { nghttp3_qpack_read_state *rstate = &sctx->rstate; @@ -3952,7 +3975,7 @@ int nghttp3_qpack_decoder_brel2abs(nghttp3_qpack_decoder *decoder, return 0; } -int nghttp3_qpack_decoder_pbrel2abs(nghttp3_qpack_decoder *decoder, +int nghttp3_qpack_decoder_pbrel2abs(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx) { nghttp3_qpack_read_state *rstate = &sctx->rstate; @@ -3974,8 +3997,8 @@ int nghttp3_qpack_decoder_pbrel2abs(nghttp3_qpack_decoder *decoder, } static void -qpack_decoder_emit_static_indexed(nghttp3_qpack_decoder *decoder, - nghttp3_qpack_stream_context *sctx, +qpack_decoder_emit_static_indexed(const nghttp3_qpack_decoder *decoder, + const nghttp3_qpack_stream_context *sctx, nghttp3_qpack_nv *nv) { const nghttp3_qpack_static_header *shd = &stable[sctx->rstate.absidx]; (void)decoder; @@ -3988,7 +4011,7 @@ qpack_decoder_emit_static_indexed(nghttp3_qpack_decoder *decoder, static void qpack_decoder_emit_dynamic_indexed(nghttp3_qpack_decoder *decoder, - nghttp3_qpack_stream_context *sctx, + const nghttp3_qpack_stream_context *sctx, nghttp3_qpack_nv *nv) { nghttp3_qpack_entry *ent = nghttp3_qpack_context_dtable_get(&decoder->ctx, sctx->rstate.absidx); @@ -3999,9 +4022,9 @@ qpack_decoder_emit_dynamic_indexed(nghttp3_qpack_decoder *decoder, nghttp3_rcbuf_incref(nv->value); } -void nghttp3_qpack_decoder_emit_indexed(nghttp3_qpack_decoder *decoder, - nghttp3_qpack_stream_context *sctx, - nghttp3_qpack_nv *nv) { +void nghttp3_qpack_decoder_emit_indexed( + nghttp3_qpack_decoder *decoder, const nghttp3_qpack_stream_context *sctx, + nghttp3_qpack_nv *nv) { DEBUGF("qpack::decode: Indexed (%s) absidx=%" PRIu64 "\n", sctx->rstate.dynamic ? "dynamic" : "static", sctx->rstate.absidx); @@ -4013,7 +4036,7 @@ void nghttp3_qpack_decoder_emit_indexed(nghttp3_qpack_decoder *decoder, } static void -qpack_decoder_emit_static_indexed_name(nghttp3_qpack_decoder *decoder, +qpack_decoder_emit_static_indexed_name(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx, nghttp3_qpack_nv *nv) { const nghttp3_qpack_static_header *shd = &stable[sctx->rstate.absidx]; @@ -4073,7 +4096,7 @@ int nghttp3_qpack_decoder_emit_indexed_name(nghttp3_qpack_decoder *decoder, return 0; } -void nghttp3_qpack_decoder_emit_literal(nghttp3_qpack_decoder *decoder, +void nghttp3_qpack_decoder_emit_literal(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx, nghttp3_qpack_nv *nv) { (void)decoder; diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.h b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.h index 1c13849a8aa55a..2b8dca9d5cf746 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack.h @@ -40,7 +40,7 @@ #include "nghttp3_ksl.h" #include "nghttp3_qpack_huffman.h" -#define NGHTTP3_QPACK_INT_MAX ((1ull << 62) - 1) +#define NGHTTP3_QPACK_INT_MAX ((1ULL << 62) - 1) /* NGHTTP3_QPACK_MAX_NAMELEN is the maximum (compressed) length of header name this library can decode. */ @@ -223,10 +223,10 @@ typedef enum nghttp3_qpack_decoder_stream_opcode { /* QPACK encoder flags */ /* NGHTTP3_QPACK_ENCODER_FLAG_NONE indicates that no flag is set. */ -#define NGHTTP3_QPACK_ENCODER_FLAG_NONE 0x00u +#define NGHTTP3_QPACK_ENCODER_FLAG_NONE 0x00U /* NGHTTP3_QPACK_ENCODER_FLAG_PENDING_SET_DTABLE_CAP indicates that Set Dynamic Table Capacity is required. */ -#define NGHTTP3_QPACK_ENCODER_FLAG_PENDING_SET_DTABLE_CAP 0x01u +#define NGHTTP3_QPACK_ENCODER_FLAG_PENDING_SET_DTABLE_CAP 0x01U struct nghttp3_qpack_encoder { nghttp3_qpack_context ctx; @@ -350,7 +350,7 @@ nghttp3_qpack_lookup_result nghttp3_qpack_encoder_lookup_dtable( * Out of memory. */ int nghttp3_qpack_encoder_write_field_section_prefix( - nghttp3_qpack_encoder *encoder, nghttp3_buf *pbuf, uint64_t ricnt, + const nghttp3_qpack_encoder *encoder, nghttp3_buf *pbuf, uint64_t ricnt, uint64_t base); /* @@ -363,9 +363,8 @@ int nghttp3_qpack_encoder_write_field_section_prefix( * NGHTTP3_ERR_NOMEM * Out of memory. */ -int nghttp3_qpack_encoder_write_static_indexed(nghttp3_qpack_encoder *encoder, - nghttp3_buf *rbuf, - uint64_t absidx); +int nghttp3_qpack_encoder_write_static_indexed( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx); /* * nghttp3_qpack_encoder_write_dynamic_indexed writes Indexed Header @@ -378,9 +377,9 @@ int nghttp3_qpack_encoder_write_static_indexed(nghttp3_qpack_encoder *encoder, * NGHTTP3_ERR_NOMEM * Out of memory. */ -int nghttp3_qpack_encoder_write_dynamic_indexed(nghttp3_qpack_encoder *encoder, - nghttp3_buf *rbuf, - uint64_t absidx, uint64_t base); +int nghttp3_qpack_encoder_write_dynamic_indexed( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, + uint64_t base); /* * nghttp3_qpack_encoder_write_static_indexed writes Literal Header @@ -395,7 +394,7 @@ int nghttp3_qpack_encoder_write_dynamic_indexed(nghttp3_qpack_encoder *encoder, * Out of memory. */ int nghttp3_qpack_encoder_write_static_indexed_name( - nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, const nghttp3_nv *nv); /* @@ -411,7 +410,7 @@ int nghttp3_qpack_encoder_write_static_indexed_name( * Out of memory. */ int nghttp3_qpack_encoder_write_dynamic_indexed_name( - nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, + const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, uint64_t absidx, uint64_t base, const nghttp3_nv *nv); /* @@ -424,7 +423,7 @@ int nghttp3_qpack_encoder_write_dynamic_indexed_name( * NGHTTP3_ERR_NOMEM * Out of memory. */ -int nghttp3_qpack_encoder_write_literal(nghttp3_qpack_encoder *encoder, +int nghttp3_qpack_encoder_write_literal(const nghttp3_qpack_encoder *encoder, nghttp3_buf *rbuf, const nghttp3_nv *nv); @@ -439,10 +438,9 @@ int nghttp3_qpack_encoder_write_literal(nghttp3_qpack_encoder *encoder, * NGHTTP3_ERR_NOMEM * Out of memory. */ -int nghttp3_qpack_encoder_write_static_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - uint64_t absidx, - const nghttp3_nv *nv); +int nghttp3_qpack_encoder_write_static_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, uint64_t absidx, + const nghttp3_nv *nv); /* * nghttp3_qpack_encoder_write_dynamic_insert writes Insert With Name @@ -455,10 +453,9 @@ int nghttp3_qpack_encoder_write_static_insert(nghttp3_qpack_encoder *encoder, * NGHTTP3_ERR_NOMEM * Out of memory. */ -int nghttp3_qpack_encoder_write_dynamic_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - uint64_t absidx, - const nghttp3_nv *nv); +int nghttp3_qpack_encoder_write_dynamic_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, uint64_t absidx, + const nghttp3_nv *nv); /* * nghttp3_qpack_encoder_write_duplicate_insert writes Duplicate to @@ -471,9 +468,8 @@ int nghttp3_qpack_encoder_write_dynamic_insert(nghttp3_qpack_encoder *encoder, * NGHTTP3_ERR_NOMEM * Out of memory. */ -int nghttp3_qpack_encoder_write_duplicate_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - uint64_t absidx); +int nghttp3_qpack_encoder_write_duplicate_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, uint64_t absidx); /* * nghttp3_qpack_encoder_write_literal_insert writes Insert With @@ -485,12 +481,12 @@ int nghttp3_qpack_encoder_write_duplicate_insert(nghttp3_qpack_encoder *encoder, * NGHTTP3_ERR_NOMEM * Out of memory. */ -int nghttp3_qpack_encoder_write_literal_insert(nghttp3_qpack_encoder *encoder, - nghttp3_buf *ebuf, - const nghttp3_nv *nv); +int nghttp3_qpack_encoder_write_literal_insert( + const nghttp3_qpack_encoder *encoder, nghttp3_buf *ebuf, + const nghttp3_nv *nv); -int nghttp3_qpack_encoder_stream_is_blocked(nghttp3_qpack_encoder *encoder, - nghttp3_qpack_stream *stream); +int nghttp3_qpack_encoder_stream_is_blocked( + const nghttp3_qpack_encoder *encoder, const nghttp3_qpack_stream *stream); /* * nghttp3_qpack_encoder_block_stream blocks |stream|. @@ -523,10 +519,11 @@ void nghttp3_qpack_encoder_unblock(nghttp3_qpack_encoder *encoder, * stream. */ nghttp3_qpack_stream * -nghttp3_qpack_encoder_find_stream(nghttp3_qpack_encoder *encoder, +nghttp3_qpack_encoder_find_stream(const nghttp3_qpack_encoder *encoder, int64_t stream_id); -uint64_t nghttp3_qpack_encoder_get_min_cnt(nghttp3_qpack_encoder *encoder); +uint64_t +nghttp3_qpack_encoder_get_min_cnt(const nghttp3_qpack_encoder *encoder); /* * nghttp3_qpack_encoder_shrink_dtable shrinks dynamic table so that @@ -927,8 +924,8 @@ void nghttp3_qpack_stream_context_free(nghttp3_qpack_stream_context *sctx); * NGHTTP3_ERR_QPACK_DECOMPRESSION_FAILED * Unable to reconstruct Required Insert Count. */ -int nghttp3_qpack_decoder_reconstruct_ricnt(nghttp3_qpack_decoder *decoder, - uint64_t *dest, uint64_t encricnt); +int nghttp3_qpack_decoder_reconstruct_ricnt( + const nghttp3_qpack_decoder *decoder, uint64_t *dest, uint64_t encricnt); /* * nghttp3_qpack_decoder_rel2abs converts relative index rstate->left @@ -941,7 +938,7 @@ int nghttp3_qpack_decoder_reconstruct_ricnt(nghttp3_qpack_decoder *decoder, * NGHTTP3_ERR_QPACK_ENCODER_STREAM * Relative index is invalid. */ -int nghttp3_qpack_decoder_rel2abs(nghttp3_qpack_decoder *decoder, +int nghttp3_qpack_decoder_rel2abs(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_read_state *rstate); /* @@ -955,7 +952,7 @@ int nghttp3_qpack_decoder_rel2abs(nghttp3_qpack_decoder *decoder, * NGHTTP3_ERR_QPACK_DECOMPRESSION_FAILED * Base relative index is invalid. */ -int nghttp3_qpack_decoder_brel2abs(nghttp3_qpack_decoder *decoder, +int nghttp3_qpack_decoder_brel2abs(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx); /* @@ -969,18 +966,18 @@ int nghttp3_qpack_decoder_brel2abs(nghttp3_qpack_decoder *decoder, * NGHTTP3_ERR_QPACK_DECOMPRESSION_FAILED * Post-Base relative index is invalid. */ -int nghttp3_qpack_decoder_pbrel2abs(nghttp3_qpack_decoder *decoder, +int nghttp3_qpack_decoder_pbrel2abs(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx); -void nghttp3_qpack_decoder_emit_indexed(nghttp3_qpack_decoder *decoder, - nghttp3_qpack_stream_context *sctx, - nghttp3_qpack_nv *nv); +void nghttp3_qpack_decoder_emit_indexed( + nghttp3_qpack_decoder *decoder, const nghttp3_qpack_stream_context *sctx, + nghttp3_qpack_nv *nv); int nghttp3_qpack_decoder_emit_indexed_name(nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx, nghttp3_qpack_nv *nv); -void nghttp3_qpack_decoder_emit_literal(nghttp3_qpack_decoder *decoder, +void nghttp3_qpack_decoder_emit_literal(const nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx, nghttp3_qpack_nv *nv); diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.c b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.c index 8b9b6a451b6015..b784ca9970c0b4 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.c @@ -107,7 +107,7 @@ nghttp3_qpack_huffman_decode(nghttp3_qpack_huffman_decode_context *ctx, *p++ = t.sym; } - t = qpack_huffman_decode_table[t.fstate][c & 0xf]; + t = qpack_huffman_decode_table[t.fstate][c & 0xFU]; if (t.flags & NGHTTP3_QPACK_HUFFMAN_SYM) { *p++ = t.sym; } @@ -124,6 +124,6 @@ nghttp3_qpack_huffman_decode(nghttp3_qpack_huffman_decode_context *ctx, } int nghttp3_qpack_huffman_decode_failure_state( - nghttp3_qpack_huffman_decode_context *ctx) { - return ctx->fstate == 0x100; + const nghttp3_qpack_huffman_decode_context *ctx) { + return ctx->fstate == 0x100U; } diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.h b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.h index aa262179521165..2fce4de6f011ec 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.h @@ -105,6 +105,14 @@ nghttp3_qpack_huffman_decode(nghttp3_qpack_huffman_decode_context *ctx, * indicates that huffman decoding context is in failure state. */ int nghttp3_qpack_huffman_decode_failure_state( - nghttp3_qpack_huffman_decode_context *ctx); + const nghttp3_qpack_huffman_decode_context *ctx); + +/* + * nghttp3_qpack_huffman_estimate_decode_length returns the estimated + * decoded length of the huffman encoded string of length |len|. + */ +static inline size_t nghttp3_qpack_huffman_estimate_decode_length(size_t len) { + return len * 8 / 5; +} #endif /* !defined(NGHTTP3_QPACK_HUFFMAN_H) */ diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman_data.c b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman_data.c index 9eae37eb3ea1f8..ffe8fcafadb667 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman_data.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman_data.c @@ -28,71 +28,71 @@ /* Generated by mkhufftbl.py */ const nghttp3_qpack_huffman_sym huffman_sym_table[] = { - {13, 0xffc00000u}, {23, 0xffffb000u}, {28, 0xfffffe20u}, {28, 0xfffffe30u}, - {28, 0xfffffe40u}, {28, 0xfffffe50u}, {28, 0xfffffe60u}, {28, 0xfffffe70u}, - {28, 0xfffffe80u}, {24, 0xffffea00u}, {30, 0xfffffff0u}, {28, 0xfffffe90u}, - {28, 0xfffffea0u}, {30, 0xfffffff4u}, {28, 0xfffffeb0u}, {28, 0xfffffec0u}, - {28, 0xfffffed0u}, {28, 0xfffffee0u}, {28, 0xfffffef0u}, {28, 0xffffff00u}, - {28, 0xffffff10u}, {28, 0xffffff20u}, {30, 0xfffffff8u}, {28, 0xffffff30u}, - {28, 0xffffff40u}, {28, 0xffffff50u}, {28, 0xffffff60u}, {28, 0xffffff70u}, - {28, 0xffffff80u}, {28, 0xffffff90u}, {28, 0xffffffa0u}, {28, 0xffffffb0u}, - {6, 0x50000000u}, {10, 0xfe000000u}, {10, 0xfe400000u}, {12, 0xffa00000u}, - {13, 0xffc80000u}, {6, 0x54000000u}, {8, 0xf8000000u}, {11, 0xff400000u}, - {10, 0xfe800000u}, {10, 0xfec00000u}, {8, 0xf9000000u}, {11, 0xff600000u}, - {8, 0xfa000000u}, {6, 0x58000000u}, {6, 0x5c000000u}, {6, 0x60000000u}, - {5, 0x0u}, {5, 0x8000000u}, {5, 0x10000000u}, {6, 0x64000000u}, - {6, 0x68000000u}, {6, 0x6c000000u}, {6, 0x70000000u}, {6, 0x74000000u}, - {6, 0x78000000u}, {6, 0x7c000000u}, {7, 0xb8000000u}, {8, 0xfb000000u}, - {15, 0xfff80000u}, {6, 0x80000000u}, {12, 0xffb00000u}, {10, 0xff000000u}, - {13, 0xffd00000u}, {6, 0x84000000u}, {7, 0xba000000u}, {7, 0xbc000000u}, - {7, 0xbe000000u}, {7, 0xc0000000u}, {7, 0xc2000000u}, {7, 0xc4000000u}, - {7, 0xc6000000u}, {7, 0xc8000000u}, {7, 0xca000000u}, {7, 0xcc000000u}, - {7, 0xce000000u}, {7, 0xd0000000u}, {7, 0xd2000000u}, {7, 0xd4000000u}, - {7, 0xd6000000u}, {7, 0xd8000000u}, {7, 0xda000000u}, {7, 0xdc000000u}, - {7, 0xde000000u}, {7, 0xe0000000u}, {7, 0xe2000000u}, {7, 0xe4000000u}, - {8, 0xfc000000u}, {7, 0xe6000000u}, {8, 0xfd000000u}, {13, 0xffd80000u}, - {19, 0xfffe0000u}, {13, 0xffe00000u}, {14, 0xfff00000u}, {6, 0x88000000u}, - {15, 0xfffa0000u}, {5, 0x18000000u}, {6, 0x8c000000u}, {5, 0x20000000u}, - {6, 0x90000000u}, {5, 0x28000000u}, {6, 0x94000000u}, {6, 0x98000000u}, - {6, 0x9c000000u}, {5, 0x30000000u}, {7, 0xe8000000u}, {7, 0xea000000u}, - {6, 0xa0000000u}, {6, 0xa4000000u}, {6, 0xa8000000u}, {5, 0x38000000u}, - {6, 0xac000000u}, {7, 0xec000000u}, {6, 0xb0000000u}, {5, 0x40000000u}, - {5, 0x48000000u}, {6, 0xb4000000u}, {7, 0xee000000u}, {7, 0xf0000000u}, - {7, 0xf2000000u}, {7, 0xf4000000u}, {7, 0xf6000000u}, {15, 0xfffc0000u}, - {11, 0xff800000u}, {14, 0xfff40000u}, {13, 0xffe80000u}, {28, 0xffffffc0u}, - {20, 0xfffe6000u}, {22, 0xffff4800u}, {20, 0xfffe7000u}, {20, 0xfffe8000u}, - {22, 0xffff4c00u}, {22, 0xffff5000u}, {22, 0xffff5400u}, {23, 0xffffb200u}, - {22, 0xffff5800u}, {23, 0xffffb400u}, {23, 0xffffb600u}, {23, 0xffffb800u}, - {23, 0xffffba00u}, {23, 0xffffbc00u}, {24, 0xffffeb00u}, {23, 0xffffbe00u}, - {24, 0xffffec00u}, {24, 0xffffed00u}, {22, 0xffff5c00u}, {23, 0xffffc000u}, - {24, 0xffffee00u}, {23, 0xffffc200u}, {23, 0xffffc400u}, {23, 0xffffc600u}, - {23, 0xffffc800u}, {21, 0xfffee000u}, {22, 0xffff6000u}, {23, 0xffffca00u}, - {22, 0xffff6400u}, {23, 0xffffcc00u}, {23, 0xffffce00u}, {24, 0xffffef00u}, - {22, 0xffff6800u}, {21, 0xfffee800u}, {20, 0xfffe9000u}, {22, 0xffff6c00u}, - {22, 0xffff7000u}, {23, 0xffffd000u}, {23, 0xffffd200u}, {21, 0xfffef000u}, - {23, 0xffffd400u}, {22, 0xffff7400u}, {22, 0xffff7800u}, {24, 0xfffff000u}, - {21, 0xfffef800u}, {22, 0xffff7c00u}, {23, 0xffffd600u}, {23, 0xffffd800u}, - {21, 0xffff0000u}, {21, 0xffff0800u}, {22, 0xffff8000u}, {21, 0xffff1000u}, - {23, 0xffffda00u}, {22, 0xffff8400u}, {23, 0xffffdc00u}, {23, 0xffffde00u}, - {20, 0xfffea000u}, {22, 0xffff8800u}, {22, 0xffff8c00u}, {22, 0xffff9000u}, - {23, 0xffffe000u}, {22, 0xffff9400u}, {22, 0xffff9800u}, {23, 0xffffe200u}, - {26, 0xfffff800u}, {26, 0xfffff840u}, {20, 0xfffeb000u}, {19, 0xfffe2000u}, - {22, 0xffff9c00u}, {23, 0xffffe400u}, {22, 0xffffa000u}, {25, 0xfffff600u}, - {26, 0xfffff880u}, {26, 0xfffff8c0u}, {26, 0xfffff900u}, {27, 0xfffffbc0u}, - {27, 0xfffffbe0u}, {26, 0xfffff940u}, {24, 0xfffff100u}, {25, 0xfffff680u}, - {19, 0xfffe4000u}, {21, 0xffff1800u}, {26, 0xfffff980u}, {27, 0xfffffc00u}, - {27, 0xfffffc20u}, {26, 0xfffff9c0u}, {27, 0xfffffc40u}, {24, 0xfffff200u}, - {21, 0xffff2000u}, {21, 0xffff2800u}, {26, 0xfffffa00u}, {26, 0xfffffa40u}, - {28, 0xffffffd0u}, {27, 0xfffffc60u}, {27, 0xfffffc80u}, {27, 0xfffffca0u}, - {20, 0xfffec000u}, {24, 0xfffff300u}, {20, 0xfffed000u}, {21, 0xffff3000u}, - {22, 0xffffa400u}, {21, 0xffff3800u}, {21, 0xffff4000u}, {23, 0xffffe600u}, - {22, 0xffffa800u}, {22, 0xffffac00u}, {25, 0xfffff700u}, {25, 0xfffff780u}, - {24, 0xfffff400u}, {24, 0xfffff500u}, {26, 0xfffffa80u}, {23, 0xffffe800u}, - {26, 0xfffffac0u}, {27, 0xfffffcc0u}, {26, 0xfffffb00u}, {26, 0xfffffb40u}, - {27, 0xfffffce0u}, {27, 0xfffffd00u}, {27, 0xfffffd20u}, {27, 0xfffffd40u}, - {27, 0xfffffd60u}, {28, 0xffffffe0u}, {27, 0xfffffd80u}, {27, 0xfffffda0u}, - {27, 0xfffffdc0u}, {27, 0xfffffde0u}, {27, 0xfffffe00u}, {26, 0xfffffb80u}, - {30, 0xfffffffcu}}; + {13, 0xFFC00000U}, {23, 0xFFFFB000U}, {28, 0xFFFFFE20U}, {28, 0xFFFFFE30U}, + {28, 0xFFFFFE40U}, {28, 0xFFFFFE50U}, {28, 0xFFFFFE60U}, {28, 0xFFFFFE70U}, + {28, 0xFFFFFE80U}, {24, 0xFFFFEA00U}, {30, 0xFFFFFFF0U}, {28, 0xFFFFFE90U}, + {28, 0xFFFFFEA0U}, {30, 0xFFFFFFF4U}, {28, 0xFFFFFEB0U}, {28, 0xFFFFFEC0U}, + {28, 0xFFFFFED0U}, {28, 0xFFFFFEE0U}, {28, 0xFFFFFEF0U}, {28, 0xFFFFFF00U}, + {28, 0xFFFFFF10U}, {28, 0xFFFFFF20U}, {30, 0xFFFFFFF8U}, {28, 0xFFFFFF30U}, + {28, 0xFFFFFF40U}, {28, 0xFFFFFF50U}, {28, 0xFFFFFF60U}, {28, 0xFFFFFF70U}, + {28, 0xFFFFFF80U}, {28, 0xFFFFFF90U}, {28, 0xFFFFFFA0U}, {28, 0xFFFFFFB0U}, + {6, 0x50000000U}, {10, 0xFE000000U}, {10, 0xFE400000U}, {12, 0xFFA00000U}, + {13, 0xFFC80000U}, {6, 0x54000000U}, {8, 0xF8000000U}, {11, 0xFF400000U}, + {10, 0xFE800000U}, {10, 0xFEC00000U}, {8, 0xF9000000U}, {11, 0xFF600000U}, + {8, 0xFA000000U}, {6, 0x58000000U}, {6, 0x5C000000U}, {6, 0x60000000U}, + {5, 0x0U}, {5, 0x8000000U}, {5, 0x10000000U}, {6, 0x64000000U}, + {6, 0x68000000U}, {6, 0x6C000000U}, {6, 0x70000000U}, {6, 0x74000000U}, + {6, 0x78000000U}, {6, 0x7C000000U}, {7, 0xB8000000U}, {8, 0xFB000000U}, + {15, 0xFFF80000U}, {6, 0x80000000U}, {12, 0xFFB00000U}, {10, 0xFF000000U}, + {13, 0xFFD00000U}, {6, 0x84000000U}, {7, 0xBA000000U}, {7, 0xBC000000U}, + {7, 0xBE000000U}, {7, 0xC0000000U}, {7, 0xC2000000U}, {7, 0xC4000000U}, + {7, 0xC6000000U}, {7, 0xC8000000U}, {7, 0xCA000000U}, {7, 0xCC000000U}, + {7, 0xCE000000U}, {7, 0xD0000000U}, {7, 0xD2000000U}, {7, 0xD4000000U}, + {7, 0xD6000000U}, {7, 0xD8000000U}, {7, 0xDA000000U}, {7, 0xDC000000U}, + {7, 0xDE000000U}, {7, 0xE0000000U}, {7, 0xE2000000U}, {7, 0xE4000000U}, + {8, 0xFC000000U}, {7, 0xE6000000U}, {8, 0xFD000000U}, {13, 0xFFD80000U}, + {19, 0xFFFE0000U}, {13, 0xFFE00000U}, {14, 0xFFF00000U}, {6, 0x88000000U}, + {15, 0xFFFA0000U}, {5, 0x18000000U}, {6, 0x8C000000U}, {5, 0x20000000U}, + {6, 0x90000000U}, {5, 0x28000000U}, {6, 0x94000000U}, {6, 0x98000000U}, + {6, 0x9C000000U}, {5, 0x30000000U}, {7, 0xE8000000U}, {7, 0xEA000000U}, + {6, 0xA0000000U}, {6, 0xA4000000U}, {6, 0xA8000000U}, {5, 0x38000000U}, + {6, 0xAC000000U}, {7, 0xEC000000U}, {6, 0xB0000000U}, {5, 0x40000000U}, + {5, 0x48000000U}, {6, 0xB4000000U}, {7, 0xEE000000U}, {7, 0xF0000000U}, + {7, 0xF2000000U}, {7, 0xF4000000U}, {7, 0xF6000000U}, {15, 0xFFFC0000U}, + {11, 0xFF800000U}, {14, 0xFFF40000U}, {13, 0xFFE80000U}, {28, 0xFFFFFFC0U}, + {20, 0xFFFE6000U}, {22, 0xFFFF4800U}, {20, 0xFFFE7000U}, {20, 0xFFFE8000U}, + {22, 0xFFFF4C00U}, {22, 0xFFFF5000U}, {22, 0xFFFF5400U}, {23, 0xFFFFB200U}, + {22, 0xFFFF5800U}, {23, 0xFFFFB400U}, {23, 0xFFFFB600U}, {23, 0xFFFFB800U}, + {23, 0xFFFFBA00U}, {23, 0xFFFFBC00U}, {24, 0xFFFFEB00U}, {23, 0xFFFFBE00U}, + {24, 0xFFFFEC00U}, {24, 0xFFFFED00U}, {22, 0xFFFF5C00U}, {23, 0xFFFFC000U}, + {24, 0xFFFFEE00U}, {23, 0xFFFFC200U}, {23, 0xFFFFC400U}, {23, 0xFFFFC600U}, + {23, 0xFFFFC800U}, {21, 0xFFFEE000U}, {22, 0xFFFF6000U}, {23, 0xFFFFCA00U}, + {22, 0xFFFF6400U}, {23, 0xFFFFCC00U}, {23, 0xFFFFCE00U}, {24, 0xFFFFEF00U}, + {22, 0xFFFF6800U}, {21, 0xFFFEE800U}, {20, 0xFFFE9000U}, {22, 0xFFFF6C00U}, + {22, 0xFFFF7000U}, {23, 0xFFFFD000U}, {23, 0xFFFFD200U}, {21, 0xFFFEF000U}, + {23, 0xFFFFD400U}, {22, 0xFFFF7400U}, {22, 0xFFFF7800U}, {24, 0xFFFFF000U}, + {21, 0xFFFEF800U}, {22, 0xFFFF7C00U}, {23, 0xFFFFD600U}, {23, 0xFFFFD800U}, + {21, 0xFFFF0000U}, {21, 0xFFFF0800U}, {22, 0xFFFF8000U}, {21, 0xFFFF1000U}, + {23, 0xFFFFDA00U}, {22, 0xFFFF8400U}, {23, 0xFFFFDC00U}, {23, 0xFFFFDE00U}, + {20, 0xFFFEA000U}, {22, 0xFFFF8800U}, {22, 0xFFFF8C00U}, {22, 0xFFFF9000U}, + {23, 0xFFFFE000U}, {22, 0xFFFF9400U}, {22, 0xFFFF9800U}, {23, 0xFFFFE200U}, + {26, 0xFFFFF800U}, {26, 0xFFFFF840U}, {20, 0xFFFEB000U}, {19, 0xFFFE2000U}, + {22, 0xFFFF9C00U}, {23, 0xFFFFE400U}, {22, 0xFFFFA000U}, {25, 0xFFFFF600U}, + {26, 0xFFFFF880U}, {26, 0xFFFFF8C0U}, {26, 0xFFFFF900U}, {27, 0xFFFFFBC0U}, + {27, 0xFFFFFBE0U}, {26, 0xFFFFF940U}, {24, 0xFFFFF100U}, {25, 0xFFFFF680U}, + {19, 0xFFFE4000U}, {21, 0xFFFF1800U}, {26, 0xFFFFF980U}, {27, 0xFFFFFC00U}, + {27, 0xFFFFFC20U}, {26, 0xFFFFF9C0U}, {27, 0xFFFFFC40U}, {24, 0xFFFFF200U}, + {21, 0xFFFF2000U}, {21, 0xFFFF2800U}, {26, 0xFFFFFA00U}, {26, 0xFFFFFA40U}, + {28, 0xFFFFFFD0U}, {27, 0xFFFFFC60U}, {27, 0xFFFFFC80U}, {27, 0xFFFFFCA0U}, + {20, 0xFFFEC000U}, {24, 0xFFFFF300U}, {20, 0xFFFED000U}, {21, 0xFFFF3000U}, + {22, 0xFFFFA400U}, {21, 0xFFFF3800U}, {21, 0xFFFF4000U}, {23, 0xFFFFE600U}, + {22, 0xFFFFA800U}, {22, 0xFFFFAC00U}, {25, 0xFFFFF700U}, {25, 0xFFFFF780U}, + {24, 0xFFFFF400U}, {24, 0xFFFFF500U}, {26, 0xFFFFFA80U}, {23, 0xFFFFE800U}, + {26, 0xFFFFFAC0U}, {27, 0xFFFFFCC0U}, {26, 0xFFFFFB00U}, {26, 0xFFFFFB40U}, + {27, 0xFFFFFCE0U}, {27, 0xFFFFFD00U}, {27, 0xFFFFFD20U}, {27, 0xFFFFFD40U}, + {27, 0xFFFFFD60U}, {28, 0xFFFFFFE0U}, {27, 0xFFFFFD80U}, {27, 0xFFFFFDA0U}, + {27, 0xFFFFFDC0U}, {27, 0xFFFFFDE0U}, {27, 0xFFFFFE00U}, {26, 0xFFFFFB80U}, + {30, 0xFFFFFFFCU}}; const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { /* 0 */ @@ -101,15 +101,15 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x05, 0, 0}, {0x07, 0, 0}, {0x08, 0, 0}, - {0x0b, 0, 0}, - {0x0c, 0, 0}, + {0x0B, 0, 0}, + {0x0C, 0, 0}, {0x10, 0, 0}, {0x13, 0, 0}, {0x19, 0, 0}, - {0x1c, 0, 0}, + {0x1C, 0, 0}, {0x20, 0, 0}, {0x23, 0, 0}, - {0x2a, 0, 0}, + {0x2A, 0, 0}, {0x31, 0, 0}, {0x39, 0, 0}, {0x40, 1, 0}, @@ -126,8 +126,8 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 111}, {0x00, 3, 115}, {0x00, 3, 116}, - {0x0d, 0, 0}, - {0x0e, 0, 0}, + {0x0D, 0, 0}, + {0x0E, 0, 0}, {0x11, 0, 0}, {0x12, 0, 0}, {0x14, 0, 0}, @@ -175,18 +175,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 48}, {0x06, 2, 48}, - {0x0a, 2, 48}, - {0x0f, 2, 48}, + {0x0A, 2, 48}, + {0x0F, 2, 48}, {0x18, 2, 48}, - {0x1f, 2, 48}, + {0x1F, 2, 48}, {0x29, 2, 48}, {0x38, 3, 48}, {0x03, 2, 49}, {0x06, 2, 49}, - {0x0a, 2, 49}, - {0x0f, 2, 49}, + {0x0A, 2, 49}, + {0x0F, 2, 49}, {0x18, 2, 49}, - {0x1f, 2, 49}, + {0x1F, 2, 49}, {0x29, 2, 49}, {0x38, 3, 49}, }, @@ -194,18 +194,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 50}, {0x06, 2, 50}, - {0x0a, 2, 50}, - {0x0f, 2, 50}, + {0x0A, 2, 50}, + {0x0F, 2, 50}, {0x18, 2, 50}, - {0x1f, 2, 50}, + {0x1F, 2, 50}, {0x29, 2, 50}, {0x38, 3, 50}, {0x03, 2, 97}, {0x06, 2, 97}, - {0x0a, 2, 97}, - {0x0f, 2, 97}, + {0x0A, 2, 97}, + {0x0F, 2, 97}, {0x18, 2, 97}, - {0x1f, 2, 97}, + {0x1F, 2, 97}, {0x29, 2, 97}, {0x38, 3, 97}, }, @@ -232,18 +232,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 99}, {0x06, 2, 99}, - {0x0a, 2, 99}, - {0x0f, 2, 99}, + {0x0A, 2, 99}, + {0x0F, 2, 99}, {0x18, 2, 99}, - {0x1f, 2, 99}, + {0x1F, 2, 99}, {0x29, 2, 99}, {0x38, 3, 99}, {0x03, 2, 101}, {0x06, 2, 101}, - {0x0a, 2, 101}, - {0x0f, 2, 101}, + {0x0A, 2, 101}, + {0x0F, 2, 101}, {0x18, 2, 101}, - {0x1f, 2, 101}, + {0x1F, 2, 101}, {0x29, 2, 101}, {0x38, 3, 101}, }, @@ -251,18 +251,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 105}, {0x06, 2, 105}, - {0x0a, 2, 105}, - {0x0f, 2, 105}, + {0x0A, 2, 105}, + {0x0F, 2, 105}, {0x18, 2, 105}, - {0x1f, 2, 105}, + {0x1F, 2, 105}, {0x29, 2, 105}, {0x38, 3, 105}, {0x03, 2, 111}, {0x06, 2, 111}, - {0x0a, 2, 111}, - {0x0f, 2, 111}, + {0x0A, 2, 111}, + {0x0F, 2, 111}, {0x18, 2, 111}, - {0x1f, 2, 111}, + {0x1F, 2, 111}, {0x29, 2, 111}, {0x38, 3, 111}, }, @@ -308,18 +308,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 115}, {0x06, 2, 115}, - {0x0a, 2, 115}, - {0x0f, 2, 115}, + {0x0A, 2, 115}, + {0x0F, 2, 115}, {0x18, 2, 115}, - {0x1f, 2, 115}, + {0x1F, 2, 115}, {0x29, 2, 115}, {0x38, 3, 115}, {0x03, 2, 116}, {0x06, 2, 116}, - {0x0a, 2, 116}, - {0x0f, 2, 116}, + {0x0A, 2, 116}, + {0x0F, 2, 116}, {0x18, 2, 116}, - {0x1f, 2, 116}, + {0x1F, 2, 116}, {0x29, 2, 116}, {0x38, 3, 116}, }, @@ -346,18 +346,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 32}, {0x06, 2, 32}, - {0x0a, 2, 32}, - {0x0f, 2, 32}, + {0x0A, 2, 32}, + {0x0F, 2, 32}, {0x18, 2, 32}, - {0x1f, 2, 32}, + {0x1F, 2, 32}, {0x29, 2, 32}, {0x38, 3, 32}, {0x03, 2, 37}, {0x06, 2, 37}, - {0x0a, 2, 37}, - {0x0f, 2, 37}, + {0x0A, 2, 37}, + {0x0F, 2, 37}, {0x18, 2, 37}, - {0x1f, 2, 37}, + {0x1F, 2, 37}, {0x29, 2, 37}, {0x38, 3, 37}, }, @@ -365,18 +365,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 45}, {0x06, 2, 45}, - {0x0a, 2, 45}, - {0x0f, 2, 45}, + {0x0A, 2, 45}, + {0x0F, 2, 45}, {0x18, 2, 45}, - {0x1f, 2, 45}, + {0x1F, 2, 45}, {0x29, 2, 45}, {0x38, 3, 45}, {0x03, 2, 46}, {0x06, 2, 46}, - {0x0a, 2, 46}, - {0x0f, 2, 46}, + {0x0A, 2, 46}, + {0x0F, 2, 46}, {0x18, 2, 46}, - {0x1f, 2, 46}, + {0x1F, 2, 46}, {0x29, 2, 46}, {0x38, 3, 46}, }, @@ -422,18 +422,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 47}, {0x06, 2, 47}, - {0x0a, 2, 47}, - {0x0f, 2, 47}, + {0x0A, 2, 47}, + {0x0F, 2, 47}, {0x18, 2, 47}, - {0x1f, 2, 47}, + {0x1F, 2, 47}, {0x29, 2, 47}, {0x38, 3, 47}, {0x03, 2, 51}, {0x06, 2, 51}, - {0x0a, 2, 51}, - {0x0f, 2, 51}, + {0x0A, 2, 51}, + {0x0F, 2, 51}, {0x18, 2, 51}, - {0x1f, 2, 51}, + {0x1F, 2, 51}, {0x29, 2, 51}, {0x38, 3, 51}, }, @@ -441,18 +441,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 52}, {0x06, 2, 52}, - {0x0a, 2, 52}, - {0x0f, 2, 52}, + {0x0A, 2, 52}, + {0x0F, 2, 52}, {0x18, 2, 52}, - {0x1f, 2, 52}, + {0x1F, 2, 52}, {0x29, 2, 52}, {0x38, 3, 52}, {0x03, 2, 53}, {0x06, 2, 53}, - {0x0a, 2, 53}, - {0x0f, 2, 53}, + {0x0A, 2, 53}, + {0x0F, 2, 53}, {0x18, 2, 53}, - {0x1f, 2, 53}, + {0x1F, 2, 53}, {0x29, 2, 53}, {0x38, 3, 53}, }, @@ -479,18 +479,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 54}, {0x06, 2, 54}, - {0x0a, 2, 54}, - {0x0f, 2, 54}, + {0x0A, 2, 54}, + {0x0F, 2, 54}, {0x18, 2, 54}, - {0x1f, 2, 54}, + {0x1F, 2, 54}, {0x29, 2, 54}, {0x38, 3, 54}, {0x03, 2, 55}, {0x06, 2, 55}, - {0x0a, 2, 55}, - {0x0f, 2, 55}, + {0x0A, 2, 55}, + {0x0F, 2, 55}, {0x18, 2, 55}, - {0x1f, 2, 55}, + {0x1F, 2, 55}, {0x29, 2, 55}, {0x38, 3, 55}, }, @@ -498,37 +498,37 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 56}, {0x06, 2, 56}, - {0x0a, 2, 56}, - {0x0f, 2, 56}, + {0x0A, 2, 56}, + {0x0F, 2, 56}, {0x18, 2, 56}, - {0x1f, 2, 56}, + {0x1F, 2, 56}, {0x29, 2, 56}, {0x38, 3, 56}, {0x03, 2, 57}, {0x06, 2, 57}, - {0x0a, 2, 57}, - {0x0f, 2, 57}, + {0x0A, 2, 57}, + {0x0F, 2, 57}, {0x18, 2, 57}, - {0x1f, 2, 57}, + {0x1F, 2, 57}, {0x29, 2, 57}, {0x38, 3, 57}, }, /* 22 */ { - {0x1a, 0, 0}, - {0x1b, 0, 0}, - {0x1d, 0, 0}, - {0x1e, 0, 0}, + {0x1A, 0, 0}, + {0x1B, 0, 0}, + {0x1D, 0, 0}, + {0x1E, 0, 0}, {0x21, 0, 0}, {0x22, 0, 0}, {0x24, 0, 0}, {0x25, 0, 0}, - {0x2b, 0, 0}, - {0x2e, 0, 0}, + {0x2B, 0, 0}, + {0x2E, 0, 0}, {0x32, 0, 0}, {0x35, 0, 0}, - {0x3a, 0, 0}, - {0x3d, 0, 0}, + {0x3A, 0, 0}, + {0x3D, 0, 0}, {0x41, 0, 0}, {0x44, 1, 0}, }, @@ -593,18 +593,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 61}, {0x06, 2, 61}, - {0x0a, 2, 61}, - {0x0f, 2, 61}, + {0x0A, 2, 61}, + {0x0F, 2, 61}, {0x18, 2, 61}, - {0x1f, 2, 61}, + {0x1F, 2, 61}, {0x29, 2, 61}, {0x38, 3, 61}, {0x03, 2, 65}, {0x06, 2, 65}, - {0x0a, 2, 65}, - {0x0f, 2, 65}, + {0x0A, 2, 65}, + {0x0F, 2, 65}, {0x18, 2, 65}, - {0x1f, 2, 65}, + {0x1F, 2, 65}, {0x29, 2, 65}, {0x38, 3, 65}, }, @@ -612,18 +612,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 95}, {0x06, 2, 95}, - {0x0a, 2, 95}, - {0x0f, 2, 95}, + {0x0A, 2, 95}, + {0x0F, 2, 95}, {0x18, 2, 95}, - {0x1f, 2, 95}, + {0x1F, 2, 95}, {0x29, 2, 95}, {0x38, 3, 95}, {0x03, 2, 98}, {0x06, 2, 98}, - {0x0a, 2, 98}, - {0x0f, 2, 98}, + {0x0A, 2, 98}, + {0x0F, 2, 98}, {0x18, 2, 98}, - {0x1f, 2, 98}, + {0x1F, 2, 98}, {0x29, 2, 98}, {0x38, 3, 98}, }, @@ -650,18 +650,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 100}, {0x06, 2, 100}, - {0x0a, 2, 100}, - {0x0f, 2, 100}, + {0x0A, 2, 100}, + {0x0F, 2, 100}, {0x18, 2, 100}, - {0x1f, 2, 100}, + {0x1F, 2, 100}, {0x29, 2, 100}, {0x38, 3, 100}, {0x03, 2, 102}, {0x06, 2, 102}, - {0x0a, 2, 102}, - {0x0f, 2, 102}, + {0x0A, 2, 102}, + {0x0F, 2, 102}, {0x18, 2, 102}, - {0x1f, 2, 102}, + {0x1F, 2, 102}, {0x29, 2, 102}, {0x38, 3, 102}, }, @@ -669,18 +669,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 103}, {0x06, 2, 103}, - {0x0a, 2, 103}, - {0x0f, 2, 103}, + {0x0A, 2, 103}, + {0x0F, 2, 103}, {0x18, 2, 103}, - {0x1f, 2, 103}, + {0x1F, 2, 103}, {0x29, 2, 103}, {0x38, 3, 103}, {0x03, 2, 104}, {0x06, 2, 104}, - {0x0a, 2, 104}, - {0x0f, 2, 104}, + {0x0A, 2, 104}, + {0x0F, 2, 104}, {0x18, 2, 104}, - {0x1f, 2, 104}, + {0x1F, 2, 104}, {0x29, 2, 104}, {0x38, 3, 104}, }, @@ -726,18 +726,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 108}, {0x06, 2, 108}, - {0x0a, 2, 108}, - {0x0f, 2, 108}, + {0x0A, 2, 108}, + {0x0F, 2, 108}, {0x18, 2, 108}, - {0x1f, 2, 108}, + {0x1F, 2, 108}, {0x29, 2, 108}, {0x38, 3, 108}, {0x03, 2, 109}, {0x06, 2, 109}, - {0x0a, 2, 109}, - {0x0f, 2, 109}, + {0x0A, 2, 109}, + {0x0F, 2, 109}, {0x18, 2, 109}, - {0x1f, 2, 109}, + {0x1F, 2, 109}, {0x29, 2, 109}, {0x38, 3, 109}, }, @@ -745,18 +745,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 110}, {0x06, 2, 110}, - {0x0a, 2, 110}, - {0x0f, 2, 110}, + {0x0A, 2, 110}, + {0x0F, 2, 110}, {0x18, 2, 110}, - {0x1f, 2, 110}, + {0x1F, 2, 110}, {0x29, 2, 110}, {0x38, 3, 110}, {0x03, 2, 112}, {0x06, 2, 112}, - {0x0a, 2, 112}, - {0x0f, 2, 112}, + {0x0A, 2, 112}, + {0x0F, 2, 112}, {0x18, 2, 112}, - {0x1f, 2, 112}, + {0x1F, 2, 112}, {0x29, 2, 112}, {0x38, 3, 112}, }, @@ -783,18 +783,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 114}, {0x06, 2, 114}, - {0x0a, 2, 114}, - {0x0f, 2, 114}, + {0x0A, 2, 114}, + {0x0F, 2, 114}, {0x18, 2, 114}, - {0x1f, 2, 114}, + {0x1F, 2, 114}, {0x29, 2, 114}, {0x38, 3, 114}, {0x03, 2, 117}, {0x06, 2, 117}, - {0x0a, 2, 117}, - {0x0f, 2, 117}, + {0x0A, 2, 117}, + {0x0F, 2, 117}, {0x18, 2, 117}, - {0x1f, 2, 117}, + {0x1F, 2, 117}, {0x29, 2, 117}, {0x38, 3, 117}, }, @@ -821,18 +821,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 58}, {0x06, 2, 58}, - {0x0a, 2, 58}, - {0x0f, 2, 58}, + {0x0A, 2, 58}, + {0x0F, 2, 58}, {0x18, 2, 58}, - {0x1f, 2, 58}, + {0x1F, 2, 58}, {0x29, 2, 58}, {0x38, 3, 58}, {0x03, 2, 66}, {0x06, 2, 66}, - {0x0a, 2, 66}, - {0x0f, 2, 66}, + {0x0A, 2, 66}, + {0x0F, 2, 66}, {0x18, 2, 66}, - {0x1f, 2, 66}, + {0x1F, 2, 66}, {0x29, 2, 66}, {0x38, 3, 66}, }, @@ -840,35 +840,35 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 67}, {0x06, 2, 67}, - {0x0a, 2, 67}, - {0x0f, 2, 67}, + {0x0A, 2, 67}, + {0x0F, 2, 67}, {0x18, 2, 67}, - {0x1f, 2, 67}, + {0x1F, 2, 67}, {0x29, 2, 67}, {0x38, 3, 67}, {0x03, 2, 68}, {0x06, 2, 68}, - {0x0a, 2, 68}, - {0x0f, 2, 68}, + {0x0A, 2, 68}, + {0x0F, 2, 68}, {0x18, 2, 68}, - {0x1f, 2, 68}, + {0x1F, 2, 68}, {0x29, 2, 68}, {0x38, 3, 68}, }, /* 40 */ { - {0x2c, 0, 0}, - {0x2d, 0, 0}, - {0x2f, 0, 0}, + {0x2C, 0, 0}, + {0x2D, 0, 0}, + {0x2F, 0, 0}, {0x30, 0, 0}, {0x33, 0, 0}, {0x34, 0, 0}, {0x36, 0, 0}, {0x37, 0, 0}, - {0x3b, 0, 0}, - {0x3c, 0, 0}, - {0x3e, 0, 0}, - {0x3f, 0, 0}, + {0x3B, 0, 0}, + {0x3C, 0, 0}, + {0x3E, 0, 0}, + {0x3F, 0, 0}, {0x42, 0, 0}, {0x43, 0, 0}, {0x45, 0, 0}, @@ -935,18 +935,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 69}, {0x06, 2, 69}, - {0x0a, 2, 69}, - {0x0f, 2, 69}, + {0x0A, 2, 69}, + {0x0F, 2, 69}, {0x18, 2, 69}, - {0x1f, 2, 69}, + {0x1F, 2, 69}, {0x29, 2, 69}, {0x38, 3, 69}, {0x03, 2, 70}, {0x06, 2, 70}, - {0x0a, 2, 70}, - {0x0f, 2, 70}, + {0x0A, 2, 70}, + {0x0F, 2, 70}, {0x18, 2, 70}, - {0x1f, 2, 70}, + {0x1F, 2, 70}, {0x29, 2, 70}, {0x38, 3, 70}, }, @@ -954,18 +954,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 71}, {0x06, 2, 71}, - {0x0a, 2, 71}, - {0x0f, 2, 71}, + {0x0A, 2, 71}, + {0x0F, 2, 71}, {0x18, 2, 71}, - {0x1f, 2, 71}, + {0x1F, 2, 71}, {0x29, 2, 71}, {0x38, 3, 71}, {0x03, 2, 72}, {0x06, 2, 72}, - {0x0a, 2, 72}, - {0x0f, 2, 72}, + {0x0A, 2, 72}, + {0x0F, 2, 72}, {0x18, 2, 72}, - {0x1f, 2, 72}, + {0x1F, 2, 72}, {0x29, 2, 72}, {0x38, 3, 72}, }, @@ -992,18 +992,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 73}, {0x06, 2, 73}, - {0x0a, 2, 73}, - {0x0f, 2, 73}, + {0x0A, 2, 73}, + {0x0F, 2, 73}, {0x18, 2, 73}, - {0x1f, 2, 73}, + {0x1F, 2, 73}, {0x29, 2, 73}, {0x38, 3, 73}, {0x03, 2, 74}, {0x06, 2, 74}, - {0x0a, 2, 74}, - {0x0f, 2, 74}, + {0x0A, 2, 74}, + {0x0F, 2, 74}, {0x18, 2, 74}, - {0x1f, 2, 74}, + {0x1F, 2, 74}, {0x29, 2, 74}, {0x38, 3, 74}, }, @@ -1011,18 +1011,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 75}, {0x06, 2, 75}, - {0x0a, 2, 75}, - {0x0f, 2, 75}, + {0x0A, 2, 75}, + {0x0F, 2, 75}, {0x18, 2, 75}, - {0x1f, 2, 75}, + {0x1F, 2, 75}, {0x29, 2, 75}, {0x38, 3, 75}, {0x03, 2, 76}, {0x06, 2, 76}, - {0x0a, 2, 76}, - {0x0f, 2, 76}, + {0x0A, 2, 76}, + {0x0F, 2, 76}, {0x18, 2, 76}, - {0x1f, 2, 76}, + {0x1F, 2, 76}, {0x29, 2, 76}, {0x38, 3, 76}, }, @@ -1068,18 +1068,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 77}, {0x06, 2, 77}, - {0x0a, 2, 77}, - {0x0f, 2, 77}, + {0x0A, 2, 77}, + {0x0F, 2, 77}, {0x18, 2, 77}, - {0x1f, 2, 77}, + {0x1F, 2, 77}, {0x29, 2, 77}, {0x38, 3, 77}, {0x03, 2, 78}, {0x06, 2, 78}, - {0x0a, 2, 78}, - {0x0f, 2, 78}, + {0x0A, 2, 78}, + {0x0F, 2, 78}, {0x18, 2, 78}, - {0x1f, 2, 78}, + {0x1F, 2, 78}, {0x29, 2, 78}, {0x38, 3, 78}, }, @@ -1087,18 +1087,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 79}, {0x06, 2, 79}, - {0x0a, 2, 79}, - {0x0f, 2, 79}, + {0x0A, 2, 79}, + {0x0F, 2, 79}, {0x18, 2, 79}, - {0x1f, 2, 79}, + {0x1F, 2, 79}, {0x29, 2, 79}, {0x38, 3, 79}, {0x03, 2, 80}, {0x06, 2, 80}, - {0x0a, 2, 80}, - {0x0f, 2, 80}, + {0x0A, 2, 80}, + {0x0F, 2, 80}, {0x18, 2, 80}, - {0x1f, 2, 80}, + {0x1F, 2, 80}, {0x29, 2, 80}, {0x38, 3, 80}, }, @@ -1125,18 +1125,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 81}, {0x06, 2, 81}, - {0x0a, 2, 81}, - {0x0f, 2, 81}, + {0x0A, 2, 81}, + {0x0F, 2, 81}, {0x18, 2, 81}, - {0x1f, 2, 81}, + {0x1F, 2, 81}, {0x29, 2, 81}, {0x38, 3, 81}, {0x03, 2, 82}, {0x06, 2, 82}, - {0x0a, 2, 82}, - {0x0f, 2, 82}, + {0x0A, 2, 82}, + {0x0F, 2, 82}, {0x18, 2, 82}, - {0x1f, 2, 82}, + {0x1F, 2, 82}, {0x29, 2, 82}, {0x38, 3, 82}, }, @@ -1144,18 +1144,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 83}, {0x06, 2, 83}, - {0x0a, 2, 83}, - {0x0f, 2, 83}, + {0x0A, 2, 83}, + {0x0F, 2, 83}, {0x18, 2, 83}, - {0x1f, 2, 83}, + {0x1F, 2, 83}, {0x29, 2, 83}, {0x38, 3, 83}, {0x03, 2, 84}, {0x06, 2, 84}, - {0x0a, 2, 84}, - {0x0f, 2, 84}, + {0x0A, 2, 84}, + {0x0F, 2, 84}, {0x18, 2, 84}, - {0x1f, 2, 84}, + {0x1F, 2, 84}, {0x29, 2, 84}, {0x38, 3, 84}, }, @@ -1176,7 +1176,7 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x46, 0, 0}, {0x47, 0, 0}, {0x49, 0, 0}, - {0x4a, 1, 0}, + {0x4A, 1, 0}, }, /* 57 */ { @@ -1220,18 +1220,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 85}, {0x06, 2, 85}, - {0x0a, 2, 85}, - {0x0f, 2, 85}, + {0x0A, 2, 85}, + {0x0F, 2, 85}, {0x18, 2, 85}, - {0x1f, 2, 85}, + {0x1F, 2, 85}, {0x29, 2, 85}, {0x38, 3, 85}, {0x03, 2, 86}, {0x06, 2, 86}, - {0x0a, 2, 86}, - {0x0f, 2, 86}, + {0x0A, 2, 86}, + {0x0F, 2, 86}, {0x18, 2, 86}, - {0x1f, 2, 86}, + {0x1F, 2, 86}, {0x29, 2, 86}, {0x38, 3, 86}, }, @@ -1239,18 +1239,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 87}, {0x06, 2, 87}, - {0x0a, 2, 87}, - {0x0f, 2, 87}, + {0x0A, 2, 87}, + {0x0F, 2, 87}, {0x18, 2, 87}, - {0x1f, 2, 87}, + {0x1F, 2, 87}, {0x29, 2, 87}, {0x38, 3, 87}, {0x03, 2, 89}, {0x06, 2, 89}, - {0x0a, 2, 89}, - {0x0f, 2, 89}, + {0x0A, 2, 89}, + {0x0F, 2, 89}, {0x18, 2, 89}, - {0x1f, 2, 89}, + {0x1F, 2, 89}, {0x29, 2, 89}, {0x38, 3, 89}, }, @@ -1277,18 +1277,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 106}, {0x06, 2, 106}, - {0x0a, 2, 106}, - {0x0f, 2, 106}, + {0x0A, 2, 106}, + {0x0F, 2, 106}, {0x18, 2, 106}, - {0x1f, 2, 106}, + {0x1F, 2, 106}, {0x29, 2, 106}, {0x38, 3, 106}, {0x03, 2, 107}, {0x06, 2, 107}, - {0x0a, 2, 107}, - {0x0f, 2, 107}, + {0x0A, 2, 107}, + {0x0F, 2, 107}, {0x18, 2, 107}, - {0x1f, 2, 107}, + {0x1F, 2, 107}, {0x29, 2, 107}, {0x38, 3, 107}, }, @@ -1296,18 +1296,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 113}, {0x06, 2, 113}, - {0x0a, 2, 113}, - {0x0f, 2, 113}, + {0x0A, 2, 113}, + {0x0F, 2, 113}, {0x18, 2, 113}, - {0x1f, 2, 113}, + {0x1F, 2, 113}, {0x29, 2, 113}, {0x38, 3, 113}, {0x03, 2, 118}, {0x06, 2, 118}, - {0x0a, 2, 118}, - {0x0f, 2, 118}, + {0x0A, 2, 118}, + {0x0F, 2, 118}, {0x18, 2, 118}, - {0x1f, 2, 118}, + {0x1F, 2, 118}, {0x29, 2, 118}, {0x38, 3, 118}, }, @@ -1327,8 +1327,8 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 59}, {0x00, 3, 88}, {0x00, 3, 90}, - {0x4b, 0, 0}, - {0x4e, 0, 0}, + {0x4B, 0, 0}, + {0x4E, 0, 0}, }, /* 65 */ { @@ -1353,18 +1353,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 119}, {0x06, 2, 119}, - {0x0a, 2, 119}, - {0x0f, 2, 119}, + {0x0A, 2, 119}, + {0x0F, 2, 119}, {0x18, 2, 119}, - {0x1f, 2, 119}, + {0x1F, 2, 119}, {0x29, 2, 119}, {0x38, 3, 119}, {0x03, 2, 120}, {0x06, 2, 120}, - {0x0a, 2, 120}, - {0x0f, 2, 120}, + {0x0A, 2, 120}, + {0x0F, 2, 120}, {0x18, 2, 120}, - {0x1f, 2, 120}, + {0x1F, 2, 120}, {0x29, 2, 120}, {0x38, 3, 120}, }, @@ -1372,18 +1372,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 121}, {0x06, 2, 121}, - {0x0a, 2, 121}, - {0x0f, 2, 121}, + {0x0A, 2, 121}, + {0x0F, 2, 121}, {0x18, 2, 121}, - {0x1f, 2, 121}, + {0x1F, 2, 121}, {0x29, 2, 121}, {0x38, 3, 121}, {0x03, 2, 122}, {0x06, 2, 122}, - {0x0a, 2, 122}, - {0x0f, 2, 122}, + {0x0A, 2, 122}, + {0x0F, 2, 122}, {0x18, 2, 122}, - {0x1f, 2, 122}, + {0x1F, 2, 122}, {0x29, 2, 122}, {0x38, 3, 122}, }, @@ -1401,9 +1401,9 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x16, 3, 88}, {0x01, 2, 90}, {0x16, 3, 90}, - {0x4c, 0, 0}, - {0x4d, 0, 0}, - {0x4f, 0, 0}, + {0x4C, 0, 0}, + {0x4D, 0, 0}, + {0x4F, 0, 0}, {0x51, 0, 0}, }, /* 69 */ @@ -1429,18 +1429,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 38}, {0x06, 2, 38}, - {0x0a, 2, 38}, - {0x0f, 2, 38}, + {0x0A, 2, 38}, + {0x0F, 2, 38}, {0x18, 2, 38}, - {0x1f, 2, 38}, + {0x1F, 2, 38}, {0x29, 2, 38}, {0x38, 3, 38}, {0x03, 2, 42}, {0x06, 2, 42}, - {0x0a, 2, 42}, - {0x0f, 2, 42}, + {0x0A, 2, 42}, + {0x0F, 2, 42}, {0x18, 2, 42}, - {0x1f, 2, 42}, + {0x1F, 2, 42}, {0x29, 2, 42}, {0x38, 3, 42}, }, @@ -1448,18 +1448,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 44}, {0x06, 2, 44}, - {0x0a, 2, 44}, - {0x0f, 2, 44}, + {0x0A, 2, 44}, + {0x0F, 2, 44}, {0x18, 2, 44}, - {0x1f, 2, 44}, + {0x1F, 2, 44}, {0x29, 2, 44}, {0x38, 3, 44}, {0x03, 2, 59}, {0x06, 2, 59}, - {0x0a, 2, 59}, - {0x0f, 2, 59}, + {0x0A, 2, 59}, + {0x0F, 2, 59}, {0x18, 2, 59}, - {0x1f, 2, 59}, + {0x1F, 2, 59}, {0x29, 2, 59}, {0x38, 3, 59}, }, @@ -1486,18 +1486,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 88}, {0x06, 2, 88}, - {0x0a, 2, 88}, - {0x0f, 2, 88}, + {0x0A, 2, 88}, + {0x0F, 2, 88}, {0x18, 2, 88}, - {0x1f, 2, 88}, + {0x1F, 2, 88}, {0x29, 2, 88}, {0x38, 3, 88}, {0x03, 2, 90}, {0x06, 2, 90}, - {0x0a, 2, 90}, - {0x0f, 2, 90}, + {0x0A, 2, 90}, + {0x0F, 2, 90}, {0x18, 2, 90}, - {0x1f, 2, 90}, + {0x1F, 2, 90}, {0x29, 2, 90}, {0x38, 3, 90}, }, @@ -1543,18 +1543,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 33}, {0x06, 2, 33}, - {0x0a, 2, 33}, - {0x0f, 2, 33}, + {0x0A, 2, 33}, + {0x0F, 2, 33}, {0x18, 2, 33}, - {0x1f, 2, 33}, + {0x1F, 2, 33}, {0x29, 2, 33}, {0x38, 3, 33}, {0x03, 2, 34}, {0x06, 2, 34}, - {0x0a, 2, 34}, - {0x0f, 2, 34}, + {0x0A, 2, 34}, + {0x0F, 2, 34}, {0x18, 2, 34}, - {0x1f, 2, 34}, + {0x1F, 2, 34}, {0x29, 2, 34}, {0x38, 3, 34}, }, @@ -1562,18 +1562,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 40}, {0x06, 2, 40}, - {0x0a, 2, 40}, - {0x0f, 2, 40}, + {0x0A, 2, 40}, + {0x0F, 2, 40}, {0x18, 2, 40}, - {0x1f, 2, 40}, + {0x1F, 2, 40}, {0x29, 2, 40}, {0x38, 3, 40}, {0x03, 2, 41}, {0x06, 2, 41}, - {0x0a, 2, 41}, - {0x0f, 2, 41}, + {0x0A, 2, 41}, + {0x0F, 2, 41}, {0x18, 2, 41}, - {0x1f, 2, 41}, + {0x1F, 2, 41}, {0x29, 2, 41}, {0x38, 3, 41}, }, @@ -1594,16 +1594,16 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x56, 0, 0}, {0x57, 0, 0}, {0x59, 0, 0}, - {0x5a, 0, 0}, + {0x5A, 0, 0}, }, /* 79 */ { {0x03, 2, 63}, {0x06, 2, 63}, - {0x0a, 2, 63}, - {0x0f, 2, 63}, + {0x0A, 2, 63}, + {0x0F, 2, 63}, {0x18, 2, 63}, - {0x1f, 2, 63}, + {0x1F, 2, 63}, {0x29, 2, 63}, {0x38, 3, 63}, {0x02, 2, 39}, @@ -1619,18 +1619,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 39}, {0x06, 2, 39}, - {0x0a, 2, 39}, - {0x0f, 2, 39}, + {0x0A, 2, 39}, + {0x0F, 2, 39}, {0x18, 2, 39}, - {0x1f, 2, 39}, + {0x1F, 2, 39}, {0x29, 2, 39}, {0x38, 3, 39}, {0x03, 2, 43}, {0x06, 2, 43}, - {0x0a, 2, 43}, - {0x0f, 2, 43}, + {0x0A, 2, 43}, + {0x0F, 2, 43}, {0x18, 2, 43}, - {0x1f, 2, 43}, + {0x1F, 2, 43}, {0x29, 2, 43}, {0x38, 3, 43}, }, @@ -1650,17 +1650,17 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 91}, {0x00, 3, 93}, {0x00, 3, 126}, - {0x5b, 0, 0}, - {0x5c, 0, 0}, + {0x5B, 0, 0}, + {0x5C, 0, 0}, }, /* 82 */ { {0x03, 2, 124}, {0x06, 2, 124}, - {0x0a, 2, 124}, - {0x0f, 2, 124}, + {0x0A, 2, 124}, + {0x0F, 2, 124}, {0x18, 2, 124}, - {0x1f, 2, 124}, + {0x1F, 2, 124}, {0x29, 2, 124}, {0x38, 3, 124}, {0x02, 2, 35}, @@ -1676,18 +1676,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 35}, {0x06, 2, 35}, - {0x0a, 2, 35}, - {0x0f, 2, 35}, + {0x0A, 2, 35}, + {0x0F, 2, 35}, {0x18, 2, 35}, - {0x1f, 2, 35}, + {0x1F, 2, 35}, {0x29, 2, 35}, {0x38, 3, 35}, {0x03, 2, 62}, {0x06, 2, 62}, - {0x0a, 2, 62}, - {0x0f, 2, 62}, + {0x0A, 2, 62}, + {0x0F, 2, 62}, {0x18, 2, 62}, - {0x1f, 2, 62}, + {0x1F, 2, 62}, {0x29, 2, 62}, {0x38, 3, 62}, }, @@ -1707,8 +1707,8 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x16, 3, 126}, {0x00, 3, 94}, {0x00, 3, 125}, - {0x5d, 0, 0}, - {0x5e, 0, 0}, + {0x5D, 0, 0}, + {0x5E, 0, 0}, }, /* 85 */ { @@ -1733,18 +1733,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 0}, {0x06, 2, 0}, - {0x0a, 2, 0}, - {0x0f, 2, 0}, + {0x0A, 2, 0}, + {0x0F, 2, 0}, {0x18, 2, 0}, - {0x1f, 2, 0}, + {0x1F, 2, 0}, {0x29, 2, 0}, {0x38, 3, 0}, {0x03, 2, 36}, {0x06, 2, 36}, - {0x0a, 2, 36}, - {0x0f, 2, 36}, + {0x0A, 2, 36}, + {0x0F, 2, 36}, {0x18, 2, 36}, - {0x1f, 2, 36}, + {0x1F, 2, 36}, {0x29, 2, 36}, {0x38, 3, 36}, }, @@ -1752,18 +1752,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 64}, {0x06, 2, 64}, - {0x0a, 2, 64}, - {0x0f, 2, 64}, + {0x0A, 2, 64}, + {0x0F, 2, 64}, {0x18, 2, 64}, - {0x1f, 2, 64}, + {0x1F, 2, 64}, {0x29, 2, 64}, {0x38, 3, 64}, {0x03, 2, 91}, {0x06, 2, 91}, - {0x0a, 2, 91}, - {0x0f, 2, 91}, + {0x0A, 2, 91}, + {0x0F, 2, 91}, {0x18, 2, 91}, - {0x1f, 2, 91}, + {0x1F, 2, 91}, {0x29, 2, 91}, {0x38, 3, 91}, }, @@ -1784,24 +1784,24 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 60}, {0x00, 3, 96}, {0x00, 3, 123}, - {0x5f, 0, 0}, + {0x5F, 0, 0}, }, /* 89 */ { {0x03, 2, 93}, {0x06, 2, 93}, - {0x0a, 2, 93}, - {0x0f, 2, 93}, + {0x0A, 2, 93}, + {0x0F, 2, 93}, {0x18, 2, 93}, - {0x1f, 2, 93}, + {0x1F, 2, 93}, {0x29, 2, 93}, {0x38, 3, 93}, {0x03, 2, 126}, {0x06, 2, 126}, - {0x0a, 2, 126}, - {0x0f, 2, 126}, + {0x0A, 2, 126}, + {0x0F, 2, 126}, {0x18, 2, 126}, - {0x1f, 2, 126}, + {0x1F, 2, 126}, {0x29, 2, 126}, {0x38, 3, 126}, }, @@ -1822,24 +1822,24 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x01, 2, 123}, {0x16, 3, 123}, {0x60, 0, 0}, - {0x6e, 0, 0}, + {0x6E, 0, 0}, }, /* 91 */ { {0x03, 2, 94}, {0x06, 2, 94}, - {0x0a, 2, 94}, - {0x0f, 2, 94}, + {0x0A, 2, 94}, + {0x0F, 2, 94}, {0x18, 2, 94}, - {0x1f, 2, 94}, + {0x1F, 2, 94}, {0x29, 2, 94}, {0x38, 3, 94}, {0x03, 2, 125}, {0x06, 2, 125}, - {0x0a, 2, 125}, - {0x0f, 2, 125}, + {0x0A, 2, 125}, + {0x0F, 2, 125}, {0x18, 2, 125}, - {0x1f, 2, 125}, + {0x1F, 2, 125}, {0x29, 2, 125}, {0x38, 3, 125}, }, @@ -1859,25 +1859,25 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x28, 3, 123}, {0x61, 0, 0}, {0x65, 0, 0}, - {0x6f, 0, 0}, + {0x6F, 0, 0}, {0x85, 0, 0}, }, /* 93 */ { {0x03, 2, 60}, {0x06, 2, 60}, - {0x0a, 2, 60}, - {0x0f, 2, 60}, + {0x0A, 2, 60}, + {0x0F, 2, 60}, {0x18, 2, 60}, - {0x1f, 2, 60}, + {0x1F, 2, 60}, {0x29, 2, 60}, {0x38, 3, 60}, {0x03, 2, 96}, {0x06, 2, 96}, - {0x0a, 2, 96}, - {0x0f, 2, 96}, + {0x0A, 2, 96}, + {0x0F, 2, 96}, {0x18, 2, 96}, - {0x1f, 2, 96}, + {0x1F, 2, 96}, {0x29, 2, 96}, {0x38, 3, 96}, }, @@ -1885,10 +1885,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 123}, {0x06, 2, 123}, - {0x0a, 2, 123}, - {0x0f, 2, 123}, + {0x0A, 2, 123}, + {0x0F, 2, 123}, {0x18, 2, 123}, - {0x1f, 2, 123}, + {0x1F, 2, 123}, {0x29, 2, 123}, {0x38, 3, 123}, {0x62, 0, 0}, @@ -1908,16 +1908,16 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x64, 0, 0}, {0x67, 0, 0}, {0x68, 0, 0}, - {0x6a, 0, 0}, - {0x6b, 0, 0}, + {0x6A, 0, 0}, + {0x6B, 0, 0}, {0x71, 0, 0}, {0x74, 0, 0}, {0x78, 0, 0}, - {0x7e, 0, 0}, + {0x7E, 0, 0}, {0x87, 0, 0}, - {0x8e, 0, 0}, - {0x9a, 0, 0}, - {0xa9, 0, 0}, + {0x8E, 0, 0}, + {0x9A, 0, 0}, + {0xA9, 0, 0}, }, /* 96 */ { @@ -1935,8 +1935,8 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 194}, {0x00, 3, 224}, {0x00, 3, 226}, - {0x6c, 0, 0}, - {0x6d, 0, 0}, + {0x6C, 0, 0}, + {0x6D, 0, 0}, }, /* 97 */ { @@ -1961,18 +1961,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 92}, {0x06, 2, 92}, - {0x0a, 2, 92}, - {0x0f, 2, 92}, + {0x0A, 2, 92}, + {0x0F, 2, 92}, {0x18, 2, 92}, - {0x1f, 2, 92}, + {0x1F, 2, 92}, {0x29, 2, 92}, {0x38, 3, 92}, {0x03, 2, 195}, {0x06, 2, 195}, - {0x0a, 2, 195}, - {0x0f, 2, 195}, + {0x0A, 2, 195}, + {0x0F, 2, 195}, {0x18, 2, 195}, - {0x1f, 2, 195}, + {0x1F, 2, 195}, {0x29, 2, 195}, {0x38, 3, 195}, }, @@ -1980,10 +1980,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 208}, {0x06, 2, 208}, - {0x0a, 2, 208}, - {0x0f, 2, 208}, + {0x0A, 2, 208}, + {0x0F, 2, 208}, {0x18, 2, 208}, - {0x1f, 2, 208}, + {0x1F, 2, 208}, {0x29, 2, 208}, {0x38, 3, 208}, {0x02, 2, 128}, @@ -1999,18 +1999,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 128}, {0x06, 2, 128}, - {0x0a, 2, 128}, - {0x0f, 2, 128}, + {0x0A, 2, 128}, + {0x0F, 2, 128}, {0x18, 2, 128}, - {0x1f, 2, 128}, + {0x1F, 2, 128}, {0x29, 2, 128}, {0x38, 3, 128}, {0x03, 2, 130}, {0x06, 2, 130}, - {0x0a, 2, 130}, - {0x0f, 2, 130}, + {0x0A, 2, 130}, + {0x0F, 2, 130}, {0x18, 2, 130}, - {0x1f, 2, 130}, + {0x1F, 2, 130}, {0x29, 2, 130}, {0x38, 3, 130}, }, @@ -2056,18 +2056,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 131}, {0x06, 2, 131}, - {0x0a, 2, 131}, - {0x0f, 2, 131}, + {0x0A, 2, 131}, + {0x0F, 2, 131}, {0x18, 2, 131}, - {0x1f, 2, 131}, + {0x1F, 2, 131}, {0x29, 2, 131}, {0x38, 3, 131}, {0x03, 2, 162}, {0x06, 2, 162}, - {0x0a, 2, 162}, - {0x0f, 2, 162}, + {0x0A, 2, 162}, + {0x0F, 2, 162}, {0x18, 2, 162}, - {0x1f, 2, 162}, + {0x1F, 2, 162}, {0x29, 2, 162}, {0x38, 3, 162}, }, @@ -2075,18 +2075,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 184}, {0x06, 2, 184}, - {0x0a, 2, 184}, - {0x0f, 2, 184}, + {0x0A, 2, 184}, + {0x0F, 2, 184}, {0x18, 2, 184}, - {0x1f, 2, 184}, + {0x1F, 2, 184}, {0x29, 2, 184}, {0x38, 3, 184}, {0x03, 2, 194}, {0x06, 2, 194}, - {0x0a, 2, 194}, - {0x0f, 2, 194}, + {0x0A, 2, 194}, + {0x0F, 2, 194}, {0x18, 2, 194}, - {0x1f, 2, 194}, + {0x1F, 2, 194}, {0x29, 2, 194}, {0x38, 3, 194}, }, @@ -2113,18 +2113,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 224}, {0x06, 2, 224}, - {0x0a, 2, 224}, - {0x0f, 2, 224}, + {0x0A, 2, 224}, + {0x0F, 2, 224}, {0x18, 2, 224}, - {0x1f, 2, 224}, + {0x1F, 2, 224}, {0x29, 2, 224}, {0x38, 3, 224}, {0x03, 2, 226}, {0x06, 2, 226}, - {0x0a, 2, 226}, - {0x0f, 2, 226}, + {0x0A, 2, 226}, + {0x0F, 2, 226}, {0x18, 2, 226}, - {0x1f, 2, 226}, + {0x1F, 2, 226}, {0x29, 2, 226}, {0x38, 3, 226}, }, @@ -2151,18 +2151,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 153}, {0x06, 2, 153}, - {0x0a, 2, 153}, - {0x0f, 2, 153}, + {0x0A, 2, 153}, + {0x0F, 2, 153}, {0x18, 2, 153}, - {0x1f, 2, 153}, + {0x1F, 2, 153}, {0x29, 2, 153}, {0x38, 3, 153}, {0x03, 2, 161}, {0x06, 2, 161}, - {0x0a, 2, 161}, - {0x0f, 2, 161}, + {0x0A, 2, 161}, + {0x0F, 2, 161}, {0x18, 2, 161}, - {0x1f, 2, 161}, + {0x1F, 2, 161}, {0x29, 2, 161}, {0x38, 3, 161}, }, @@ -2170,18 +2170,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 167}, {0x06, 2, 167}, - {0x0a, 2, 167}, - {0x0f, 2, 167}, + {0x0A, 2, 167}, + {0x0F, 2, 167}, {0x18, 2, 167}, - {0x1f, 2, 167}, + {0x1F, 2, 167}, {0x29, 2, 167}, {0x38, 3, 167}, {0x03, 2, 172}, {0x06, 2, 172}, - {0x0a, 2, 172}, - {0x0f, 2, 172}, + {0x0A, 2, 172}, + {0x0F, 2, 172}, {0x18, 2, 172}, - {0x1f, 2, 172}, + {0x1F, 2, 172}, {0x29, 2, 172}, {0x38, 3, 172}, }, @@ -2192,17 +2192,17 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x75, 0, 0}, {0x76, 0, 0}, {0x79, 0, 0}, - {0x7b, 0, 0}, - {0x7f, 0, 0}, + {0x7B, 0, 0}, + {0x7F, 0, 0}, {0x82, 0, 0}, {0x88, 0, 0}, - {0x8b, 0, 0}, - {0x8f, 0, 0}, + {0x8B, 0, 0}, + {0x8F, 0, 0}, {0x92, 0, 0}, - {0x9b, 0, 0}, - {0xa2, 0, 0}, - {0xaa, 0, 0}, - {0xb4, 0, 0}, + {0x9B, 0, 0}, + {0xA2, 0, 0}, + {0xAA, 0, 0}, + {0xB4, 0, 0}, }, /* 111 */ { @@ -2215,9 +2215,9 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 227}, {0x00, 3, 229}, {0x00, 3, 230}, - {0x7a, 0, 0}, - {0x7c, 0, 0}, - {0x7d, 0, 0}, + {0x7A, 0, 0}, + {0x7C, 0, 0}, + {0x7D, 0, 0}, {0x80, 0, 0}, {0x81, 0, 0}, {0x83, 0, 0}, @@ -2265,18 +2265,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 176}, {0x06, 2, 176}, - {0x0a, 2, 176}, - {0x0f, 2, 176}, + {0x0A, 2, 176}, + {0x0F, 2, 176}, {0x18, 2, 176}, - {0x1f, 2, 176}, + {0x1F, 2, 176}, {0x29, 2, 176}, {0x38, 3, 176}, {0x03, 2, 177}, {0x06, 2, 177}, - {0x0a, 2, 177}, - {0x0f, 2, 177}, + {0x0A, 2, 177}, + {0x0F, 2, 177}, {0x18, 2, 177}, - {0x1f, 2, 177}, + {0x1F, 2, 177}, {0x29, 2, 177}, {0x38, 3, 177}, }, @@ -2284,18 +2284,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 179}, {0x06, 2, 179}, - {0x0a, 2, 179}, - {0x0f, 2, 179}, + {0x0A, 2, 179}, + {0x0F, 2, 179}, {0x18, 2, 179}, - {0x1f, 2, 179}, + {0x1F, 2, 179}, {0x29, 2, 179}, {0x38, 3, 179}, {0x03, 2, 209}, {0x06, 2, 209}, - {0x0a, 2, 209}, - {0x0f, 2, 209}, + {0x0A, 2, 209}, + {0x0F, 2, 209}, {0x18, 2, 209}, - {0x1f, 2, 209}, + {0x1F, 2, 209}, {0x29, 2, 209}, {0x38, 3, 209}, }, @@ -2322,18 +2322,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 216}, {0x06, 2, 216}, - {0x0a, 2, 216}, - {0x0f, 2, 216}, + {0x0A, 2, 216}, + {0x0F, 2, 216}, {0x18, 2, 216}, - {0x1f, 2, 216}, + {0x1F, 2, 216}, {0x29, 2, 216}, {0x38, 3, 216}, {0x03, 2, 217}, {0x06, 2, 217}, - {0x0a, 2, 217}, - {0x0f, 2, 217}, + {0x0A, 2, 217}, + {0x0F, 2, 217}, {0x18, 2, 217}, - {0x1f, 2, 217}, + {0x1F, 2, 217}, {0x29, 2, 217}, {0x38, 3, 217}, }, @@ -2341,18 +2341,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 227}, {0x06, 2, 227}, - {0x0a, 2, 227}, - {0x0f, 2, 227}, + {0x0A, 2, 227}, + {0x0F, 2, 227}, {0x18, 2, 227}, - {0x1f, 2, 227}, + {0x1F, 2, 227}, {0x29, 2, 227}, {0x38, 3, 227}, {0x03, 2, 229}, {0x06, 2, 229}, - {0x0a, 2, 229}, - {0x0f, 2, 229}, + {0x0A, 2, 229}, + {0x0F, 2, 229}, {0x18, 2, 229}, - {0x1f, 2, 229}, + {0x1F, 2, 229}, {0x29, 2, 229}, {0x38, 3, 229}, }, @@ -2398,10 +2398,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 230}, {0x06, 2, 230}, - {0x0a, 2, 230}, - {0x0f, 2, 230}, + {0x0A, 2, 230}, + {0x0F, 2, 230}, {0x18, 2, 230}, - {0x1f, 2, 230}, + {0x1F, 2, 230}, {0x29, 2, 230}, {0x38, 3, 230}, {0x02, 2, 129}, @@ -2417,18 +2417,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 129}, {0x06, 2, 129}, - {0x0a, 2, 129}, - {0x0f, 2, 129}, + {0x0A, 2, 129}, + {0x0F, 2, 129}, {0x18, 2, 129}, - {0x1f, 2, 129}, + {0x1F, 2, 129}, {0x29, 2, 129}, {0x38, 3, 129}, {0x03, 2, 132}, {0x06, 2, 132}, - {0x0a, 2, 132}, - {0x0f, 2, 132}, + {0x0A, 2, 132}, + {0x0F, 2, 132}, {0x18, 2, 132}, - {0x1f, 2, 132}, + {0x1F, 2, 132}, {0x29, 2, 132}, {0x38, 3, 132}, }, @@ -2455,18 +2455,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 133}, {0x06, 2, 133}, - {0x0a, 2, 133}, - {0x0f, 2, 133}, + {0x0A, 2, 133}, + {0x0F, 2, 133}, {0x18, 2, 133}, - {0x1f, 2, 133}, + {0x1F, 2, 133}, {0x29, 2, 133}, {0x38, 3, 133}, {0x03, 2, 134}, {0x06, 2, 134}, - {0x0a, 2, 134}, - {0x0f, 2, 134}, + {0x0A, 2, 134}, + {0x0F, 2, 134}, {0x18, 2, 134}, - {0x1f, 2, 134}, + {0x1F, 2, 134}, {0x29, 2, 134}, {0x38, 3, 134}, }, @@ -2474,18 +2474,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 136}, {0x06, 2, 136}, - {0x0a, 2, 136}, - {0x0f, 2, 136}, + {0x0A, 2, 136}, + {0x0F, 2, 136}, {0x18, 2, 136}, - {0x1f, 2, 136}, + {0x1F, 2, 136}, {0x29, 2, 136}, {0x38, 3, 136}, {0x03, 2, 146}, {0x06, 2, 146}, - {0x0a, 2, 146}, - {0x0f, 2, 146}, + {0x0A, 2, 146}, + {0x0F, 2, 146}, {0x18, 2, 146}, - {0x1f, 2, 146}, + {0x1F, 2, 146}, {0x29, 2, 146}, {0x38, 3, 146}, }, @@ -2531,18 +2531,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 154}, {0x06, 2, 154}, - {0x0a, 2, 154}, - {0x0f, 2, 154}, + {0x0A, 2, 154}, + {0x0F, 2, 154}, {0x18, 2, 154}, - {0x1f, 2, 154}, + {0x1F, 2, 154}, {0x29, 2, 154}, {0x38, 3, 154}, {0x03, 2, 156}, {0x06, 2, 156}, - {0x0a, 2, 156}, - {0x0f, 2, 156}, + {0x0A, 2, 156}, + {0x0F, 2, 156}, {0x18, 2, 156}, - {0x1f, 2, 156}, + {0x1F, 2, 156}, {0x29, 2, 156}, {0x38, 3, 156}, }, @@ -2550,18 +2550,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 160}, {0x06, 2, 160}, - {0x0a, 2, 160}, - {0x0f, 2, 160}, + {0x0A, 2, 160}, + {0x0F, 2, 160}, {0x18, 2, 160}, - {0x1f, 2, 160}, + {0x1F, 2, 160}, {0x29, 2, 160}, {0x38, 3, 160}, {0x03, 2, 163}, {0x06, 2, 163}, - {0x0a, 2, 163}, - {0x0f, 2, 163}, + {0x0A, 2, 163}, + {0x0F, 2, 163}, {0x18, 2, 163}, - {0x1f, 2, 163}, + {0x1F, 2, 163}, {0x29, 2, 163}, {0x38, 3, 163}, }, @@ -2588,18 +2588,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 164}, {0x06, 2, 164}, - {0x0a, 2, 164}, - {0x0f, 2, 164}, + {0x0A, 2, 164}, + {0x0F, 2, 164}, {0x18, 2, 164}, - {0x1f, 2, 164}, + {0x1F, 2, 164}, {0x29, 2, 164}, {0x38, 3, 164}, {0x03, 2, 169}, {0x06, 2, 169}, - {0x0a, 2, 169}, - {0x0f, 2, 169}, + {0x0A, 2, 169}, + {0x0F, 2, 169}, {0x18, 2, 169}, - {0x1f, 2, 169}, + {0x1F, 2, 169}, {0x29, 2, 169}, {0x38, 3, 169}, }, @@ -2607,39 +2607,39 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 170}, {0x06, 2, 170}, - {0x0a, 2, 170}, - {0x0f, 2, 170}, + {0x0A, 2, 170}, + {0x0F, 2, 170}, {0x18, 2, 170}, - {0x1f, 2, 170}, + {0x1F, 2, 170}, {0x29, 2, 170}, {0x38, 3, 170}, {0x03, 2, 173}, {0x06, 2, 173}, - {0x0a, 2, 173}, - {0x0f, 2, 173}, + {0x0A, 2, 173}, + {0x0F, 2, 173}, {0x18, 2, 173}, - {0x1f, 2, 173}, + {0x1F, 2, 173}, {0x29, 2, 173}, {0x38, 3, 173}, }, /* 133 */ { {0x89, 0, 0}, - {0x8a, 0, 0}, - {0x8c, 0, 0}, - {0x8d, 0, 0}, + {0x8A, 0, 0}, + {0x8C, 0, 0}, + {0x8D, 0, 0}, {0x90, 0, 0}, {0x91, 0, 0}, {0x93, 0, 0}, {0x96, 0, 0}, - {0x9c, 0, 0}, - {0x9f, 0, 0}, - {0xa3, 0, 0}, - {0xa6, 0, 0}, - {0xab, 0, 0}, - {0xae, 0, 0}, - {0xb5, 0, 0}, - {0xbe, 0, 0}, + {0x9C, 0, 0}, + {0x9F, 0, 0}, + {0xA3, 0, 0}, + {0xA6, 0, 0}, + {0xAB, 0, 0}, + {0xAE, 0, 0}, + {0xB5, 0, 0}, + {0xBE, 0, 0}, }, /* 134 */ { @@ -2702,18 +2702,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 178}, {0x06, 2, 178}, - {0x0a, 2, 178}, - {0x0f, 2, 178}, + {0x0A, 2, 178}, + {0x0F, 2, 178}, {0x18, 2, 178}, - {0x1f, 2, 178}, + {0x1F, 2, 178}, {0x29, 2, 178}, {0x38, 3, 178}, {0x03, 2, 181}, {0x06, 2, 181}, - {0x0a, 2, 181}, - {0x0f, 2, 181}, + {0x0A, 2, 181}, + {0x0F, 2, 181}, {0x18, 2, 181}, - {0x1f, 2, 181}, + {0x1F, 2, 181}, {0x29, 2, 181}, {0x38, 3, 181}, }, @@ -2721,18 +2721,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 185}, {0x06, 2, 185}, - {0x0a, 2, 185}, - {0x0f, 2, 185}, + {0x0A, 2, 185}, + {0x0F, 2, 185}, {0x18, 2, 185}, - {0x1f, 2, 185}, + {0x1F, 2, 185}, {0x29, 2, 185}, {0x38, 3, 185}, {0x03, 2, 186}, {0x06, 2, 186}, - {0x0a, 2, 186}, - {0x0f, 2, 186}, + {0x0A, 2, 186}, + {0x0F, 2, 186}, {0x18, 2, 186}, - {0x1f, 2, 186}, + {0x1F, 2, 186}, {0x29, 2, 186}, {0x38, 3, 186}, }, @@ -2759,18 +2759,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 187}, {0x06, 2, 187}, - {0x0a, 2, 187}, - {0x0f, 2, 187}, + {0x0A, 2, 187}, + {0x0F, 2, 187}, {0x18, 2, 187}, - {0x1f, 2, 187}, + {0x1F, 2, 187}, {0x29, 2, 187}, {0x38, 3, 187}, {0x03, 2, 189}, {0x06, 2, 189}, - {0x0a, 2, 189}, - {0x0f, 2, 189}, + {0x0A, 2, 189}, + {0x0F, 2, 189}, {0x18, 2, 189}, - {0x1f, 2, 189}, + {0x1F, 2, 189}, {0x29, 2, 189}, {0x38, 3, 189}, }, @@ -2778,18 +2778,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 190}, {0x06, 2, 190}, - {0x0a, 2, 190}, - {0x0f, 2, 190}, + {0x0A, 2, 190}, + {0x0F, 2, 190}, {0x18, 2, 190}, - {0x1f, 2, 190}, + {0x1F, 2, 190}, {0x29, 2, 190}, {0x38, 3, 190}, {0x03, 2, 196}, {0x06, 2, 196}, - {0x0a, 2, 196}, - {0x0f, 2, 196}, + {0x0A, 2, 196}, + {0x0F, 2, 196}, {0x18, 2, 196}, - {0x1f, 2, 196}, + {0x1F, 2, 196}, {0x29, 2, 196}, {0x38, 3, 196}, }, @@ -2835,18 +2835,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 198}, {0x06, 2, 198}, - {0x0a, 2, 198}, - {0x0f, 2, 198}, + {0x0A, 2, 198}, + {0x0F, 2, 198}, {0x18, 2, 198}, - {0x1f, 2, 198}, + {0x1F, 2, 198}, {0x29, 2, 198}, {0x38, 3, 198}, {0x03, 2, 228}, {0x06, 2, 228}, - {0x0a, 2, 228}, - {0x0f, 2, 228}, + {0x0A, 2, 228}, + {0x0F, 2, 228}, {0x18, 2, 228}, - {0x1f, 2, 228}, + {0x1F, 2, 228}, {0x29, 2, 228}, {0x38, 3, 228}, }, @@ -2854,18 +2854,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 232}, {0x06, 2, 232}, - {0x0a, 2, 232}, - {0x0f, 2, 232}, + {0x0A, 2, 232}, + {0x0F, 2, 232}, {0x18, 2, 232}, - {0x1f, 2, 232}, + {0x1F, 2, 232}, {0x29, 2, 232}, {0x38, 3, 232}, {0x03, 2, 233}, {0x06, 2, 233}, - {0x0a, 2, 233}, - {0x0f, 2, 233}, + {0x0A, 2, 233}, + {0x0F, 2, 233}, {0x18, 2, 233}, - {0x1f, 2, 233}, + {0x1F, 2, 233}, {0x29, 2, 233}, {0x38, 3, 233}, }, @@ -2911,18 +2911,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 1}, {0x06, 2, 1}, - {0x0a, 2, 1}, - {0x0f, 2, 1}, + {0x0A, 2, 1}, + {0x0F, 2, 1}, {0x18, 2, 1}, - {0x1f, 2, 1}, + {0x1F, 2, 1}, {0x29, 2, 1}, {0x38, 3, 1}, {0x03, 2, 135}, {0x06, 2, 135}, - {0x0a, 2, 135}, - {0x0f, 2, 135}, + {0x0A, 2, 135}, + {0x0F, 2, 135}, {0x18, 2, 135}, - {0x1f, 2, 135}, + {0x1F, 2, 135}, {0x29, 2, 135}, {0x38, 3, 135}, }, @@ -2930,18 +2930,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 137}, {0x06, 2, 137}, - {0x0a, 2, 137}, - {0x0f, 2, 137}, + {0x0A, 2, 137}, + {0x0F, 2, 137}, {0x18, 2, 137}, - {0x1f, 2, 137}, + {0x1F, 2, 137}, {0x29, 2, 137}, {0x38, 3, 137}, {0x03, 2, 138}, {0x06, 2, 138}, - {0x0a, 2, 138}, - {0x0f, 2, 138}, + {0x0A, 2, 138}, + {0x0F, 2, 138}, {0x18, 2, 138}, - {0x1f, 2, 138}, + {0x1F, 2, 138}, {0x29, 2, 138}, {0x38, 3, 138}, }, @@ -2968,18 +2968,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 139}, {0x06, 2, 139}, - {0x0a, 2, 139}, - {0x0f, 2, 139}, + {0x0A, 2, 139}, + {0x0F, 2, 139}, {0x18, 2, 139}, - {0x1f, 2, 139}, + {0x1F, 2, 139}, {0x29, 2, 139}, {0x38, 3, 139}, {0x03, 2, 140}, {0x06, 2, 140}, - {0x0a, 2, 140}, - {0x0f, 2, 140}, + {0x0A, 2, 140}, + {0x0F, 2, 140}, {0x18, 2, 140}, - {0x1f, 2, 140}, + {0x1F, 2, 140}, {0x29, 2, 140}, {0x38, 3, 140}, }, @@ -2987,39 +2987,39 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 141}, {0x06, 2, 141}, - {0x0a, 2, 141}, - {0x0f, 2, 141}, + {0x0A, 2, 141}, + {0x0F, 2, 141}, {0x18, 2, 141}, - {0x1f, 2, 141}, + {0x1F, 2, 141}, {0x29, 2, 141}, {0x38, 3, 141}, {0x03, 2, 143}, {0x06, 2, 143}, - {0x0a, 2, 143}, - {0x0f, 2, 143}, + {0x0A, 2, 143}, + {0x0F, 2, 143}, {0x18, 2, 143}, - {0x1f, 2, 143}, + {0x1F, 2, 143}, {0x29, 2, 143}, {0x38, 3, 143}, }, /* 153 */ { - {0x9d, 0, 0}, - {0x9e, 0, 0}, - {0xa0, 0, 0}, - {0xa1, 0, 0}, - {0xa4, 0, 0}, - {0xa5, 0, 0}, - {0xa7, 0, 0}, - {0xa8, 0, 0}, - {0xac, 0, 0}, - {0xad, 0, 0}, - {0xaf, 0, 0}, - {0xb1, 0, 0}, - {0xb6, 0, 0}, - {0xb9, 0, 0}, - {0xbf, 0, 0}, - {0xcf, 0, 0}, + {0x9D, 0, 0}, + {0x9E, 0, 0}, + {0xA0, 0, 0}, + {0xA1, 0, 0}, + {0xA4, 0, 0}, + {0xA5, 0, 0}, + {0xA7, 0, 0}, + {0xA8, 0, 0}, + {0xAC, 0, 0}, + {0xAD, 0, 0}, + {0xAF, 0, 0}, + {0xB1, 0, 0}, + {0xB6, 0, 0}, + {0xB9, 0, 0}, + {0xBF, 0, 0}, + {0xCF, 0, 0}, }, /* 154 */ { @@ -3082,18 +3082,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 147}, {0x06, 2, 147}, - {0x0a, 2, 147}, - {0x0f, 2, 147}, + {0x0A, 2, 147}, + {0x0F, 2, 147}, {0x18, 2, 147}, - {0x1f, 2, 147}, + {0x1F, 2, 147}, {0x29, 2, 147}, {0x38, 3, 147}, {0x03, 2, 149}, {0x06, 2, 149}, - {0x0a, 2, 149}, - {0x0f, 2, 149}, + {0x0A, 2, 149}, + {0x0F, 2, 149}, {0x18, 2, 149}, - {0x1f, 2, 149}, + {0x1F, 2, 149}, {0x29, 2, 149}, {0x38, 3, 149}, }, @@ -3101,18 +3101,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 150}, {0x06, 2, 150}, - {0x0a, 2, 150}, - {0x0f, 2, 150}, + {0x0A, 2, 150}, + {0x0F, 2, 150}, {0x18, 2, 150}, - {0x1f, 2, 150}, + {0x1F, 2, 150}, {0x29, 2, 150}, {0x38, 3, 150}, {0x03, 2, 151}, {0x06, 2, 151}, - {0x0a, 2, 151}, - {0x0f, 2, 151}, + {0x0A, 2, 151}, + {0x0F, 2, 151}, {0x18, 2, 151}, - {0x1f, 2, 151}, + {0x1F, 2, 151}, {0x29, 2, 151}, {0x38, 3, 151}, }, @@ -3139,18 +3139,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 152}, {0x06, 2, 152}, - {0x0a, 2, 152}, - {0x0f, 2, 152}, + {0x0A, 2, 152}, + {0x0F, 2, 152}, {0x18, 2, 152}, - {0x1f, 2, 152}, + {0x1F, 2, 152}, {0x29, 2, 152}, {0x38, 3, 152}, {0x03, 2, 155}, {0x06, 2, 155}, - {0x0a, 2, 155}, - {0x0f, 2, 155}, + {0x0A, 2, 155}, + {0x0F, 2, 155}, {0x18, 2, 155}, - {0x1f, 2, 155}, + {0x1F, 2, 155}, {0x29, 2, 155}, {0x38, 3, 155}, }, @@ -3158,18 +3158,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 157}, {0x06, 2, 157}, - {0x0a, 2, 157}, - {0x0f, 2, 157}, + {0x0A, 2, 157}, + {0x0F, 2, 157}, {0x18, 2, 157}, - {0x1f, 2, 157}, + {0x1F, 2, 157}, {0x29, 2, 157}, {0x38, 3, 157}, {0x03, 2, 158}, {0x06, 2, 158}, - {0x0a, 2, 158}, - {0x0f, 2, 158}, + {0x0A, 2, 158}, + {0x0F, 2, 158}, {0x18, 2, 158}, - {0x1f, 2, 158}, + {0x1F, 2, 158}, {0x29, 2, 158}, {0x38, 3, 158}, }, @@ -3215,18 +3215,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 165}, {0x06, 2, 165}, - {0x0a, 2, 165}, - {0x0f, 2, 165}, + {0x0A, 2, 165}, + {0x0F, 2, 165}, {0x18, 2, 165}, - {0x1f, 2, 165}, + {0x1F, 2, 165}, {0x29, 2, 165}, {0x38, 3, 165}, {0x03, 2, 166}, {0x06, 2, 166}, - {0x0a, 2, 166}, - {0x0f, 2, 166}, + {0x0A, 2, 166}, + {0x0F, 2, 166}, {0x18, 2, 166}, - {0x1f, 2, 166}, + {0x1F, 2, 166}, {0x29, 2, 166}, {0x38, 3, 166}, }, @@ -3234,18 +3234,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 168}, {0x06, 2, 168}, - {0x0a, 2, 168}, - {0x0f, 2, 168}, + {0x0A, 2, 168}, + {0x0F, 2, 168}, {0x18, 2, 168}, - {0x1f, 2, 168}, + {0x1F, 2, 168}, {0x29, 2, 168}, {0x38, 3, 168}, {0x03, 2, 174}, {0x06, 2, 174}, - {0x0a, 2, 174}, - {0x0f, 2, 174}, + {0x0A, 2, 174}, + {0x0F, 2, 174}, {0x18, 2, 174}, - {0x1f, 2, 174}, + {0x1F, 2, 174}, {0x29, 2, 174}, {0x38, 3, 174}, }, @@ -3272,18 +3272,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 175}, {0x06, 2, 175}, - {0x0a, 2, 175}, - {0x0f, 2, 175}, + {0x0A, 2, 175}, + {0x0F, 2, 175}, {0x18, 2, 175}, - {0x1f, 2, 175}, + {0x1F, 2, 175}, {0x29, 2, 175}, {0x38, 3, 175}, {0x03, 2, 180}, {0x06, 2, 180}, - {0x0a, 2, 180}, - {0x0f, 2, 180}, + {0x0A, 2, 180}, + {0x0F, 2, 180}, {0x18, 2, 180}, - {0x1f, 2, 180}, + {0x1F, 2, 180}, {0x29, 2, 180}, {0x38, 3, 180}, }, @@ -3291,18 +3291,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 182}, {0x06, 2, 182}, - {0x0a, 2, 182}, - {0x0f, 2, 182}, + {0x0A, 2, 182}, + {0x0F, 2, 182}, {0x18, 2, 182}, - {0x1f, 2, 182}, + {0x1F, 2, 182}, {0x29, 2, 182}, {0x38, 3, 182}, {0x03, 2, 183}, {0x06, 2, 183}, - {0x0a, 2, 183}, - {0x0f, 2, 183}, + {0x0A, 2, 183}, + {0x0F, 2, 183}, {0x18, 2, 183}, - {0x1f, 2, 183}, + {0x1F, 2, 183}, {0x29, 2, 183}, {0x38, 3, 183}, }, @@ -3313,17 +3313,17 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 197}, {0x00, 3, 231}, {0x00, 3, 239}, - {0xb0, 0, 0}, - {0xb2, 0, 0}, - {0xb3, 0, 0}, - {0xb7, 0, 0}, - {0xb8, 0, 0}, - {0xba, 0, 0}, - {0xbb, 0, 0}, - {0xc0, 0, 0}, - {0xc7, 0, 0}, - {0xd0, 0, 0}, - {0xdf, 0, 0}, + {0xB0, 0, 0}, + {0xB2, 0, 0}, + {0xB3, 0, 0}, + {0xB7, 0, 0}, + {0xB8, 0, 0}, + {0xBA, 0, 0}, + {0xBB, 0, 0}, + {0xC0, 0, 0}, + {0xC7, 0, 0}, + {0xD0, 0, 0}, + {0xDF, 0, 0}, }, /* 170 */ { @@ -3367,18 +3367,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 188}, {0x06, 2, 188}, - {0x0a, 2, 188}, - {0x0f, 2, 188}, + {0x0A, 2, 188}, + {0x0F, 2, 188}, {0x18, 2, 188}, - {0x1f, 2, 188}, + {0x1F, 2, 188}, {0x29, 2, 188}, {0x38, 3, 188}, {0x03, 2, 191}, {0x06, 2, 191}, - {0x0a, 2, 191}, - {0x0f, 2, 191}, + {0x0A, 2, 191}, + {0x0F, 2, 191}, {0x18, 2, 191}, - {0x1f, 2, 191}, + {0x1F, 2, 191}, {0x29, 2, 191}, {0x38, 3, 191}, }, @@ -3386,18 +3386,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 197}, {0x06, 2, 197}, - {0x0a, 2, 197}, - {0x0f, 2, 197}, + {0x0A, 2, 197}, + {0x0F, 2, 197}, {0x18, 2, 197}, - {0x1f, 2, 197}, + {0x1F, 2, 197}, {0x29, 2, 197}, {0x38, 3, 197}, {0x03, 2, 231}, {0x06, 2, 231}, - {0x0a, 2, 231}, - {0x0f, 2, 231}, + {0x0A, 2, 231}, + {0x0F, 2, 231}, {0x18, 2, 231}, - {0x1f, 2, 231}, + {0x1F, 2, 231}, {0x29, 2, 231}, {0x38, 3, 231}, }, @@ -3424,10 +3424,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 239}, {0x06, 2, 239}, - {0x0a, 2, 239}, - {0x0f, 2, 239}, + {0x0A, 2, 239}, + {0x0F, 2, 239}, {0x18, 2, 239}, - {0x1f, 2, 239}, + {0x1F, 2, 239}, {0x29, 2, 239}, {0x38, 3, 239}, {0x02, 2, 9}, @@ -3443,18 +3443,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 9}, {0x06, 2, 9}, - {0x0a, 2, 9}, - {0x0f, 2, 9}, + {0x0A, 2, 9}, + {0x0F, 2, 9}, {0x18, 2, 9}, - {0x1f, 2, 9}, + {0x1F, 2, 9}, {0x29, 2, 9}, {0x38, 3, 9}, {0x03, 2, 142}, {0x06, 2, 142}, - {0x0a, 2, 142}, - {0x0f, 2, 142}, + {0x0A, 2, 142}, + {0x0F, 2, 142}, {0x18, 2, 142}, - {0x1f, 2, 142}, + {0x1F, 2, 142}, {0x29, 2, 142}, {0x38, 3, 142}, }, @@ -3481,18 +3481,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 144}, {0x06, 2, 144}, - {0x0a, 2, 144}, - {0x0f, 2, 144}, + {0x0A, 2, 144}, + {0x0F, 2, 144}, {0x18, 2, 144}, - {0x1f, 2, 144}, + {0x1F, 2, 144}, {0x29, 2, 144}, {0x38, 3, 144}, {0x03, 2, 145}, {0x06, 2, 145}, - {0x0a, 2, 145}, - {0x0f, 2, 145}, + {0x0A, 2, 145}, + {0x0F, 2, 145}, {0x18, 2, 145}, - {0x1f, 2, 145}, + {0x1F, 2, 145}, {0x29, 2, 145}, {0x38, 3, 145}, }, @@ -3500,18 +3500,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 148}, {0x06, 2, 148}, - {0x0a, 2, 148}, - {0x0f, 2, 148}, + {0x0A, 2, 148}, + {0x0F, 2, 148}, {0x18, 2, 148}, - {0x1f, 2, 148}, + {0x1F, 2, 148}, {0x29, 2, 148}, {0x38, 3, 148}, {0x03, 2, 159}, {0x06, 2, 159}, - {0x0a, 2, 159}, - {0x0f, 2, 159}, + {0x0A, 2, 159}, + {0x0F, 2, 159}, {0x18, 2, 159}, - {0x1f, 2, 159}, + {0x1F, 2, 159}, {0x29, 2, 159}, {0x38, 3, 159}, }, @@ -3523,16 +3523,16 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 225}, {0x00, 3, 236}, {0x00, 3, 237}, - {0xbc, 0, 0}, - {0xbd, 0, 0}, - {0xc1, 0, 0}, - {0xc4, 0, 0}, - {0xc8, 0, 0}, - {0xcb, 0, 0}, - {0xd1, 0, 0}, - {0xd8, 0, 0}, - {0xe0, 0, 0}, - {0xee, 0, 0}, + {0xBC, 0, 0}, + {0xBD, 0, 0}, + {0xC1, 0, 0}, + {0xC4, 0, 0}, + {0xC8, 0, 0}, + {0xCB, 0, 0}, + {0xD1, 0, 0}, + {0xD8, 0, 0}, + {0xE0, 0, 0}, + {0xEE, 0, 0}, }, /* 181 */ { @@ -3576,18 +3576,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 171}, {0x06, 2, 171}, - {0x0a, 2, 171}, - {0x0f, 2, 171}, + {0x0A, 2, 171}, + {0x0F, 2, 171}, {0x18, 2, 171}, - {0x1f, 2, 171}, + {0x1F, 2, 171}, {0x29, 2, 171}, {0x38, 3, 171}, {0x03, 2, 206}, {0x06, 2, 206}, - {0x0a, 2, 206}, - {0x0f, 2, 206}, + {0x0A, 2, 206}, + {0x0F, 2, 206}, {0x18, 2, 206}, - {0x1f, 2, 206}, + {0x1F, 2, 206}, {0x29, 2, 206}, {0x38, 3, 206}, }, @@ -3595,18 +3595,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 215}, {0x06, 2, 215}, - {0x0a, 2, 215}, - {0x0f, 2, 215}, + {0x0A, 2, 215}, + {0x0F, 2, 215}, {0x18, 2, 215}, - {0x1f, 2, 215}, + {0x1F, 2, 215}, {0x29, 2, 215}, {0x38, 3, 215}, {0x03, 2, 225}, {0x06, 2, 225}, - {0x0a, 2, 225}, - {0x0f, 2, 225}, + {0x0A, 2, 225}, + {0x0F, 2, 225}, {0x18, 2, 225}, - {0x1f, 2, 225}, + {0x1F, 2, 225}, {0x29, 2, 225}, {0x38, 3, 225}, }, @@ -3633,18 +3633,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 236}, {0x06, 2, 236}, - {0x0a, 2, 236}, - {0x0f, 2, 236}, + {0x0A, 2, 236}, + {0x0F, 2, 236}, {0x18, 2, 236}, - {0x1f, 2, 236}, + {0x1F, 2, 236}, {0x29, 2, 236}, {0x38, 3, 236}, {0x03, 2, 237}, {0x06, 2, 237}, - {0x0a, 2, 237}, - {0x0f, 2, 237}, + {0x0A, 2, 237}, + {0x0F, 2, 237}, {0x18, 2, 237}, - {0x1f, 2, 237}, + {0x1F, 2, 237}, {0x29, 2, 237}, {0x38, 3, 237}, }, @@ -3671,18 +3671,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 199}, {0x06, 2, 199}, - {0x0a, 2, 199}, - {0x0f, 2, 199}, + {0x0A, 2, 199}, + {0x0F, 2, 199}, {0x18, 2, 199}, - {0x1f, 2, 199}, + {0x1F, 2, 199}, {0x29, 2, 199}, {0x38, 3, 199}, {0x03, 2, 207}, {0x06, 2, 207}, - {0x0a, 2, 207}, - {0x0f, 2, 207}, + {0x0A, 2, 207}, + {0x0F, 2, 207}, {0x18, 2, 207}, - {0x1f, 2, 207}, + {0x1F, 2, 207}, {0x29, 2, 207}, {0x38, 3, 207}, }, @@ -3690,39 +3690,39 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 234}, {0x06, 2, 234}, - {0x0a, 2, 234}, - {0x0f, 2, 234}, + {0x0A, 2, 234}, + {0x0F, 2, 234}, {0x18, 2, 234}, - {0x1f, 2, 234}, + {0x1F, 2, 234}, {0x29, 2, 234}, {0x38, 3, 234}, {0x03, 2, 235}, {0x06, 2, 235}, - {0x0a, 2, 235}, - {0x0f, 2, 235}, + {0x0A, 2, 235}, + {0x0F, 2, 235}, {0x18, 2, 235}, - {0x1f, 2, 235}, + {0x1F, 2, 235}, {0x29, 2, 235}, {0x38, 3, 235}, }, /* 190 */ { - {0xc2, 0, 0}, - {0xc3, 0, 0}, - {0xc5, 0, 0}, - {0xc6, 0, 0}, - {0xc9, 0, 0}, - {0xca, 0, 0}, - {0xcc, 0, 0}, - {0xcd, 0, 0}, - {0xd2, 0, 0}, - {0xd5, 0, 0}, - {0xd9, 0, 0}, - {0xdc, 0, 0}, - {0xe1, 0, 0}, - {0xe7, 0, 0}, - {0xef, 0, 0}, - {0xf6, 0, 0}, + {0xC2, 0, 0}, + {0xC3, 0, 0}, + {0xC5, 0, 0}, + {0xC6, 0, 0}, + {0xC9, 0, 0}, + {0xCA, 0, 0}, + {0xCC, 0, 0}, + {0xCD, 0, 0}, + {0xD2, 0, 0}, + {0xD5, 0, 0}, + {0xD9, 0, 0}, + {0xDC, 0, 0}, + {0xE1, 0, 0}, + {0xE7, 0, 0}, + {0xEF, 0, 0}, + {0xF6, 0, 0}, }, /* 191 */ { @@ -3741,7 +3741,7 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 242}, {0x00, 3, 243}, {0x00, 3, 255}, - {0xce, 0, 0}, + {0xCE, 0, 0}, }, /* 192 */ { @@ -3785,18 +3785,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 192}, {0x06, 2, 192}, - {0x0a, 2, 192}, - {0x0f, 2, 192}, + {0x0A, 2, 192}, + {0x0F, 2, 192}, {0x18, 2, 192}, - {0x1f, 2, 192}, + {0x1F, 2, 192}, {0x29, 2, 192}, {0x38, 3, 192}, {0x03, 2, 193}, {0x06, 2, 193}, - {0x0a, 2, 193}, - {0x0f, 2, 193}, + {0x0A, 2, 193}, + {0x0F, 2, 193}, {0x18, 2, 193}, - {0x1f, 2, 193}, + {0x1F, 2, 193}, {0x29, 2, 193}, {0x38, 3, 193}, }, @@ -3804,18 +3804,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 200}, {0x06, 2, 200}, - {0x0a, 2, 200}, - {0x0f, 2, 200}, + {0x0A, 2, 200}, + {0x0F, 2, 200}, {0x18, 2, 200}, - {0x1f, 2, 200}, + {0x1F, 2, 200}, {0x29, 2, 200}, {0x38, 3, 200}, {0x03, 2, 201}, {0x06, 2, 201}, - {0x0a, 2, 201}, - {0x0f, 2, 201}, + {0x0A, 2, 201}, + {0x0F, 2, 201}, {0x18, 2, 201}, - {0x1f, 2, 201}, + {0x1F, 2, 201}, {0x29, 2, 201}, {0x38, 3, 201}, }, @@ -3842,18 +3842,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 202}, {0x06, 2, 202}, - {0x0a, 2, 202}, - {0x0f, 2, 202}, + {0x0A, 2, 202}, + {0x0F, 2, 202}, {0x18, 2, 202}, - {0x1f, 2, 202}, + {0x1F, 2, 202}, {0x29, 2, 202}, {0x38, 3, 202}, {0x03, 2, 205}, {0x06, 2, 205}, - {0x0a, 2, 205}, - {0x0f, 2, 205}, + {0x0A, 2, 205}, + {0x0F, 2, 205}, {0x18, 2, 205}, - {0x1f, 2, 205}, + {0x1F, 2, 205}, {0x29, 2, 205}, {0x38, 3, 205}, }, @@ -3861,18 +3861,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 210}, {0x06, 2, 210}, - {0x0a, 2, 210}, - {0x0f, 2, 210}, + {0x0A, 2, 210}, + {0x0F, 2, 210}, {0x18, 2, 210}, - {0x1f, 2, 210}, + {0x1F, 2, 210}, {0x29, 2, 210}, {0x38, 3, 210}, {0x03, 2, 213}, {0x06, 2, 213}, - {0x0a, 2, 213}, - {0x0f, 2, 213}, + {0x0A, 2, 213}, + {0x0F, 2, 213}, {0x18, 2, 213}, - {0x1f, 2, 213}, + {0x1F, 2, 213}, {0x29, 2, 213}, {0x38, 3, 213}, }, @@ -3918,18 +3918,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 218}, {0x06, 2, 218}, - {0x0a, 2, 218}, - {0x0f, 2, 218}, + {0x0A, 2, 218}, + {0x0F, 2, 218}, {0x18, 2, 218}, - {0x1f, 2, 218}, + {0x1F, 2, 218}, {0x29, 2, 218}, {0x38, 3, 218}, {0x03, 2, 219}, {0x06, 2, 219}, - {0x0a, 2, 219}, - {0x0f, 2, 219}, + {0x0A, 2, 219}, + {0x0F, 2, 219}, {0x18, 2, 219}, - {0x1f, 2, 219}, + {0x1F, 2, 219}, {0x29, 2, 219}, {0x38, 3, 219}, }, @@ -3937,18 +3937,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 238}, {0x06, 2, 238}, - {0x0a, 2, 238}, - {0x0f, 2, 238}, + {0x0A, 2, 238}, + {0x0F, 2, 238}, {0x18, 2, 238}, - {0x1f, 2, 238}, + {0x1F, 2, 238}, {0x29, 2, 238}, {0x38, 3, 238}, {0x03, 2, 240}, {0x06, 2, 240}, - {0x0a, 2, 240}, - {0x0f, 2, 240}, + {0x0A, 2, 240}, + {0x0F, 2, 240}, {0x18, 2, 240}, - {0x1f, 2, 240}, + {0x1F, 2, 240}, {0x29, 2, 240}, {0x38, 3, 240}, }, @@ -3975,18 +3975,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 242}, {0x06, 2, 242}, - {0x0a, 2, 242}, - {0x0f, 2, 242}, + {0x0A, 2, 242}, + {0x0F, 2, 242}, {0x18, 2, 242}, - {0x1f, 2, 242}, + {0x1F, 2, 242}, {0x29, 2, 242}, {0x38, 3, 242}, {0x03, 2, 243}, {0x06, 2, 243}, - {0x0a, 2, 243}, - {0x0f, 2, 243}, + {0x0A, 2, 243}, + {0x0F, 2, 243}, {0x18, 2, 243}, - {0x1f, 2, 243}, + {0x1F, 2, 243}, {0x29, 2, 243}, {0x38, 3, 243}, }, @@ -3994,10 +3994,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 255}, {0x06, 2, 255}, - {0x0a, 2, 255}, - {0x0f, 2, 255}, + {0x0A, 2, 255}, + {0x0F, 2, 255}, {0x18, 2, 255}, - {0x1f, 2, 255}, + {0x1F, 2, 255}, {0x29, 2, 255}, {0x38, 3, 255}, {0x02, 2, 203}, @@ -4013,39 +4013,39 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 203}, {0x06, 2, 203}, - {0x0a, 2, 203}, - {0x0f, 2, 203}, + {0x0A, 2, 203}, + {0x0F, 2, 203}, {0x18, 2, 203}, - {0x1f, 2, 203}, + {0x1F, 2, 203}, {0x29, 2, 203}, {0x38, 3, 203}, {0x03, 2, 204}, {0x06, 2, 204}, - {0x0a, 2, 204}, - {0x0f, 2, 204}, + {0x0A, 2, 204}, + {0x0F, 2, 204}, {0x18, 2, 204}, - {0x1f, 2, 204}, + {0x1F, 2, 204}, {0x29, 2, 204}, {0x38, 3, 204}, }, /* 207 */ { - {0xd3, 0, 0}, - {0xd4, 0, 0}, - {0xd6, 0, 0}, - {0xd7, 0, 0}, - {0xda, 0, 0}, - {0xdb, 0, 0}, - {0xdd, 0, 0}, - {0xde, 0, 0}, - {0xe2, 0, 0}, - {0xe4, 0, 0}, - {0xe8, 0, 0}, - {0xeb, 0, 0}, - {0xf0, 0, 0}, - {0xf3, 0, 0}, - {0xf7, 0, 0}, - {0xfa, 0, 0}, + {0xD3, 0, 0}, + {0xD4, 0, 0}, + {0xD6, 0, 0}, + {0xD7, 0, 0}, + {0xDA, 0, 0}, + {0xDB, 0, 0}, + {0xDD, 0, 0}, + {0xDE, 0, 0}, + {0xE2, 0, 0}, + {0xE4, 0, 0}, + {0xE8, 0, 0}, + {0xEB, 0, 0}, + {0xF0, 0, 0}, + {0xF3, 0, 0}, + {0xF7, 0, 0}, + {0xFA, 0, 0}, }, /* 208 */ { @@ -4108,18 +4108,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 211}, {0x06, 2, 211}, - {0x0a, 2, 211}, - {0x0f, 2, 211}, + {0x0A, 2, 211}, + {0x0F, 2, 211}, {0x18, 2, 211}, - {0x1f, 2, 211}, + {0x1F, 2, 211}, {0x29, 2, 211}, {0x38, 3, 211}, {0x03, 2, 212}, {0x06, 2, 212}, - {0x0a, 2, 212}, - {0x0f, 2, 212}, + {0x0A, 2, 212}, + {0x0F, 2, 212}, {0x18, 2, 212}, - {0x1f, 2, 212}, + {0x1F, 2, 212}, {0x29, 2, 212}, {0x38, 3, 212}, }, @@ -4127,18 +4127,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 214}, {0x06, 2, 214}, - {0x0a, 2, 214}, - {0x0f, 2, 214}, + {0x0A, 2, 214}, + {0x0F, 2, 214}, {0x18, 2, 214}, - {0x1f, 2, 214}, + {0x1F, 2, 214}, {0x29, 2, 214}, {0x38, 3, 214}, {0x03, 2, 221}, {0x06, 2, 221}, - {0x0a, 2, 221}, - {0x0f, 2, 221}, + {0x0A, 2, 221}, + {0x0F, 2, 221}, {0x18, 2, 221}, - {0x1f, 2, 221}, + {0x1F, 2, 221}, {0x29, 2, 221}, {0x38, 3, 221}, }, @@ -4165,18 +4165,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 222}, {0x06, 2, 222}, - {0x0a, 2, 222}, - {0x0f, 2, 222}, + {0x0A, 2, 222}, + {0x0F, 2, 222}, {0x18, 2, 222}, - {0x1f, 2, 222}, + {0x1F, 2, 222}, {0x29, 2, 222}, {0x38, 3, 222}, {0x03, 2, 223}, {0x06, 2, 223}, - {0x0a, 2, 223}, - {0x0f, 2, 223}, + {0x0A, 2, 223}, + {0x0F, 2, 223}, {0x18, 2, 223}, - {0x1f, 2, 223}, + {0x1F, 2, 223}, {0x29, 2, 223}, {0x38, 3, 223}, }, @@ -4184,18 +4184,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 241}, {0x06, 2, 241}, - {0x0a, 2, 241}, - {0x0f, 2, 241}, + {0x0A, 2, 241}, + {0x0F, 2, 241}, {0x18, 2, 241}, - {0x1f, 2, 241}, + {0x1F, 2, 241}, {0x29, 2, 241}, {0x38, 3, 241}, {0x03, 2, 244}, {0x06, 2, 244}, - {0x0a, 2, 244}, - {0x0f, 2, 244}, + {0x0A, 2, 244}, + {0x0F, 2, 244}, {0x18, 2, 244}, - {0x1f, 2, 244}, + {0x1F, 2, 244}, {0x29, 2, 244}, {0x38, 3, 244}, }, @@ -4241,18 +4241,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 245}, {0x06, 2, 245}, - {0x0a, 2, 245}, - {0x0f, 2, 245}, + {0x0A, 2, 245}, + {0x0F, 2, 245}, {0x18, 2, 245}, - {0x1f, 2, 245}, + {0x1F, 2, 245}, {0x29, 2, 245}, {0x38, 3, 245}, {0x03, 2, 246}, {0x06, 2, 246}, - {0x0a, 2, 246}, - {0x0f, 2, 246}, + {0x0A, 2, 246}, + {0x0F, 2, 246}, {0x18, 2, 246}, - {0x1f, 2, 246}, + {0x1F, 2, 246}, {0x29, 2, 246}, {0x38, 3, 246}, }, @@ -4260,18 +4260,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 247}, {0x06, 2, 247}, - {0x0a, 2, 247}, - {0x0f, 2, 247}, + {0x0A, 2, 247}, + {0x0F, 2, 247}, {0x18, 2, 247}, - {0x1f, 2, 247}, + {0x1F, 2, 247}, {0x29, 2, 247}, {0x38, 3, 247}, {0x03, 2, 248}, {0x06, 2, 248}, - {0x0a, 2, 248}, - {0x0f, 2, 248}, + {0x0A, 2, 248}, + {0x0F, 2, 248}, {0x18, 2, 248}, - {0x1f, 2, 248}, + {0x1F, 2, 248}, {0x29, 2, 248}, {0x38, 3, 248}, }, @@ -4298,18 +4298,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 250}, {0x06, 2, 250}, - {0x0a, 2, 250}, - {0x0f, 2, 250}, + {0x0A, 2, 250}, + {0x0F, 2, 250}, {0x18, 2, 250}, - {0x1f, 2, 250}, + {0x1F, 2, 250}, {0x29, 2, 250}, {0x38, 3, 250}, {0x03, 2, 251}, {0x06, 2, 251}, - {0x0a, 2, 251}, - {0x0f, 2, 251}, + {0x0A, 2, 251}, + {0x0F, 2, 251}, {0x18, 2, 251}, - {0x1f, 2, 251}, + {0x1F, 2, 251}, {0x29, 2, 251}, {0x38, 3, 251}, }, @@ -4317,39 +4317,39 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 252}, {0x06, 2, 252}, - {0x0a, 2, 252}, - {0x0f, 2, 252}, + {0x0A, 2, 252}, + {0x0F, 2, 252}, {0x18, 2, 252}, - {0x1f, 2, 252}, + {0x1F, 2, 252}, {0x29, 2, 252}, {0x38, 3, 252}, {0x03, 2, 253}, {0x06, 2, 253}, - {0x0a, 2, 253}, - {0x0f, 2, 253}, + {0x0A, 2, 253}, + {0x0F, 2, 253}, {0x18, 2, 253}, - {0x1f, 2, 253}, + {0x1F, 2, 253}, {0x29, 2, 253}, {0x38, 3, 253}, }, /* 223 */ { {0x00, 3, 254}, - {0xe3, 0, 0}, - {0xe5, 0, 0}, - {0xe6, 0, 0}, - {0xe9, 0, 0}, - {0xea, 0, 0}, - {0xec, 0, 0}, - {0xed, 0, 0}, - {0xf1, 0, 0}, - {0xf2, 0, 0}, - {0xf4, 0, 0}, - {0xf5, 0, 0}, - {0xf8, 0, 0}, - {0xf9, 0, 0}, - {0xfb, 0, 0}, - {0xfc, 0, 0}, + {0xE3, 0, 0}, + {0xE5, 0, 0}, + {0xE6, 0, 0}, + {0xE9, 0, 0}, + {0xEA, 0, 0}, + {0xEC, 0, 0}, + {0xED, 0, 0}, + {0xF1, 0, 0}, + {0xF2, 0, 0}, + {0xF4, 0, 0}, + {0xF5, 0, 0}, + {0xF8, 0, 0}, + {0xF9, 0, 0}, + {0xFB, 0, 0}, + {0xFC, 0, 0}, }, /* 224 */ { @@ -4393,10 +4393,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 254}, {0x06, 2, 254}, - {0x0a, 2, 254}, - {0x0f, 2, 254}, + {0x0A, 2, 254}, + {0x0F, 2, 254}, {0x18, 2, 254}, - {0x1f, 2, 254}, + {0x1F, 2, 254}, {0x29, 2, 254}, {0x38, 3, 254}, {0x02, 2, 2}, @@ -4412,18 +4412,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 2}, {0x06, 2, 2}, - {0x0a, 2, 2}, - {0x0f, 2, 2}, + {0x0A, 2, 2}, + {0x0F, 2, 2}, {0x18, 2, 2}, - {0x1f, 2, 2}, + {0x1F, 2, 2}, {0x29, 2, 2}, {0x38, 3, 2}, {0x03, 2, 3}, {0x06, 2, 3}, - {0x0a, 2, 3}, - {0x0f, 2, 3}, + {0x0A, 2, 3}, + {0x0F, 2, 3}, {0x18, 2, 3}, - {0x1f, 2, 3}, + {0x1F, 2, 3}, {0x29, 2, 3}, {0x38, 3, 3}, }, @@ -4450,18 +4450,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 4}, {0x06, 2, 4}, - {0x0a, 2, 4}, - {0x0f, 2, 4}, + {0x0A, 2, 4}, + {0x0F, 2, 4}, {0x18, 2, 4}, - {0x1f, 2, 4}, + {0x1F, 2, 4}, {0x29, 2, 4}, {0x38, 3, 4}, {0x03, 2, 5}, {0x06, 2, 5}, - {0x0a, 2, 5}, - {0x0f, 2, 5}, + {0x0A, 2, 5}, + {0x0F, 2, 5}, {0x18, 2, 5}, - {0x1f, 2, 5}, + {0x1F, 2, 5}, {0x29, 2, 5}, {0x38, 3, 5}, }, @@ -4469,18 +4469,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 6}, {0x06, 2, 6}, - {0x0a, 2, 6}, - {0x0f, 2, 6}, + {0x0A, 2, 6}, + {0x0F, 2, 6}, {0x18, 2, 6}, - {0x1f, 2, 6}, + {0x1F, 2, 6}, {0x29, 2, 6}, {0x38, 3, 6}, {0x03, 2, 7}, {0x06, 2, 7}, - {0x0a, 2, 7}, - {0x0f, 2, 7}, + {0x0A, 2, 7}, + {0x0F, 2, 7}, {0x18, 2, 7}, - {0x1f, 2, 7}, + {0x1F, 2, 7}, {0x29, 2, 7}, {0x38, 3, 7}, }, @@ -4526,18 +4526,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 8}, {0x06, 2, 8}, - {0x0a, 2, 8}, - {0x0f, 2, 8}, + {0x0A, 2, 8}, + {0x0F, 2, 8}, {0x18, 2, 8}, - {0x1f, 2, 8}, + {0x1F, 2, 8}, {0x29, 2, 8}, {0x38, 3, 8}, {0x03, 2, 11}, {0x06, 2, 11}, - {0x0a, 2, 11}, - {0x0f, 2, 11}, + {0x0A, 2, 11}, + {0x0F, 2, 11}, {0x18, 2, 11}, - {0x1f, 2, 11}, + {0x1F, 2, 11}, {0x29, 2, 11}, {0x38, 3, 11}, }, @@ -4545,18 +4545,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 12}, {0x06, 2, 12}, - {0x0a, 2, 12}, - {0x0f, 2, 12}, + {0x0A, 2, 12}, + {0x0F, 2, 12}, {0x18, 2, 12}, - {0x1f, 2, 12}, + {0x1F, 2, 12}, {0x29, 2, 12}, {0x38, 3, 12}, {0x03, 2, 14}, {0x06, 2, 14}, - {0x0a, 2, 14}, - {0x0f, 2, 14}, + {0x0A, 2, 14}, + {0x0F, 2, 14}, {0x18, 2, 14}, - {0x1f, 2, 14}, + {0x1F, 2, 14}, {0x29, 2, 14}, {0x38, 3, 14}, }, @@ -4583,18 +4583,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 15}, {0x06, 2, 15}, - {0x0a, 2, 15}, - {0x0f, 2, 15}, + {0x0A, 2, 15}, + {0x0F, 2, 15}, {0x18, 2, 15}, - {0x1f, 2, 15}, + {0x1F, 2, 15}, {0x29, 2, 15}, {0x38, 3, 15}, {0x03, 2, 16}, {0x06, 2, 16}, - {0x0a, 2, 16}, - {0x0f, 2, 16}, + {0x0A, 2, 16}, + {0x0F, 2, 16}, {0x18, 2, 16}, - {0x1f, 2, 16}, + {0x1F, 2, 16}, {0x29, 2, 16}, {0x38, 3, 16}, }, @@ -4602,18 +4602,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 17}, {0x06, 2, 17}, - {0x0a, 2, 17}, - {0x0f, 2, 17}, + {0x0A, 2, 17}, + {0x0F, 2, 17}, {0x18, 2, 17}, - {0x1f, 2, 17}, + {0x1F, 2, 17}, {0x29, 2, 17}, {0x38, 3, 17}, {0x03, 2, 18}, {0x06, 2, 18}, - {0x0a, 2, 18}, - {0x0f, 2, 18}, + {0x0A, 2, 18}, + {0x0F, 2, 18}, {0x18, 2, 18}, - {0x1f, 2, 18}, + {0x1F, 2, 18}, {0x29, 2, 18}, {0x38, 3, 18}, }, @@ -4634,7 +4634,7 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x00, 3, 127}, {0x00, 3, 220}, {0x00, 3, 249}, - {0xfd, 0, 0}, + {0xFD, 0, 0}, }, /* 239 */ { @@ -4678,18 +4678,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 19}, {0x06, 2, 19}, - {0x0a, 2, 19}, - {0x0f, 2, 19}, + {0x0A, 2, 19}, + {0x0F, 2, 19}, {0x18, 2, 19}, - {0x1f, 2, 19}, + {0x1F, 2, 19}, {0x29, 2, 19}, {0x38, 3, 19}, {0x03, 2, 20}, {0x06, 2, 20}, - {0x0a, 2, 20}, - {0x0f, 2, 20}, + {0x0A, 2, 20}, + {0x0F, 2, 20}, {0x18, 2, 20}, - {0x1f, 2, 20}, + {0x1F, 2, 20}, {0x29, 2, 20}, {0x38, 3, 20}, }, @@ -4697,18 +4697,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 21}, {0x06, 2, 21}, - {0x0a, 2, 21}, - {0x0f, 2, 21}, + {0x0A, 2, 21}, + {0x0F, 2, 21}, {0x18, 2, 21}, - {0x1f, 2, 21}, + {0x1F, 2, 21}, {0x29, 2, 21}, {0x38, 3, 21}, {0x03, 2, 23}, {0x06, 2, 23}, - {0x0a, 2, 23}, - {0x0f, 2, 23}, + {0x0A, 2, 23}, + {0x0F, 2, 23}, {0x18, 2, 23}, - {0x1f, 2, 23}, + {0x1F, 2, 23}, {0x29, 2, 23}, {0x38, 3, 23}, }, @@ -4735,18 +4735,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 24}, {0x06, 2, 24}, - {0x0a, 2, 24}, - {0x0f, 2, 24}, + {0x0A, 2, 24}, + {0x0F, 2, 24}, {0x18, 2, 24}, - {0x1f, 2, 24}, + {0x1F, 2, 24}, {0x29, 2, 24}, {0x38, 3, 24}, {0x03, 2, 25}, {0x06, 2, 25}, - {0x0a, 2, 25}, - {0x0f, 2, 25}, + {0x0A, 2, 25}, + {0x0F, 2, 25}, {0x18, 2, 25}, - {0x1f, 2, 25}, + {0x1F, 2, 25}, {0x29, 2, 25}, {0x38, 3, 25}, }, @@ -4754,18 +4754,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 26}, {0x06, 2, 26}, - {0x0a, 2, 26}, - {0x0f, 2, 26}, + {0x0A, 2, 26}, + {0x0F, 2, 26}, {0x18, 2, 26}, - {0x1f, 2, 26}, + {0x1F, 2, 26}, {0x29, 2, 26}, {0x38, 3, 26}, {0x03, 2, 27}, {0x06, 2, 27}, - {0x0a, 2, 27}, - {0x0f, 2, 27}, + {0x0A, 2, 27}, + {0x0F, 2, 27}, {0x18, 2, 27}, - {0x1f, 2, 27}, + {0x1F, 2, 27}, {0x29, 2, 27}, {0x38, 3, 27}, }, @@ -4785,8 +4785,8 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { {0x16, 3, 220}, {0x01, 2, 249}, {0x16, 3, 249}, - {0xfe, 0, 0}, - {0xff, 0, 0}, + {0xFE, 0, 0}, + {0xFF, 0, 0}, }, /* 247 */ { @@ -4811,18 +4811,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 28}, {0x06, 2, 28}, - {0x0a, 2, 28}, - {0x0f, 2, 28}, + {0x0A, 2, 28}, + {0x0F, 2, 28}, {0x18, 2, 28}, - {0x1f, 2, 28}, + {0x1F, 2, 28}, {0x29, 2, 28}, {0x38, 3, 28}, {0x03, 2, 29}, {0x06, 2, 29}, - {0x0a, 2, 29}, - {0x0f, 2, 29}, + {0x0A, 2, 29}, + {0x0F, 2, 29}, {0x18, 2, 29}, - {0x1f, 2, 29}, + {0x1F, 2, 29}, {0x29, 2, 29}, {0x38, 3, 29}, }, @@ -4830,18 +4830,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 30}, {0x06, 2, 30}, - {0x0a, 2, 30}, - {0x0f, 2, 30}, + {0x0A, 2, 30}, + {0x0F, 2, 30}, {0x18, 2, 30}, - {0x1f, 2, 30}, + {0x1F, 2, 30}, {0x29, 2, 30}, {0x38, 3, 30}, {0x03, 2, 31}, {0x06, 2, 31}, - {0x0a, 2, 31}, - {0x0f, 2, 31}, + {0x0A, 2, 31}, + {0x0F, 2, 31}, {0x18, 2, 31}, - {0x1f, 2, 31}, + {0x1F, 2, 31}, {0x29, 2, 31}, {0x38, 3, 31}, }, @@ -4868,18 +4868,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 127}, {0x06, 2, 127}, - {0x0a, 2, 127}, - {0x0f, 2, 127}, + {0x0A, 2, 127}, + {0x0F, 2, 127}, {0x18, 2, 127}, - {0x1f, 2, 127}, + {0x1F, 2, 127}, {0x29, 2, 127}, {0x38, 3, 127}, {0x03, 2, 220}, {0x06, 2, 220}, - {0x0a, 2, 220}, - {0x0f, 2, 220}, + {0x0A, 2, 220}, + {0x0F, 2, 220}, {0x18, 2, 220}, - {0x1f, 2, 220}, + {0x1F, 2, 220}, {0x29, 2, 220}, {0x38, 3, 220}, }, @@ -4887,10 +4887,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 249}, {0x06, 2, 249}, - {0x0a, 2, 249}, - {0x0f, 2, 249}, + {0x0A, 2, 249}, + {0x0F, 2, 249}, {0x18, 2, 249}, - {0x1f, 2, 249}, + {0x1F, 2, 249}, {0x29, 2, 249}, {0x38, 3, 249}, {0x01, 2, 10}, @@ -4925,18 +4925,18 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 10}, {0x06, 2, 10}, - {0x0a, 2, 10}, - {0x0f, 2, 10}, + {0x0A, 2, 10}, + {0x0F, 2, 10}, {0x18, 2, 10}, - {0x1f, 2, 10}, + {0x1F, 2, 10}, {0x29, 2, 10}, {0x38, 3, 10}, {0x03, 2, 13}, {0x06, 2, 13}, - {0x0a, 2, 13}, - {0x0f, 2, 13}, + {0x0A, 2, 13}, + {0x0F, 2, 13}, {0x18, 2, 13}, - {0x1f, 2, 13}, + {0x1F, 2, 13}, {0x29, 2, 13}, {0x38, 3, 13}, }, @@ -4944,10 +4944,10 @@ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = { { {0x03, 2, 22}, {0x06, 2, 22}, - {0x0a, 2, 22}, - {0x0f, 2, 22}, + {0x0A, 2, 22}, + {0x0F, 2, 22}, {0x18, 2, 22}, - {0x1f, 2, 22}, + {0x1F, 2, 22}, {0x29, 2, 22}, {0x38, 3, 22}, {0x100, 0, 0}, diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_range.c b/deps/ngtcp2/nghttp3/lib/nghttp3_range.c index f3039d81c4e542..d54d9c3d7385e4 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_range.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_range.c @@ -36,8 +36,8 @@ void nghttp3_range_init(nghttp3_range *r, uint64_t begin, uint64_t end) { nghttp3_range nghttp3_range_intersect(const nghttp3_range *a, const nghttp3_range *b) { nghttp3_range r; - uint64_t begin = nghttp3_max_uint64(a->begin, b->begin); - uint64_t end = nghttp3_min_uint64(a->end, b->end); + uint64_t begin = nghttp3_max(a->begin, b->begin); + uint64_t end = nghttp3_min(a->end, b->end); if (begin < end) { nghttp3_range_init(&r, begin, end); diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c index dac89ef12e51c7..f43714d2c20d30 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c @@ -70,7 +70,7 @@ void nghttp3_ringbuf_free(nghttp3_ringbuf *rb) { void *nghttp3_ringbuf_push_front(nghttp3_ringbuf *rb) { rb->first = (rb->first - 1) & (rb->nmemb - 1); - rb->len = nghttp3_min_size(rb->nmemb, rb->len + 1); + rb->len = nghttp3_min(rb->nmemb, rb->len + 1); return (void *)&rb->buf[rb->first * rb->size]; } @@ -108,7 +108,9 @@ void *nghttp3_ringbuf_get(nghttp3_ringbuf *rb, size_t offset) { return &rb->buf[offset * rb->size]; } -int nghttp3_ringbuf_full(nghttp3_ringbuf *rb) { return rb->len == rb->nmemb; } +int nghttp3_ringbuf_full(const nghttp3_ringbuf *rb) { + return rb->len == rb->nmemb; +} int nghttp3_ringbuf_reserve(nghttp3_ringbuf *rb, size_t nmemb) { uint8_t *buf; diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.h b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.h index 691c40b93d61e0..aae22aa8603f50 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.h @@ -108,7 +108,7 @@ static inline size_t nghttp3_ringbuf_len(const nghttp3_ringbuf *rb) { } /* nghttp3_ringbuf_full returns nonzero if |rb| is full. */ -int nghttp3_ringbuf_full(nghttp3_ringbuf *rb); +int nghttp3_ringbuf_full(const nghttp3_ringbuf *rb); int nghttp3_ringbuf_reserve(nghttp3_ringbuf *rb, size_t nmemb); diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_str.c b/deps/ngtcp2/nghttp3/lib/nghttp3_str.c index fc131404d13754..4fcda6658f8b55 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_str.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_str.c @@ -70,36 +70,36 @@ static const uint8_t DOWNCASE_TBL[] = { 124 /* | */, 125 /* } */, 126 /* ~ */, 127 /* DEL */, 128 /* 0x80 */, 129 /* 0x81 */, 130 /* 0x82 */, 131 /* 0x83 */, 132 /* 0x84 */, 133 /* 0x85 */, 134 /* 0x86 */, 135 /* 0x87 */, - 136 /* 0x88 */, 137 /* 0x89 */, 138 /* 0x8a */, 139 /* 0x8b */, - 140 /* 0x8c */, 141 /* 0x8d */, 142 /* 0x8e */, 143 /* 0x8f */, + 136 /* 0x88 */, 137 /* 0x89 */, 138 /* 0x8A */, 139 /* 0x8B */, + 140 /* 0x8C */, 141 /* 0x8D */, 142 /* 0x8E */, 143 /* 0x8F */, 144 /* 0x90 */, 145 /* 0x91 */, 146 /* 0x92 */, 147 /* 0x93 */, 148 /* 0x94 */, 149 /* 0x95 */, 150 /* 0x96 */, 151 /* 0x97 */, - 152 /* 0x98 */, 153 /* 0x99 */, 154 /* 0x9a */, 155 /* 0x9b */, - 156 /* 0x9c */, 157 /* 0x9d */, 158 /* 0x9e */, 159 /* 0x9f */, - 160 /* 0xa0 */, 161 /* 0xa1 */, 162 /* 0xa2 */, 163 /* 0xa3 */, - 164 /* 0xa4 */, 165 /* 0xa5 */, 166 /* 0xa6 */, 167 /* 0xa7 */, - 168 /* 0xa8 */, 169 /* 0xa9 */, 170 /* 0xaa */, 171 /* 0xab */, - 172 /* 0xac */, 173 /* 0xad */, 174 /* 0xae */, 175 /* 0xaf */, - 176 /* 0xb0 */, 177 /* 0xb1 */, 178 /* 0xb2 */, 179 /* 0xb3 */, - 180 /* 0xb4 */, 181 /* 0xb5 */, 182 /* 0xb6 */, 183 /* 0xb7 */, - 184 /* 0xb8 */, 185 /* 0xb9 */, 186 /* 0xba */, 187 /* 0xbb */, - 188 /* 0xbc */, 189 /* 0xbd */, 190 /* 0xbe */, 191 /* 0xbf */, - 192 /* 0xc0 */, 193 /* 0xc1 */, 194 /* 0xc2 */, 195 /* 0xc3 */, - 196 /* 0xc4 */, 197 /* 0xc5 */, 198 /* 0xc6 */, 199 /* 0xc7 */, - 200 /* 0xc8 */, 201 /* 0xc9 */, 202 /* 0xca */, 203 /* 0xcb */, - 204 /* 0xcc */, 205 /* 0xcd */, 206 /* 0xce */, 207 /* 0xcf */, - 208 /* 0xd0 */, 209 /* 0xd1 */, 210 /* 0xd2 */, 211 /* 0xd3 */, - 212 /* 0xd4 */, 213 /* 0xd5 */, 214 /* 0xd6 */, 215 /* 0xd7 */, - 216 /* 0xd8 */, 217 /* 0xd9 */, 218 /* 0xda */, 219 /* 0xdb */, - 220 /* 0xdc */, 221 /* 0xdd */, 222 /* 0xde */, 223 /* 0xdf */, - 224 /* 0xe0 */, 225 /* 0xe1 */, 226 /* 0xe2 */, 227 /* 0xe3 */, - 228 /* 0xe4 */, 229 /* 0xe5 */, 230 /* 0xe6 */, 231 /* 0xe7 */, - 232 /* 0xe8 */, 233 /* 0xe9 */, 234 /* 0xea */, 235 /* 0xeb */, - 236 /* 0xec */, 237 /* 0xed */, 238 /* 0xee */, 239 /* 0xef */, - 240 /* 0xf0 */, 241 /* 0xf1 */, 242 /* 0xf2 */, 243 /* 0xf3 */, - 244 /* 0xf4 */, 245 /* 0xf5 */, 246 /* 0xf6 */, 247 /* 0xf7 */, - 248 /* 0xf8 */, 249 /* 0xf9 */, 250 /* 0xfa */, 251 /* 0xfb */, - 252 /* 0xfc */, 253 /* 0xfd */, 254 /* 0xfe */, 255 /* 0xff */, + 152 /* 0x98 */, 153 /* 0x99 */, 154 /* 0x9A */, 155 /* 0x9B */, + 156 /* 0x9C */, 157 /* 0x9D */, 158 /* 0x9E */, 159 /* 0x9F */, + 160 /* 0xA0 */, 161 /* 0xA1 */, 162 /* 0xA2 */, 163 /* 0xA3 */, + 164 /* 0xA4 */, 165 /* 0xA5 */, 166 /* 0xA6 */, 167 /* 0xA7 */, + 168 /* 0xA8 */, 169 /* 0xA9 */, 170 /* 0xAA */, 171 /* 0xAB */, + 172 /* 0xAC */, 173 /* 0xAD */, 174 /* 0xAE */, 175 /* 0xAF */, + 176 /* 0xB0 */, 177 /* 0xB1 */, 178 /* 0xB2 */, 179 /* 0xB3 */, + 180 /* 0xB4 */, 181 /* 0xB5 */, 182 /* 0xB6 */, 183 /* 0xB7 */, + 184 /* 0xB8 */, 185 /* 0xB9 */, 186 /* 0xBA */, 187 /* 0xBB */, + 188 /* 0xBC */, 189 /* 0xBD */, 190 /* 0xBE */, 191 /* 0xBF */, + 192 /* 0xC0 */, 193 /* 0xC1 */, 194 /* 0xC2 */, 195 /* 0xC3 */, + 196 /* 0xC4 */, 197 /* 0xC5 */, 198 /* 0xC6 */, 199 /* 0xC7 */, + 200 /* 0xC8 */, 201 /* 0xC9 */, 202 /* 0xCA */, 203 /* 0xCB */, + 204 /* 0xCC */, 205 /* 0xCD */, 206 /* 0xCE */, 207 /* 0xCF */, + 208 /* 0xD0 */, 209 /* 0xD1 */, 210 /* 0xD2 */, 211 /* 0xD3 */, + 212 /* 0xD4 */, 213 /* 0xD5 */, 214 /* 0xD6 */, 215 /* 0xD7 */, + 216 /* 0xD8 */, 217 /* 0xD9 */, 218 /* 0xDA */, 219 /* 0xDB */, + 220 /* 0xDC */, 221 /* 0xDD */, 222 /* 0xDE */, 223 /* 0xDF */, + 224 /* 0xE0 */, 225 /* 0xE1 */, 226 /* 0xE2 */, 227 /* 0xE3 */, + 228 /* 0xE4 */, 229 /* 0xE5 */, 230 /* 0xE6 */, 231 /* 0xE7 */, + 232 /* 0xE8 */, 233 /* 0xE9 */, 234 /* 0xEA */, 235 /* 0xEB */, + 236 /* 0xEC */, 237 /* 0xED */, 238 /* 0xEE */, 239 /* 0xEF */, + 240 /* 0xF0 */, 241 /* 0xF1 */, 242 /* 0xF2 */, 243 /* 0xF3 */, + 244 /* 0xF4 */, 245 /* 0xF5 */, 246 /* 0xF6 */, 247 /* 0xF7 */, + 248 /* 0xF8 */, 249 /* 0xF9 */, 250 /* 0xFA */, 251 /* 0xFB */, + 252 /* 0xFC */, 253 /* 0xFD */, 254 /* 0xFE */, 255 /* 0xFF */, }; void nghttp3_downcase(uint8_t *s, size_t len) { diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_stream.c b/deps/ngtcp2/nghttp3/lib/nghttp3_stream.c index 6a6deaafd5b27a..76db6fe303da6c 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_stream.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_stream.c @@ -172,11 +172,11 @@ void nghttp3_stream_del(nghttp3_stream *stream) { } void nghttp3_varint_read_state_reset(nghttp3_varint_read_state *rvint) { - memset(rvint, 0, sizeof(*rvint)); + *rvint = (nghttp3_varint_read_state){0}; } void nghttp3_stream_read_state_reset(nghttp3_stream_read_state *rstate) { - memset(rstate, 0, sizeof(*rstate)); + *rstate = (nghttp3_stream_read_state){0}; } nghttp3_ssize nghttp3_read_varint(nghttp3_varint_read_state *rvint, @@ -190,10 +190,10 @@ nghttp3_ssize nghttp3_read_varint(nghttp3_varint_read_state *rvint, if (rvint->left == 0) { assert(rvint->acc == 0); - vlen = nghttp3_get_varintlen(begin); - len = nghttp3_min_size(vlen, (size_t)(end - begin)); + vlen = nghttp3_get_uvarintlen(begin); + len = nghttp3_min(vlen, (size_t)(end - begin)); if (vlen <= len) { - nghttp3_get_varint(&rvint->acc, begin); + nghttp3_get_uvarint(&rvint->acc, begin); return (nghttp3_ssize)vlen; } @@ -203,19 +203,19 @@ nghttp3_ssize nghttp3_read_varint(nghttp3_varint_read_state *rvint, p = (uint8_t *)&rvint->acc + (sizeof(rvint->acc) - vlen); memcpy(p, begin, len); - *p &= 0x3f; + *p &= 0x3FU; rvint->left = vlen - len; return (nghttp3_ssize)len; } - len = nghttp3_min_size(rvint->left, (size_t)(end - begin)); + len = nghttp3_min(rvint->left, (size_t)(end - begin)); p = (uint8_t *)&rvint->acc + (sizeof(rvint->acc) - rvint->left); memcpy(p, begin, len); rvint->left -= len; if (rvint->left == 0) { - rvint->acc = (int64_t)nghttp3_ntohl64((uint64_t)rvint->acc); + rvint->acc = nghttp3_ntohl64(rvint->acc); } else if (fin) { return NGHTTP3_ERR_INVALID_ARGUMENT; } @@ -223,22 +223,19 @@ nghttp3_ssize nghttp3_read_varint(nghttp3_varint_read_state *rvint, return (nghttp3_ssize)len; } -int nghttp3_stream_frq_add(nghttp3_stream *stream, const nghttp3_frame *fr) { +int nghttp3_stream_frq_emplace(nghttp3_stream *stream, nghttp3_frame **pfr) { nghttp3_ringbuf *frq = &stream->frq; - nghttp3_frame *dest; int rv; if (nghttp3_ringbuf_full(frq)) { - size_t nlen = - nghttp3_max_size(NGHTTP3_MIN_RBLEN, nghttp3_ringbuf_len(frq) * 2); + size_t nlen = nghttp3_max(NGHTTP3_MIN_RBLEN, nghttp3_ringbuf_len(frq) * 2); rv = nghttp3_ringbuf_reserve(frq, nlen); if (rv != 0) { return rv; } } - dest = nghttp3_ringbuf_push_back(frq); - *dest = *fr; + *pfr = nghttp3_ringbuf_push_back(frq); return 0; } @@ -311,7 +308,7 @@ int nghttp3_stream_fill_outq(nghttp3_stream *stream) { } int nghttp3_stream_write_stream_type(nghttp3_stream *stream) { - size_t len = nghttp3_put_varintlen((int64_t)stream->type); + size_t len = nghttp3_put_uvarintlen(stream->type); nghttp3_buf *chunk; nghttp3_typed_buf tbuf; int rv; @@ -324,7 +321,7 @@ int nghttp3_stream_write_stream_type(nghttp3_stream *stream) { chunk = nghttp3_stream_get_chunk(stream); nghttp3_typed_buf_shared_init(&tbuf, chunk); - chunk->last = nghttp3_put_varint(chunk->last, (int64_t)stream->type); + chunk->last = nghttp3_put_uvarint(chunk->last, stream->type); tbuf.buf.last = chunk->last; return nghttp3_stream_outq_add(stream, &tbuf); @@ -343,7 +340,7 @@ int nghttp3_stream_write_settings(nghttp3_stream *stream, .iv = ents, }; const nghttp3_settings *local_settings = infr->local_settings; - int64_t payloadlen; + uint64_t payloadlen; ents[0] = (nghttp3_settings_entry){ .id = NGHTTP3_SETTINGS_ID_MAX_FIELD_SECTION_SIZE, @@ -399,7 +396,7 @@ int nghttp3_stream_write_goaway(nghttp3_stream *stream, int rv; nghttp3_buf *chunk; nghttp3_typed_buf tbuf; - int64_t payloadlen; + uint64_t payloadlen; len = nghttp3_frame_write_goaway_len(&payloadlen, fr); @@ -424,7 +421,7 @@ int nghttp3_stream_write_priority_update( int rv; nghttp3_buf *chunk; nghttp3_typed_buf tbuf; - int64_t payloadlen; + uint64_t payloadlen; len = nghttp3_frame_write_priority_update_len(&payloadlen, fr); @@ -452,7 +449,7 @@ int nghttp3_stream_write_origin(nghttp3_stream *stream, int rv; rv = nghttp3_stream_ensure_chunk( - stream, nghttp3_frame_write_hd_len(fr->type, (int64_t)fr->origin_list.len)); + stream, nghttp3_frame_write_hd_len(fr->type, fr->origin_list.len)); if (rv != 0) { return rv; } @@ -461,7 +458,7 @@ int nghttp3_stream_write_origin(nghttp3_stream *stream, nghttp3_typed_buf_shared_init(&tbuf, chunk); chunk->last = - nghttp3_frame_write_hd(chunk->last, fr->type, (int64_t)fr->origin_list.len); + nghttp3_frame_write_hd(chunk->last, fr->type, fr->origin_list.len); tbuf.buf.last = chunk->last; @@ -497,8 +494,8 @@ int nghttp3_stream_write_header_block(nghttp3_stream *stream, nghttp3_qpack_encoder *qenc, nghttp3_stream *qenc_stream, nghttp3_buf *rbuf, nghttp3_buf *ebuf, - int64_t frame_type, const nghttp3_nv *nva, - size_t nvlen) { + uint64_t frame_type, + const nghttp3_nv *nva, size_t nvlen) { nghttp3_buf pbuf; int rv; size_t len; @@ -506,7 +503,7 @@ int nghttp3_stream_write_header_block(nghttp3_stream *stream, nghttp3_typed_buf tbuf; uint8_t raw_pbuf[16]; size_t pbuflen, rbuflen, ebuflen; - int64_t payloadlen; + uint64_t payloadlen; nghttp3_buf_wrap_init(&pbuf, raw_pbuf, sizeof(raw_pbuf)); @@ -520,7 +517,7 @@ int nghttp3_stream_write_header_block(nghttp3_stream *stream, rbuflen = nghttp3_buf_len(rbuf); ebuflen = nghttp3_buf_len(ebuf); - payloadlen = (int64_t)(pbuflen + rbuflen); + payloadlen = pbuflen + rbuflen; len = nghttp3_frame_write_hd_len(frame_type, payloadlen) + pbuflen; @@ -612,7 +609,7 @@ int nghttp3_stream_write_data(nghttp3_stream *stream, int *peof, nghttp3_buf *chunk; nghttp3_read_data_callback read_data = fr->dr.read_data; nghttp3_conn *conn = stream->conn; - int64_t datalen; + uint64_t datalen; uint32_t flags = 0; nghttp3_vec vec[8]; nghttp3_vec *v; @@ -635,8 +632,8 @@ int nghttp3_stream_write_data(nghttp3_stream *stream, int *peof, return NGHTTP3_ERR_CALLBACK_FAILURE; } - datalen = nghttp3_vec_len_varint(vec, (size_t)sveccnt); - if (datalen == -1) { + rv = nghttp3_vec_len_uvarint(&datalen, vec, (size_t)sveccnt); + if (rv == -1) { return NGHTTP3_ERR_STREAM_DATA_OVERFLOW; } @@ -720,7 +717,7 @@ int nghttp3_stream_write_qpack_decoder_stream(nghttp3_stream *stream) { assert(qdec); - len = nghttp3_qpack_decoder_get_decoder_streamlen(qdec); + len = nghttp3_qpack_decoder_get_decoder_streamlen2(qdec); if (len == 0) { return 0; } @@ -774,7 +771,7 @@ int nghttp3_stream_outq_add(nghttp3_stream *stream, } if (nghttp3_ringbuf_full(outq)) { - size_t nlen = nghttp3_max_size(NGHTTP3_MIN_RBLEN, len * 2); + size_t nlen = nghttp3_max(NGHTTP3_MIN_RBLEN, len * 2); rv = nghttp3_ringbuf_reserve(outq, nlen); if (rv != 0) { return rv; @@ -816,7 +813,7 @@ int nghttp3_stream_ensure_chunk(nghttp3_stream *stream, size_t need) { } if (nghttp3_ringbuf_full(chunks)) { - size_t nlen = nghttp3_max_size(NGHTTP3_MIN_RBLEN, len * 2); + size_t nlen = nghttp3_max(NGHTTP3_MIN_RBLEN, len * 2); rv = nghttp3_ringbuf_reserve(chunks, nlen); if (rv != 0) { return rv; @@ -838,13 +835,13 @@ nghttp3_buf *nghttp3_stream_get_chunk(nghttp3_stream *stream) { return nghttp3_ringbuf_get(chunks, len - 1); } -int nghttp3_stream_is_blocked(nghttp3_stream *stream) { +int nghttp3_stream_is_blocked(const nghttp3_stream *stream) { return (stream->flags & NGHTTP3_STREAM_FLAG_FC_BLOCKED) || (stream->flags & NGHTTP3_STREAM_FLAG_SHUT_WR) || (stream->flags & NGHTTP3_STREAM_FLAG_READ_DATA_BLOCKED); } -int nghttp3_stream_require_schedule(nghttp3_stream *stream) { +int nghttp3_stream_require_schedule(const nghttp3_stream *stream) { return (!nghttp3_stream_outq_write_done(stream) && !(stream->flags & NGHTTP3_STREAM_FLAG_FC_BLOCKED) && !(stream->flags & NGHTTP3_STREAM_FLAG_SHUT_WR)) || @@ -912,8 +909,8 @@ void nghttp3_stream_add_outq_offset(nghttp3_stream *stream, size_t n) { stream->outq_idx = i; } -int nghttp3_stream_outq_write_done(nghttp3_stream *stream) { - nghttp3_ringbuf *outq = &stream->outq; +int nghttp3_stream_outq_write_done(const nghttp3_stream *stream) { + const nghttp3_ringbuf *outq = &stream->outq; size_t len = nghttp3_ringbuf_len(outq); return len == 0 || stream->outq_idx >= len; @@ -969,8 +966,8 @@ int nghttp3_stream_update_ack_offset(nghttp3_stream *stream, uint64_t offset) { /* For NGHTTP3_BUF_TYPE_ALIEN, we never add 0 length buffer. */ if (tbuf->type == NGHTTP3_BUF_TYPE_ALIEN && stream->ack_offset < offset && stream->callbacks.acked_data) { - nack = nghttp3_min_uint64(offset, stream->ack_base + buflen) - - stream->ack_offset; + nack = + nghttp3_min(offset, stream->ack_base + buflen) - stream->ack_offset; rv = stream->callbacks.acked_data(stream, stream->node.id, nack, stream->user_data); @@ -1011,7 +1008,7 @@ int nghttp3_stream_buffer_data(nghttp3_stream *stream, const uint8_t *data, if (len) { buf = nghttp3_ringbuf_get(inq, len - 1); bufleft = nghttp3_buf_left(buf); - nwrite = nghttp3_min_size(datalen, bufleft); + nwrite = nghttp3_min(datalen, bufleft); buf->last = nghttp3_cpymem(buf->last, data, nwrite); data += nwrite; datalen -= nwrite; @@ -1020,7 +1017,7 @@ int nghttp3_stream_buffer_data(nghttp3_stream *stream, const uint8_t *data, for (; datalen;) { if (nghttp3_ringbuf_full(inq)) { size_t nlen = - nghttp3_max_size(NGHTTP3_MIN_RBLEN, nghttp3_ringbuf_len(inq) * 2); + nghttp3_max(NGHTTP3_MIN_RBLEN, nghttp3_ringbuf_len(inq) * 2); rv = nghttp3_ringbuf_reserve(inq, nlen); if (rv != 0) { return rv; @@ -1035,7 +1032,7 @@ int nghttp3_stream_buffer_data(nghttp3_stream *stream, const uint8_t *data, buf = nghttp3_ringbuf_push_back(inq); nghttp3_buf_wrap_init(buf, rawbuf, 16384); bufleft = nghttp3_buf_left(buf); - nwrite = nghttp3_min_size(datalen, bufleft); + nwrite = nghttp3_min(datalen, bufleft); buf->last = nghttp3_cpymem(buf->last, data, nwrite); data += nwrite; datalen -= nwrite; @@ -1229,7 +1226,7 @@ int nghttp3_stream_transit_rx_http_state(nghttp3_stream *stream, } } -int nghttp3_stream_empty_headers_allowed(nghttp3_stream *stream) { +int nghttp3_stream_empty_headers_allowed(const nghttp3_stream *stream) { switch (stream->rx.hstate) { case NGHTTP3_HTTP_STATE_REQ_TRAILERS_BEGIN: case NGHTTP3_HTTP_STATE_RESP_TRAILERS_BEGIN: diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_stream.h b/deps/ngtcp2/nghttp3/lib/nghttp3_stream.h index 20fa4212213f03..61a1f085ac8709 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_stream.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_stream.h @@ -52,10 +52,10 @@ /* nghttp3_stream_type is unidirectional stream type. */ typedef uint64_t nghttp3_stream_type; -#define NGHTTP3_STREAM_TYPE_CONTROL 0x00 -#define NGHTTP3_STREAM_TYPE_PUSH 0x01 -#define NGHTTP3_STREAM_TYPE_QPACK_ENCODER 0x02 -#define NGHTTP3_STREAM_TYPE_QPACK_DECODER 0x03 +#define NGHTTP3_STREAM_TYPE_CONTROL 0x00U +#define NGHTTP3_STREAM_TYPE_PUSH 0x01U +#define NGHTTP3_STREAM_TYPE_QPACK_ENCODER 0x02U +#define NGHTTP3_STREAM_TYPE_QPACK_DECODER 0x03U #define NGHTTP3_STREAM_TYPE_UNKNOWN UINT64_MAX typedef enum nghttp3_ctrl_stream_state { @@ -83,7 +83,7 @@ typedef enum nghttp3_req_stream_state { } nghttp3_req_stream_state; typedef struct nghttp3_varint_read_state { - int64_t acc; + uint64_t acc; size_t left; } nghttp3_varint_read_state; @@ -91,43 +91,43 @@ typedef struct nghttp3_stream_read_state { nghttp3_varint_read_state rvint; nghttp3_settings_entry iv; nghttp3_frame fr; - int64_t left; + uint64_t left; int state; } nghttp3_stream_read_state; /* NGHTTP3_STREAM_FLAG_NONE indicates that no flag is set. */ -#define NGHTTP3_STREAM_FLAG_NONE 0x0000u +#define NGHTTP3_STREAM_FLAG_NONE 0x0000U /* NGHTTP3_STREAM_FLAG_TYPE_IDENTIFIED is set when a unidirectional stream type is identified. */ -#define NGHTTP3_STREAM_FLAG_TYPE_IDENTIFIED 0x0001u +#define NGHTTP3_STREAM_FLAG_TYPE_IDENTIFIED 0x0001U /* NGHTTP3_STREAM_FLAG_FC_BLOCKED indicates that stream is blocked by QUIC flow control. */ -#define NGHTTP3_STREAM_FLAG_FC_BLOCKED 0x0002u +#define NGHTTP3_STREAM_FLAG_FC_BLOCKED 0x0002U /* NGHTTP3_STREAM_FLAG_READ_DATA_BLOCKED indicates that application is temporarily unable to provide data. */ -#define NGHTTP3_STREAM_FLAG_READ_DATA_BLOCKED 0x0004u +#define NGHTTP3_STREAM_FLAG_READ_DATA_BLOCKED 0x0004U /* NGHTTP3_STREAM_FLAG_WRITE_END_STREAM indicates that application finished to feed outgoing data. */ -#define NGHTTP3_STREAM_FLAG_WRITE_END_STREAM 0x0008u +#define NGHTTP3_STREAM_FLAG_WRITE_END_STREAM 0x0008U /* NGHTTP3_STREAM_FLAG_QPACK_DECODE_BLOCKED indicates that stream is blocked due to QPACK decoding. */ -#define NGHTTP3_STREAM_FLAG_QPACK_DECODE_BLOCKED 0x0010u +#define NGHTTP3_STREAM_FLAG_QPACK_DECODE_BLOCKED 0x0010U /* NGHTTP3_STREAM_FLAG_READ_EOF indicates that remote endpoint sent fin. */ -#define NGHTTP3_STREAM_FLAG_READ_EOF 0x0020u +#define NGHTTP3_STREAM_FLAG_READ_EOF 0x0020U /* NGHTTP3_STREAM_FLAG_SHUT_WR indicates that any further write operation to a stream is prohibited. */ -#define NGHTTP3_STREAM_FLAG_SHUT_WR 0x0100u +#define NGHTTP3_STREAM_FLAG_SHUT_WR 0x0100U /* NGHTTP3_STREAM_FLAG_SHUT_RD indicates that a read-side stream is closed abruptly and any incoming and pending stream data is just discarded for a stream. */ -#define NGHTTP3_STREAM_FLAG_SHUT_RD 0x0200u +#define NGHTTP3_STREAM_FLAG_SHUT_RD 0x0200U /* NGHTTP3_STREAM_FLAG_SERVER_PRIORITY_SET indicates that server overrides stream priority. */ -#define NGHTTP3_STREAM_FLAG_SERVER_PRIORITY_SET 0x0400u +#define NGHTTP3_STREAM_FLAG_SERVER_PRIORITY_SET 0x0400U /* NGHTTP3_STREAM_FLAG_PRIORITY_UPDATE_RECVED indicates that server received PRIORITY_UPDATE frame for this stream. */ -#define NGHTTP3_STREAM_FLAG_PRIORITY_UPDATE_RECVED 0x0800u +#define NGHTTP3_STREAM_FLAG_PRIORITY_UPDATE_RECVED 0x0800U typedef enum nghttp3_stream_http_state { NGHTTP3_HTTP_STATE_NONE, @@ -262,7 +262,18 @@ nghttp3_ssize nghttp3_read_varint(nghttp3_varint_read_state *rvint, const uint8_t *begin, const uint8_t *end, int fin); -int nghttp3_stream_frq_add(nghttp3_stream *stream, const nghttp3_frame *fr); +/* + * nghttp3_stream_frq_emplace adds new space for nghttp3_frame to + * stream->frq, and assigns the pointer to the space to |*pfr| if it + * succeeds. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * NGHTTP3_ERR_NOMEM + * Out of memory. + */ +int nghttp3_stream_frq_emplace(nghttp3_stream *stream, nghttp3_frame **pfr); int nghttp3_stream_fill_outq(nghttp3_stream *stream); @@ -283,8 +294,8 @@ int nghttp3_stream_write_header_block(nghttp3_stream *stream, nghttp3_qpack_encoder *qenc, nghttp3_stream *qenc_stream, nghttp3_buf *rbuf, nghttp3_buf *ebuf, - int64_t frame_type, const nghttp3_nv *nva, - size_t nvlen); + uint64_t frame_type, + const nghttp3_nv *nva, size_t nvlen); int nghttp3_stream_write_data(nghttp3_stream *stream, int *peof, const nghttp3_frame_data *fr); @@ -305,7 +316,7 @@ int nghttp3_stream_ensure_chunk(nghttp3_stream *stream, size_t need); nghttp3_buf *nghttp3_stream_get_chunk(nghttp3_stream *stream); -int nghttp3_stream_is_blocked(nghttp3_stream *stream); +int nghttp3_stream_is_blocked(const nghttp3_stream *stream); void nghttp3_stream_add_outq_offset(nghttp3_stream *stream, size_t n); @@ -313,7 +324,7 @@ void nghttp3_stream_add_outq_offset(nghttp3_stream *stream, size_t n); * nghttp3_stream_outq_write_done returns nonzero if all contents in * outq have been written. */ -int nghttp3_stream_outq_write_done(nghttp3_stream *stream); +int nghttp3_stream_outq_write_done(const nghttp3_stream *stream); /* * nghttp2_stream_update_ack_offset updates the last acknowledged @@ -333,7 +344,7 @@ int nghttp3_stream_is_active(nghttp3_stream *stream); * be scheduled. In other words, |stream| or its descendants have * something to send. */ -int nghttp3_stream_require_schedule(nghttp3_stream *stream); +int nghttp3_stream_require_schedule(const nghttp3_stream *stream); int nghttp3_stream_buffer_data(nghttp3_stream *stream, const uint8_t *src, size_t srclen); @@ -347,7 +358,7 @@ void nghttp3_stream_delete_qpack_stream_context(nghttp3_stream *stream); int nghttp3_stream_transit_rx_http_state(nghttp3_stream *stream, nghttp3_stream_http_event event); -int nghttp3_stream_empty_headers_allowed(nghttp3_stream *stream); +int nghttp3_stream_empty_headers_allowed(const nghttp3_stream *stream); /* * nghttp3_stream_uni returns nonzero if stream identified by diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.c b/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.c index 4a969df1946386..f8f4be9477c4f2 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.c @@ -56,7 +56,7 @@ void nghttp3_tnode_unschedule(nghttp3_tnode *tnode, nghttp3_pq *pq) { tnode_unschedule(tnode, pq); } -static uint64_t pq_get_first_cycle(nghttp3_pq *pq) { +static uint64_t pq_get_first_cycle(const nghttp3_pq *pq) { nghttp3_tnode *top; if (nghttp3_pq_empty(pq)) { @@ -74,7 +74,7 @@ int nghttp3_tnode_schedule(nghttp3_tnode *tnode, nghttp3_pq *pq, if (tnode->pe.index == NGHTTP3_PQ_BAD_INDEX) { tnode->cycle = pq_get_first_cycle(pq) + - ((nwrite == 0 || !tnode->pri.inc) ? 0 : nghttp3_max_uint64(1, penalty)); + ((nwrite == 0 || !tnode->pri.inc) ? 0 : nghttp3_max(1, penalty)); } else if (nwrite > 0) { if (!tnode->pri.inc || nghttp3_pq_size(pq) == 1) { return 0; @@ -82,7 +82,7 @@ int nghttp3_tnode_schedule(nghttp3_tnode *tnode, nghttp3_pq *pq, nghttp3_pq_remove(pq, &tnode->pe); tnode->pe.index = NGHTTP3_PQ_BAD_INDEX; - tnode->cycle += nghttp3_max_uint64(1, penalty); + tnode->cycle += nghttp3_max(1, penalty); } else { return 0; } @@ -90,6 +90,6 @@ int nghttp3_tnode_schedule(nghttp3_tnode *tnode, nghttp3_pq *pq, return nghttp3_pq_push(pq, &tnode->pe); } -int nghttp3_tnode_is_scheduled(nghttp3_tnode *tnode) { +int nghttp3_tnode_is_scheduled(const nghttp3_tnode *tnode) { return tnode->pe.index != NGHTTP3_PQ_BAD_INDEX; } diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.h b/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.h index 297067d7ca0332..954f6fff040dc3 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_tnode.h @@ -33,13 +33,12 @@ #include "nghttp3_pq.h" -#define NGHTTP3_TNODE_MAX_CYCLE_GAP (1llu << 24) +#define NGHTTP3_TNODE_MAX_CYCLE_GAP (1ULL << 24) typedef struct nghttp3_tnode { nghttp3_pq_entry pe; int64_t id; uint64_t cycle; - /* pri is a stream priority produced by nghttp3_pri_to_uint8. */ nghttp3_pri pri; } nghttp3_tnode; @@ -60,6 +59,6 @@ int nghttp3_tnode_schedule(nghttp3_tnode *tnode, nghttp3_pq *pq, /* * nghttp3_tnode_is_scheduled returns nonzero if |tnode| is scheduled. */ -int nghttp3_tnode_is_scheduled(nghttp3_tnode *tnode); +int nghttp3_tnode_is_scheduled(const nghttp3_tnode *tnode); #endif /* !defined(NGHTTP3_TNODE_H) */ diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_vec.c b/deps/ngtcp2/nghttp3/lib/nghttp3_vec.c index ab58ff5832bea9..7302e88111bd49 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_vec.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_vec.c @@ -37,7 +37,7 @@ uint64_t nghttp3_vec_len(const nghttp3_vec *vec, size_t n) { return res; } -int64_t nghttp3_vec_len_varint(const nghttp3_vec *vec, size_t n) { +int nghttp3_vec_len_uvarint(uint64_t *dest, const nghttp3_vec *vec, size_t n) { uint64_t res = 0; size_t len; size_t i; @@ -51,5 +51,7 @@ int64_t nghttp3_vec_len_varint(const nghttp3_vec *vec, size_t n) { res += len; } - return (int64_t)res; + *dest = res; + + return 0; } diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_vec.h b/deps/ngtcp2/nghttp3/lib/nghttp3_vec.h index f36eabc1052621..ad63f4fedfb2b6 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_vec.h +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_vec.h @@ -33,9 +33,11 @@ #include /* - * nghttp3_vec_len_varint is similar to nghttp3_vec_len, but it - * returns -1 if the sum of the length exceeds NGHTTP3_MAX_VARINT. + * nghttp3_vec_len_uvarint is similar to nghttp3_vec_len, but it + * stores the return value from nghttp3_vec_len(|vec|, |n|) into + * |dest| if it does not exceed NGHTTP3_MAX_VARINT, and returns 0. + * Otherwise returns -1. */ -int64_t nghttp3_vec_len_varint(const nghttp3_vec *vec, size_t n); +int nghttp3_vec_len_uvarint(uint64_t *dest, const nghttp3_vec *vec, size_t n); #endif /* !defined(NGHTTP3_VEC_H) */