Skip to content

Commit 23df677

Browse files
deps: update nghttp3 to 1.13.1
1 parent ed6ec96 commit 23df677

25 files changed

+6847
-4767
lines changed

deps/ngtcp2/nghttp3/lib/includes/nghttp3/nghttp3.h

Lines changed: 172 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,59 @@ extern "C" {
8181
*/
8282
typedef ptrdiff_t nghttp3_ssize;
8383

84+
/**
85+
* @typedef
86+
*
87+
* :type:`nghttp3_tstamp` is a timestamp with nanosecond resolution.
88+
* ``UINT64_MAX`` is an invalid value, and it is often used to
89+
* indicate that no value is set. This type is available since
90+
* v1.12.0.
91+
*/
92+
typedef uint64_t nghttp3_tstamp;
93+
94+
/**
95+
* @typedef
96+
*
97+
* :type:`nghttp3_duration` is a period of time in nanosecond
98+
* resolution. ``UINT64_MAX`` is an invalid value, and it is often
99+
* used to indicate that no value is set. This type is available
100+
* since v1.12.0.
101+
*/
102+
typedef uint64_t nghttp3_duration;
103+
104+
/**
105+
* @macro
106+
*
107+
* :macro:`NGHTTP3_NANOSECONDS` is a count of tick which corresponds
108+
* to 1 nanosecond. This macro is available since v1.12.0.
109+
*/
110+
#define NGHTTP3_NANOSECONDS ((nghttp3_duration)1ULL)
111+
112+
/**
113+
* @macro
114+
*
115+
* :macro:`NGHTTP3_MICROSECONDS` is a count of tick which corresponds
116+
* to 1 microsecond. This macro is available since v1.12.0.
117+
*/
118+
#define NGHTTP3_MICROSECONDS ((nghttp3_duration)(1000ULL * NGHTTP3_NANOSECONDS))
119+
120+
/**
121+
* @macro
122+
*
123+
* :macro:`NGHTTP3_MILLISECONDS` is a count of tick which corresponds
124+
* to 1 millisecond. This macro is available since v1.12.0.
125+
*/
126+
#define NGHTTP3_MILLISECONDS \
127+
((nghttp3_duration)(1000ULL * NGHTTP3_MICROSECONDS))
128+
129+
/**
130+
* @macro
131+
*
132+
* :macro:`NGHTTP3_SECONDS` is a count of tick which corresponds to 1
133+
* second. This macro is available since v1.12.0.
134+
*/
135+
#define NGHTTP3_SECONDS ((nghttp3_duration)(1000ULL * NGHTTP3_MILLISECONDS))
136+
84137
/**
85138
* @macro
86139
*
@@ -264,6 +317,14 @@ typedef ptrdiff_t nghttp3_ssize;
264317
* allowed.
265318
*/
266319
#define NGHTTP3_ERR_H3_STREAM_CREATION_ERROR -609
320+
/**
321+
* @macro
322+
*
323+
* :macro:`NGHTTP3_ERR_H3_EXCESSIVE_LOAD` indicates that a local
324+
* endpoint detected that its remote endpoint is exhibiting a behavior
325+
* that might generating excessive load.
326+
*/
327+
#define NGHTTP3_ERR_H3_EXCESSIVE_LOAD -610
267328
/**
268329
* @macro
269330
*
@@ -1090,6 +1151,32 @@ typedef struct nghttp3_qpack_nv {
10901151
uint8_t flags;
10911152
} nghttp3_qpack_nv;
10921153

1154+
/**
1155+
* @enum
1156+
*
1157+
* :type:`nghttp3_qpack_indexing_strat` defines the QPACK dynamic
1158+
* table indexing strategies for fields not defined in
1159+
* :type:`nghttp3_qpack_token`. This type is available since v1.13.0.
1160+
1161+
*/
1162+
typedef enum nghttp3_qpack_indexing_strat {
1163+
/**
1164+
* :enum:`NGHTTP3_QPACK_INDEXING_STRAT_NONE` does not index any
1165+
* fields not defined in :type:`nghttp3_qpack_token`. This is the
1166+
* default strategy. You can still use
1167+
* :macro:`NGHTTP3_NV_FLAG_TRY_INDEX` to index a particular field.
1168+
* This enum is available since v1.13.0.
1169+
*/
1170+
NGHTTP3_QPACK_INDEXING_STRAT_NONE,
1171+
/**
1172+
* :enum:`NGHTTP3_QPACK_INDEXING_STRAT_EAGER` indexes all fields not
1173+
* defined in :type:`nghttp3_qpack_token`. Please note that QPACK
1174+
* encoder might not index the field in various reasons. This enum
1175+
* is available since v1.13.0.
1176+
*/
1177+
NGHTTP3_QPACK_INDEXING_STRAT_EAGER
1178+
} nghttp3_qpack_indexing_strat;
1179+
10931180
/**
10941181
* @struct
10951182
*
@@ -1238,6 +1325,18 @@ NGHTTP3_EXTERN void
12381325
nghttp3_qpack_encoder_set_max_blocked_streams(nghttp3_qpack_encoder *encoder,
12391326
size_t max_blocked_streams);
12401327

1328+
/**
1329+
* @function
1330+
*
1331+
* `nghttp3_qpack_encoder_set_indexing_strat` sets the dynamic table
1332+
* indexing strategy |strat| to |encoder|. This function is available
1333+
* since v1.13.0.
1334+
1335+
*/
1336+
NGHTTP3_EXTERN void
1337+
nghttp3_qpack_encoder_set_indexing_strat(nghttp3_qpack_encoder *encoder,
1338+
nghttp3_qpack_indexing_strat strat);
1339+
12411340
/**
12421341
* @function
12431342
*
@@ -1638,7 +1737,9 @@ typedef struct nghttp3_conn nghttp3_conn;
16381737

16391738
#define NGHTTP3_SETTINGS_V1 1
16401739
#define NGHTTP3_SETTINGS_V2 2
1641-
#define NGHTTP3_SETTINGS_VERSION NGHTTP3_SETTINGS_V2
1740+
#define NGHTTP3_SETTINGS_V3 3
1741+
#define NGHTTP3_SETTINGS_V4 4
1742+
#define NGHTTP3_SETTINGS_VERSION NGHTTP3_SETTINGS_V4
16421743

16431744
/**
16441745
* @struct
@@ -1700,6 +1801,31 @@ typedef struct nghttp3_settings {
17001801
* server uses this field. This field is available since v1.11.0.
17011802
*/
17021803
const nghttp3_vec *origin_list;
1804+
/* The following fields have been added since NGHTTP3_SETTINGS_V3. */
1805+
/**
1806+
* :member:`glitch_ratelim_burst` is the maximum number of tokens
1807+
* available to "glitch" rate limiter. "glitch" is a suspicious
1808+
* activity from a remote endpoint. If detected, certain amount of
1809+
* tokens are consumed. If no tokens are available to consume, the
1810+
* connection is closed. The rate of token generation is specified
1811+
* by :member:`glitch_ratelim_rate`. This feature is enabled only
1812+
* when `nghttp3_conn_read_stream2` is used. This field has been
1813+
* available since v1.12.0.
1814+
*/
1815+
uint64_t glitch_ratelim_burst;
1816+
/**
1817+
* :member:`glitch_ratelim_rate` is the number of tokens generated
1818+
* per second. See :member:`glitch_ratelim_burst` for "glitch" rate
1819+
* limiter. This field has been available since v1.12.0.
1820+
*/
1821+
uint64_t glitch_ratelim_rate;
1822+
/**
1823+
* :member:`qpack_indexing_strat` defines the QPACK dynamic table
1824+
* indexing strategy for those fields that are not defined in
1825+
* :type:`nghttp3_qpack_token`. This field has been available since
1826+
* v1.13.0.
1827+
*/
1828+
nghttp3_qpack_indexing_strat qpack_indexing_strat;
17031829
} nghttp3_settings;
17041830

17051831
/**
@@ -2113,6 +2239,10 @@ typedef struct nghttp3_callbacks {
21132239
* <nghttp3_settings.qpack_blocked_streams>` = 0
21142240
* - :member:`enable_connect_protocol
21152241
* <nghttp3_settings.enable_connect_protocol>` = 0
2242+
* - :member:`glitch_ratelim_burst
2243+
* <nghttp3_settings.glitch_ratelim_burst>` = 1000
2244+
* - :member:`glitch_ratelim_rate
2245+
* <nghttp3_settings.glitch_ratelim_rate>` = 33
21162246
*/
21172247
NGHTTP3_EXTERN void
21182248
nghttp3_settings_default_versioned(int settings_version,
@@ -2209,6 +2339,11 @@ NGHTTP3_EXTERN int nghttp3_conn_bind_qpack_streams(nghttp3_conn *conn,
22092339
/**
22102340
* @function
22112341
*
2342+
* .. warning::
2343+
*
2344+
* Deprecated since v1.12.0. Use `nghttp3_conn_read_stream2`
2345+
* instead.
2346+
*
22122347
* `nghttp3_conn_read_stream` reads data |src| of length |srclen| on
22132348
* stream identified by |stream_id|. It returns the number of bytes
22142349
* consumed. The "consumed" means that application can increase flow
@@ -2237,6 +2372,42 @@ NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_read_stream(nghttp3_conn *conn,
22372372
const uint8_t *src,
22382373
size_t srclen, int fin);
22392374

2375+
/**
2376+
* @function
2377+
*
2378+
* `nghttp3_conn_read_stream2` reads data |src| of length |srclen| on
2379+
* stream identified by |stream_id|. It returns the number of bytes
2380+
* consumed. The "consumed" means that application can increase flow
2381+
* control credit (both stream and connection) of underlying QUIC
2382+
* connection by that amount. It does not include the amount of data
2383+
* carried by DATA frame which contains application data (excluding
2384+
* any control or QPACK unidirectional streams). See
2385+
* :type:`nghttp3_recv_data` to handle those bytes. If |fin| is
2386+
* nonzero, this is the last data from remote endpoint in this stream.
2387+
* |ts| is the current timestamp, and must be non-decreasing. It
2388+
* should be obtained from the clock that is steadily increasing.
2389+
*
2390+
* This function returns the number of bytes consumed, or one of the
2391+
* following negative error codes:
2392+
*
2393+
* :macro:`NGHTTP3_ERR_NOMEM`
2394+
* Out of memory.
2395+
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`
2396+
* User callback failed.
2397+
*
2398+
* It may return the other error codes. The negative error code means
2399+
* that |conn| encountered a connection error, and the connection must
2400+
* be closed. Calling nghttp3 API other than `nghttp3_conn_del`
2401+
* causes undefined behavior.
2402+
*
2403+
* This function is available since v1.12.0.
2404+
*/
2405+
NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_read_stream2(nghttp3_conn *conn,
2406+
int64_t stream_id,
2407+
const uint8_t *src,
2408+
size_t srclen, int fin,
2409+
nghttp3_tstamp ts);
2410+
22402411
/**
22412412
* @function
22422413
*

deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
* Version number of the nghttp3 library release.
3333
*/
34-
#define NGHTTP3_VERSION "1.11.0"
34+
#define NGHTTP3_VERSION "1.13.1"
3535

3636
/**
3737
* @macro
@@ -41,6 +41,6 @@
4141
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
4242
* becomes 0x010203.
4343
*/
44-
#define NGHTTP3_VERSION_NUM 0x010b00
44+
#define NGHTTP3_VERSION_NUM 0x010d01
4545

4646
#endif /* !defined(NGHTTP3_VERSION_H) */

deps/ngtcp2/nghttp3/lib/nghttp3_balloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int nghttp3_balloc_get(nghttp3_balloc *balloc, void **pbuf, size_t n) {
7272
return NGHTTP3_ERR_NOMEM;
7373
}
7474

75-
hd = (nghttp3_memblock_hd *)(void *)p;
75+
hd = (void *)p;
7676
hd->next = balloc->head;
7777
balloc->head = hd;
7878
nghttp3_buf_wrap_init(

0 commit comments

Comments
 (0)