Skip to content

Commit b043540

Browse files
deps: update nghttp3 to 1.14.0
1 parent 15bdf38 commit b043540

23 files changed

+451
-588
lines changed

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

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,7 +1749,11 @@ typedef struct nghttp3_conn nghttp3_conn;
17491749
typedef struct nghttp3_settings {
17501750
/**
17511751
* :member:`max_field_section_size` specifies the maximum header
1752-
* section (block) size.
1752+
* section (block) size. nghttp3 library does not enforce this
1753+
* limit. Applications are responsible for imposing their own
1754+
* limits to protect against resource exhaustion. See
1755+
* https://datatracker.ietf.org/doc/html/rfc9114#section-4.2.2 for
1756+
* details.
17531757
*/
17541758
uint64_t max_field_section_size;
17551759
/**
@@ -1828,6 +1832,44 @@ typedef struct nghttp3_settings {
18281832
nghttp3_qpack_indexing_strat qpack_indexing_strat;
18291833
} nghttp3_settings;
18301834

1835+
#define NGHTTP3_PROTO_SETTINGS_V1 1
1836+
#define NGHTTP3_PROTO_SETTINGS_VERSION NGHTTP3_PROTO_SETTINGS_V1
1837+
1838+
/**
1839+
* @struct
1840+
*
1841+
* :type:`nghttp3_proto_settings` contains HTTP/3 settings that this
1842+
* library can recognize. This field is available since v1.14.0.
1843+
*/
1844+
typedef struct nghttp3_proto_settings {
1845+
/**
1846+
* :member:`max_field_section_size` specifies the maximum header
1847+
* section (block) size.
1848+
*/
1849+
uint64_t max_field_section_size;
1850+
/**
1851+
* :member:`qpack_max_dtable_capacity` is the maximum size of QPACK
1852+
* dynamic table.
1853+
*/
1854+
size_t qpack_max_dtable_capacity;
1855+
/**
1856+
* :member:`qpack_blocked_streams` is the maximum number of streams
1857+
* which can be blocked while they are being decoded.
1858+
*/
1859+
size_t qpack_blocked_streams;
1860+
/**
1861+
* :member:`enable_connect_protocol`, if set to nonzero, enables
1862+
* Extended CONNECT Method (see :rfc:`9220`). Client ignores this
1863+
* field.
1864+
*/
1865+
uint8_t enable_connect_protocol;
1866+
/**
1867+
* :member:`h3_datagram`, if set to nonzero, enables HTTP/3
1868+
* Datagrams (see :rfc:`9297`).
1869+
*/
1870+
uint8_t h3_datagram;
1871+
} nghttp3_proto_settings;
1872+
18311873
/**
18321874
* @functypedef
18331875
*
@@ -2052,6 +2094,11 @@ typedef int (*nghttp3_shutdown)(nghttp3_conn *conn, int64_t id,
20522094
/**
20532095
* @functypedef
20542096
*
2097+
* .. warning::
2098+
*
2099+
* Deprecated since v1.14.0. Use :type:`nghttp3_recv_settings2`
2100+
* instead. New settings will not be notified with this callback.
2101+
*
20552102
* :type:`nghttp3_recv_settings` is a callback function which is
20562103
* invoked when SETTINGS frame is received. |settings| is a received
20572104
* remote HTTP/3 settings.
@@ -2103,9 +2150,27 @@ typedef int (*nghttp3_end_origin)(nghttp3_conn *conn, void *conn_user_data);
21032150
*/
21042151
typedef void (*nghttp3_rand)(uint8_t *dest, size_t destlen);
21052152

2153+
/**
2154+
* @functypedef
2155+
*
2156+
* :type:`nghttp3_recv_settings2` is a callback function which is
2157+
* invoked when SETTINGS frame is received. |settings| is a received
2158+
* remote HTTP/3 settings.
2159+
*
2160+
* The implementation of this callback must return 0 if it succeeds.
2161+
* Returning :macro:`NGHTTP3_ERR_CALLBACK_FAILURE` will return to the
2162+
* caller immediately. Any values other than 0 is treated as
2163+
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`. This callback is available
2164+
* since v1.14.0.
2165+
*/
2166+
typedef int (*nghttp3_recv_settings2)(nghttp3_conn *conn,
2167+
const nghttp3_proto_settings *settings,
2168+
void *conn_user_data);
2169+
21062170
#define NGHTTP3_CALLBACKS_V1 1
21072171
#define NGHTTP3_CALLBACKS_V2 2
2108-
#define NGHTTP3_CALLBACKS_VERSION NGHTTP3_CALLBACKS_V2
2172+
#define NGHTTP3_CALLBACKS_V3 3
2173+
#define NGHTTP3_CALLBACKS_VERSION NGHTTP3_CALLBACKS_V3
21092174

21102175
/**
21112176
* @struct
@@ -2195,6 +2260,11 @@ typedef struct nghttp3_callbacks {
21952260
*/
21962261
nghttp3_shutdown shutdown;
21972262
/**
2263+
* .. warning::
2264+
*
2265+
* Deprecated since v1.14.0. Use :member:`recv_settings2`
2266+
* instead.
2267+
*
21982268
* :member:`recv_settings` is a callback function which is invoked
21992269
* when SETTINGS frame is received.
22002270
*/
@@ -2221,6 +2291,12 @@ typedef struct nghttp3_callbacks {
22212291
* v1.11.0.
22222292
*/
22232293
nghttp3_rand rand;
2294+
/**
2295+
* :member:`recv_settings2` is a callback function which is invoked
2296+
* when SETTINGS frame is received. This field is available since
2297+
* v1.14.0.
2298+
*/
2299+
nghttp3_recv_settings2 recv_settings2;
22242300
} nghttp3_callbacks;
22252301

22262302
/**

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.13.1"
34+
#define NGHTTP3_VERSION "1.14.0"
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 0x010d01
44+
#define NGHTTP3_VERSION_NUM 0x010e00
4545

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

deps/ngtcp2/nghttp3/lib/nghttp3_balloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ typedef struct nghttp3_balloc {
6464

6565
/*
6666
* nghttp3_balloc_init initializes |balloc| with |blklen| which is the
67-
* size of memory block.
67+
* size of memory block. |blklen| must be divisible by 16.
6868
*/
6969
void nghttp3_balloc_init(nghttp3_balloc *balloc, size_t blklen,
7070
const nghttp3_mem *mem);

deps/ngtcp2/nghttp3/lib/nghttp3_buf.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ int nghttp3_buf_reserve(nghttp3_buf *buf, size_t size, const nghttp3_mem *mem) {
7272
return NGHTTP3_ERR_NOMEM;
7373
}
7474

75-
buf->begin = p;
76-
buf->end = p + size;
77-
buf->pos = p + pos_offset;
78-
buf->last = p + last_offset;
75+
*buf = (nghttp3_buf){
76+
.begin = p,
77+
.end = p + size,
78+
.pos = p + pos_offset,
79+
.last = p + last_offset,
80+
};
7981

8082
return 0;
8183
}

deps/ngtcp2/nghttp3/lib/nghttp3_callbacks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ size_t nghttp3_callbackslen_version(int callbacks_version) {
6666
switch (callbacks_version) {
6767
case NGHTTP3_CALLBACKS_VERSION:
6868
return sizeof(callbacks);
69+
case NGHTTP3_CALLBACKS_V2:
70+
return offsetof(nghttp3_callbacks, rand) + sizeof(callbacks.rand);
6971
case NGHTTP3_CALLBACKS_V1:
7072
return offsetof(nghttp3_callbacks, recv_settings) +
7173
sizeof(callbacks.recv_settings);

0 commit comments

Comments
 (0)