Skip to content

Commit 69f8b22

Browse files
deps: update nghttp3 to 0.11.0
1 parent 20f685f commit 69f8b22

13 files changed

+215
-119
lines changed

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

+75-31
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ extern "C" {
6868
# endif /* !BUILDING_NGHTTP3 */
6969
#endif /* !defined(WIN32) */
7070

71+
#ifdef _MSC_VER
72+
# define NGHTTP3_ALIGN(N) __declspec(align(N))
73+
#else /* !_MSC_VER */
74+
# define NGHTTP3_ALIGN(N) __attribute__((aligned(N)))
75+
#endif /* !_MSC_VER */
76+
7177
/**
7278
* @typedef
7379
*
@@ -1937,12 +1943,12 @@ typedef struct nghttp3_settings {
19371943
* Extended CONNECT Method (see :rfc:`9220`). Client ignores this
19381944
* field.
19391945
*/
1940-
int enable_connect_protocol;
1946+
uint8_t enable_connect_protocol;
19411947
/**
19421948
* :member:`h3_datagram`, if set to nonzero, enables HTTP/3
19431949
* Datagrams (see :rfc:`9297`).
19441950
*/
1945-
int h3_datagram;
1951+
uint8_t h3_datagram;
19461952
} nghttp3_settings;
19471953

19481954
/**
@@ -2431,12 +2437,15 @@ NGHTTP3_EXTERN uint64_t nghttp3_conn_get_frame_payload_left(nghttp3_conn *conn,
24312437
*/
24322438
#define NGHTTP3_URGENCY_LEVELS (NGHTTP3_URGENCY_LOW + 1)
24332439

2440+
#define NGHTTP3_PRI_V1 1
2441+
#define NGHTTP3_PRI_VERSION NGHTTP3_PRI_V1
2442+
24342443
/**
24352444
* @struct
24362445
*
24372446
* :type:`nghttp3_pri` represents HTTP priority.
24382447
*/
2439-
typedef struct nghttp3_pri {
2448+
typedef struct NGHTTP3_ALIGN(8) nghttp3_pri {
24402449
/**
24412450
* :member:`urgency` is the urgency of a stream, it must be in
24422451
* [:macro:`NGHTTP3_URGENCY_HIGH`, :macro:`NGHTTP3_URGENCY_LOW`],
@@ -2449,7 +2458,7 @@ typedef struct nghttp3_pri {
24492458
* incrementally. If inc is 1, it can be processed incrementally.
24502459
* Other value is not permitted.
24512460
*/
2452-
int inc;
2461+
uint8_t inc;
24532462
} nghttp3_pri;
24542463

24552464
/**
@@ -2466,26 +2475,53 @@ typedef struct nghttp3_pri {
24662475
* This function returns 0 if it succeeds, or one of the following
24672476
* negative error codes:
24682477
*
2478+
* :macro:`NGHTTP3_ERR_INVALID_ARGUMENT`
2479+
* |stream_id| is not a client initiated bidirectional stream ID.
24692480
* :macro:`NGHTTP3_ERR_STREAM_NOT_FOUND`
24702481
* Stream not found.
24712482
*/
2472-
NGHTTP3_EXTERN int nghttp3_conn_get_stream_priority(nghttp3_conn *conn,
2473-
nghttp3_pri *dest,
2474-
int64_t stream_id);
2483+
NGHTTP3_EXTERN int nghttp3_conn_get_stream_priority_versioned(
2484+
nghttp3_conn *conn, int pri_version, nghttp3_pri *dest, int64_t stream_id);
24752485

24762486
/**
24772487
* @function
24782488
*
2479-
* `nghttp3_conn_set_stream_priority` updates priority of a stream
2480-
* denoted by |stream_id| with the value pointed by |pri|.
2489+
* `nghttp3_conn_set_client_stream_priority` updates priority of a
2490+
* stream denoted by |stream_id| with the value pointed by |data| of
2491+
* length |datalen|, which should be a serialized :rfc:`9218` priority
2492+
* field value. |stream_id| must identify client initiated
2493+
* bidirectional stream.
2494+
*
2495+
* This function must not be called if |conn| is initialized as
2496+
* server.
2497+
*
2498+
* This function returns 0 if it succeeds, or one of the following
2499+
* negative error codes:
2500+
*
2501+
* :macro:`NGHTTP3_ERR_INVALID_ARGUMENT`
2502+
* |stream_id| is not a client initiated bidirectional stream ID.
2503+
* :macro:`NGHTTP3_ERR_STREAM_NOT_FOUND`
2504+
* Stream not found.
2505+
* :macro:`NGHTTP3_ERR_NOMEM`
2506+
* Out of memory.
2507+
*/
2508+
NGHTTP3_EXTERN int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn,
2509+
int64_t stream_id,
2510+
const uint8_t *data,
2511+
size_t datalen);
2512+
2513+
/**
2514+
* @function
2515+
*
2516+
* `nghttp3_conn_set_server_stream_priority` updates priority of a
2517+
* stream denoted by |stream_id| with the value pointed by |pri|.
24812518
* |stream_id| must identify client initiated bidirectional stream.
24822519
*
2483-
* Both client and server can update stream priority with this
2484-
* function.
2520+
* This function must not be called if |conn| is initialized as
2521+
* client.
24852522
*
2486-
* If server updates stream priority with this function, it completely
2487-
* overrides stream priority set by client and the attempts to update
2488-
* priority by client are ignored.
2523+
* This function completely overrides stream priority set by client
2524+
* and the attempts to update priority by client are ignored.
24892525
*
24902526
* This function returns 0 if it succeeds, or one of the following
24912527
* negative error codes:
@@ -2497,9 +2533,9 @@ NGHTTP3_EXTERN int nghttp3_conn_get_stream_priority(nghttp3_conn *conn,
24972533
* :macro:`NGHTTP3_ERR_NOMEM`
24982534
* Out of memory.
24992535
*/
2500-
NGHTTP3_EXTERN int nghttp3_conn_set_stream_priority(nghttp3_conn *conn,
2501-
int64_t stream_id,
2502-
const nghttp3_pri *pri);
2536+
NGHTTP3_EXTERN int nghttp3_conn_set_server_stream_priority_versioned(
2537+
nghttp3_conn *conn, int64_t stream_id, int pri_version,
2538+
const nghttp3_pri *pri);
25032539

25042540
/**
25052541
* @function
@@ -2544,21 +2580,11 @@ NGHTTP3_EXTERN int nghttp3_check_header_value(const uint8_t *value, size_t len);
25442580
/**
25452581
* @function
25462582
*
2547-
* `nghttp3_http_parse_priority` parses priority HTTP header field
2548-
* stored in the buffer pointed by |value| of length |len|. If it
2549-
* successfully processed header field value, it stores the result
2550-
* into |*dest|. This function just overwrites what it sees in the
2551-
* header field value and does not initialize any field in |*dest|.
2552-
*
2553-
* This function returns 0 if it succeeds, or one of the following
2554-
* negative error codes:
2555-
*
2556-
* :macro:`NGHTTP3_ERR_INVALID_ARGUMENT`
2557-
* The function could not parse the provided value.
2583+
* `nghttp3_conn_is_drained` returns nonzero if
2584+
* `nghttp3_conn_shutdown` has been called, and there is no active
2585+
* remote streams. This function is for server use only.
25582586
*/
2559-
NGHTTP3_EXTERN int nghttp3_http_parse_priority(nghttp3_pri *dest,
2560-
const uint8_t *value,
2561-
size_t len);
2587+
NGHTTP3_EXTERN int nghttp3_conn_is_drained(nghttp3_conn *conn);
25622588

25632589
/**
25642590
* @function
@@ -2662,6 +2688,24 @@ NGHTTP3_EXTERN int nghttp3_err_is_fatal(int liberr);
26622688
(CALLBACKS), NGHTTP3_SETTINGS_VERSION, \
26632689
(SETTINGS), (MEM), (USER_DATA))
26642690

2691+
/*
2692+
* `nghttp3_conn_set_server_stream_priority` is a wrapper around
2693+
* `nghttp3_conn_set_server_stream_priority_versioned` to set the
2694+
* correct struct version.
2695+
*/
2696+
#define nghttp3_conn_set_server_stream_priority(CONN, STREAM_ID, PRI) \
2697+
nghttp3_conn_set_server_stream_priority_versioned( \
2698+
(CONN), (STREAM_ID), NGHTTP3_PRI_VERSION, (PRI))
2699+
2700+
/*
2701+
* `nghttp3_conn_get_stream_priority` is a wrapper around
2702+
* `nghttp3_conn_get_stream_priority_versioned` to set the correct
2703+
* struct version.
2704+
*/
2705+
#define nghttp3_conn_get_stream_priority(CONN, DEST, STREAM_ID) \
2706+
nghttp3_conn_get_stream_priority_versioned((CONN), NGHTTP3_PRI_VERSION, \
2707+
(DEST), (STREAM_ID))
2708+
26652709
#ifdef __cplusplus
26662710
}
26672711
#endif

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

+2-2
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 "0.10.0"
34+
#define NGHTTP3_VERSION "0.11.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 0x000a00
44+
#define NGHTTP3_VERSION_NUM 0x000b00
4545

4646
#endif /* NGHTTP3_VERSION_H */

0 commit comments

Comments
 (0)