| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1749,7 +1749,11 @@ typedef struct nghttp3_conn nghttp3_conn; | |||
| 1749 | 1749 | typedef struct nghttp3_settings { | |
| 1750 | 1750 | /** | |
| 1751 | 1751 | * :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. | ||
| 1753 | 1757 | */ | |
| 1754 | 1758 | uint64_t max_field_section_size; | |
| 1755 | 1759 | /** | |
@@ -1828,6 +1832,44 @@ typedef struct nghttp3_settings { | |||
| 1828 | 1832 | nghttp3_qpack_indexing_strat qpack_indexing_strat; | |
| 1829 | 1833 | } nghttp3_settings; | |
| 1830 | 1834 | ||
| 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 | + | ||
| 1831 | 1873 | /** | |
| 1832 | 1874 | * @functypedef | |
| 1833 | 1875 | * | |
@@ -2052,6 +2094,11 @@ typedef int (*nghttp3_shutdown)(nghttp3_conn *conn, int64_t id, | |||
| 2052 | 2094 | /** | |
| 2053 | 2095 | * @functypedef | |
| 2054 | 2096 | * | |
| 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 | + * | ||
| 2055 | 2102 | * :type:`nghttp3_recv_settings` is a callback function which is | |
| 2056 | 2103 | * invoked when SETTINGS frame is received. |settings| is a received | |
| 2057 | 2104 | * remote HTTP/3 settings. | |
@@ -2103,9 +2150,27 @@ typedef int (*nghttp3_end_origin)(nghttp3_conn *conn, void *conn_user_data); | |||
| 2103 | 2150 | */ | |
| 2104 | 2151 | typedef void (*nghttp3_rand)(uint8_t *dest, size_t destlen); | |
| 2105 | 2152 | ||
| 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 | + | ||
| 2106 | 2170 | #define NGHTTP3_CALLBACKS_V1 1 | |
| 2107 | 2171 | #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 | ||
| 2109 | 2174 | ||
| 2110 | 2175 | /** | |
| 2111 | 2176 | * @struct | |
@@ -2195,6 +2260,11 @@ typedef struct nghttp3_callbacks { | |||
| 2195 | 2260 | */ | |
| 2196 | 2261 | nghttp3_shutdown shutdown; | |
| 2197 | 2262 | /** | |
| 2263 | + * .. warning:: | ||
| 2264 | + * | ||
| 2265 | + * Deprecated since v1.14.0. Use :member:`recv_settings2` | ||
| 2266 | + * instead. | ||
| 2267 | + * | ||
| 2198 | 2268 | * :member:`recv_settings` is a callback function which is invoked | |
| 2199 | 2269 | * when SETTINGS frame is received. | |
| 2200 | 2270 | */ | |
@@ -2221,6 +2291,12 @@ typedef struct nghttp3_callbacks { | |||
| 2221 | 2291 | * v1.11.0. | |
| 2222 | 2292 | */ | |
| 2223 | 2293 | 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; | ||
| 2224 | 2300 | } nghttp3_callbacks; | |
| 2225 | 2301 | ||
| 2226 | 2302 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ | |||
| 31 | 31 | * | |
| 32 | 32 | * Version number of the nghttp3 library release. | |
| 33 | 33 | */ | |
| 34 | - #define NGHTTP3_VERSION "1.13.1" | ||
| 34 | + #define NGHTTP3_VERSION "1.14.0" | ||
| 35 | 35 | ||
| 36 | 36 | /** | |
| 37 | 37 | * @macro | |
@@ -41,6 +41,6 @@ | |||
| 41 | 41 | * number, 8 bits for minor and 8 bits for patch. Version 1.2.3 | |
| 42 | 42 | * becomes 0x010203. | |
| 43 | 43 | */ | |
| 44 | - #define NGHTTP3_VERSION_NUM 0x010d01 | ||
| 44 | + #define NGHTTP3_VERSION_NUM 0x010e00 | ||
| 45 | 45 | ||
| 46 | 46 | #endif /* !defined(NGHTTP3_VERSION_H) */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,7 +64,7 @@ typedef struct nghttp3_balloc { | |||
| 64 | 64 | ||
| 65 | 65 | /* | |
| 66 | 66 | * 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. | ||
| 68 | 68 | */ | |
| 69 | 69 | void nghttp3_balloc_init(nghttp3_balloc *balloc, size_t blklen, | |
| 70 | 70 | const nghttp3_mem *mem); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,10 +72,12 @@ int nghttp3_buf_reserve(nghttp3_buf *buf, size_t size, const nghttp3_mem *mem) { | |||
| 72 | 72 | return NGHTTP3_ERR_NOMEM; | |
| 73 | 73 | } | |
| 74 | 74 | ||
| 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 | + }; | ||
| 79 | 81 | ||
| 80 | 82 | return 0; | |
| 81 | 83 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,6 +66,8 @@ size_t nghttp3_callbackslen_version(int callbacks_version) { | |||
| 66 | 66 | switch (callbacks_version) { | |
| 67 | 67 | case NGHTTP3_CALLBACKS_VERSION: | |
| 68 | 68 | return sizeof(callbacks); | |
| 69 | + case NGHTTP3_CALLBACKS_V2: | ||
| 70 | + return offsetof(nghttp3_callbacks, rand) + sizeof(callbacks.rand); | ||
| 69 | 71 | case NGHTTP3_CALLBACKS_V1: | |
| 70 | 72 | return offsetof(nghttp3_callbacks, recv_settings) + | |
| 71 | 73 | sizeof(callbacks.recv_settings); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments