Skip to content

Commit 8658833

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update nghttp3 to 1.6.0
PR-URL: #56258 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent 7c941d4 commit 8658833

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7274
-6766
lines changed

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

Lines changed: 70 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@
3131
libcurl) */
3232
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
3333
# define WIN32
34-
#endif
34+
#endif /* (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) */
3535

3636
#ifdef __cplusplus
3737
extern "C" {
38-
#endif
38+
#endif /* defined(__cplusplus) */
3939

4040
#include <stdlib.h>
4141
#if defined(_MSC_VER) && (_MSC_VER < 1800)
4242
/* MSVC < 2013 does not have inttypes.h because it is not C99
4343
compliant. See compiler macros and version number in
4444
https://sourceforge.net/p/predef/wiki/Compilers/ */
4545
# include <stdint.h>
46-
#else /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
46+
#else /* !(defined(_MSC_VER) && (_MSC_VER < 1800)) */
4747
# include <inttypes.h>
48-
#endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
48+
#endif /* !(defined(_MSC_VER) && (_MSC_VER < 1800)) */
4949
#include <sys/types.h>
5050
#include <stdarg.h>
5151
#include <stddef.h>
@@ -57,22 +57,22 @@ extern "C" {
5757
#elif defined(WIN32)
5858
# ifdef BUILDING_NGHTTP3
5959
# define NGHTTP3_EXTERN __declspec(dllexport)
60-
# else /* !BUILDING_NGHTTP3 */
60+
# else /* !defined(BUILDING_NGHTTP3) */
6161
# define NGHTTP3_EXTERN __declspec(dllimport)
62-
# endif /* !BUILDING_NGHTTP3 */
63-
#else /* !defined(WIN32) */
62+
# endif /* !defined(BUILDING_NGHTTP3) */
63+
#else /* !(defined(NGHTTP3_STATICLIB) || defined(WIN32)) */
6464
# ifdef BUILDING_NGHTTP3
6565
# define NGHTTP3_EXTERN __attribute__((visibility("default")))
66-
# else /* !BUILDING_NGHTTP3 */
66+
# else /* !defined(BUILDING_NGHTTP3) */
6767
# define NGHTTP3_EXTERN
68-
# endif /* !BUILDING_NGHTTP3 */
69-
#endif /* !defined(WIN32) */
68+
# endif /* !defined(BUILDING_NGHTTP3) */
69+
#endif /* !(defined(NGHTTP3_STATICLIB) || defined(WIN32)) */
7070

7171
#ifdef _MSC_VER
7272
# define NGHTTP3_ALIGN(N) __declspec(align(N))
73-
#else /* !_MSC_VER */
73+
#else /* !defined(_MSC_VER) */
7474
# define NGHTTP3_ALIGN(N) __attribute__((aligned(N)))
75-
#endif /* !_MSC_VER */
75+
#endif /* !defined(_MSC_VER) */
7676

7777
/**
7878
* @typedef
@@ -624,7 +624,7 @@ typedef struct nghttp3_buf {
624624
*/
625625
uint8_t *end;
626626
/**
627-
* :member:`pos` pointers to the start of data. Typically, this
627+
* :member:`pos` points to the start of data. Typically, this
628628
* points to the address that next data should be read. Initially,
629629
* it points to :member:`begin`.
630630
*/
@@ -1161,8 +1161,8 @@ NGHTTP3_EXTERN void nghttp3_qpack_encoder_del(nghttp3_qpack_encoder *encoder);
11611161
* anymore.
11621162
*/
11631163
NGHTTP3_EXTERN int nghttp3_qpack_encoder_encode(
1164-
nghttp3_qpack_encoder *encoder, nghttp3_buf *pbuf, nghttp3_buf *rbuf,
1165-
nghttp3_buf *ebuf, int64_t stream_id, const nghttp3_nv *nva, size_t nvlen);
1164+
nghttp3_qpack_encoder *encoder, nghttp3_buf *pbuf, nghttp3_buf *rbuf,
1165+
nghttp3_buf *ebuf, int64_t stream_id, const nghttp3_nv *nva, size_t nvlen);
11661166

11671167
/**
11681168
* @function
@@ -1182,7 +1182,7 @@ NGHTTP3_EXTERN int nghttp3_qpack_encoder_encode(
11821182
* |encoder| is unable to process input because it is malformed.
11831183
*/
11841184
NGHTTP3_EXTERN nghttp3_ssize nghttp3_qpack_encoder_read_decoder(
1185-
nghttp3_qpack_encoder *encoder, const uint8_t *src, size_t srclen);
1185+
nghttp3_qpack_encoder *encoder, const uint8_t *src, size_t srclen);
11861186

11871187
/**
11881188
* @function
@@ -1343,7 +1343,7 @@ NGHTTP3_EXTERN void nghttp3_qpack_decoder_del(nghttp3_qpack_decoder *decoder);
13431343
* Could not interpret encoder stream instruction.
13441344
*/
13451345
NGHTTP3_EXTERN nghttp3_ssize nghttp3_qpack_decoder_read_encoder(
1346-
nghttp3_qpack_decoder *decoder, const uint8_t *src, size_t srclen);
1346+
nghttp3_qpack_decoder *decoder, const uint8_t *src, size_t srclen);
13471347

13481348
/**
13491349
* @function
@@ -1436,9 +1436,9 @@ nghttp3_qpack_decoder_get_icnt(const nghttp3_qpack_decoder *decoder);
14361436
* HTTP field is too large.
14371437
*/
14381438
NGHTTP3_EXTERN nghttp3_ssize nghttp3_qpack_decoder_read_request(
1439-
nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx,
1440-
nghttp3_qpack_nv *nv, uint8_t *pflags, const uint8_t *src, size_t srclen,
1441-
int fin);
1439+
nghttp3_qpack_decoder *decoder, nghttp3_qpack_stream_context *sctx,
1440+
nghttp3_qpack_nv *nv, uint8_t *pflags, const uint8_t *src, size_t srclen,
1441+
int fin);
14421442

14431443
/**
14441444
* @function
@@ -1568,7 +1568,7 @@ typedef void (*nghttp3_debug_vprintf_callback)(const char *format,
15681568
* times because this is important.
15691569
*/
15701570
NGHTTP3_EXTERN void nghttp3_set_debug_vprintf_callback(
1571-
nghttp3_debug_vprintf_callback debug_vprintf_callback);
1571+
nghttp3_debug_vprintf_callback debug_vprintf_callback);
15721572

15731573
/**
15741574
* @macrosection
@@ -2118,9 +2118,10 @@ NGHTTP3_EXTERN int nghttp3_conn_bind_qpack_streams(nghttp3_conn *conn,
21182118
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`
21192119
* User callback failed.
21202120
*
2121-
* It may return the other error codes. In general, the negative
2122-
* error code means that |conn| encountered a connection error, and
2123-
* the connection should be closed.
2121+
* It may return the other error codes. The negative error code means
2122+
* that |conn| encountered a connection error, and the connection must
2123+
* be closed. Calling nghttp3 API other than `nghttp3_conn_del`
2124+
* causes undefined behavior.
21242125
*/
21252126
NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_read_stream(nghttp3_conn *conn,
21262127
int64_t stream_id,
@@ -2152,9 +2153,10 @@ NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_read_stream(nghttp3_conn *conn,
21522153
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`
21532154
* User callback failed.
21542155
*
2155-
* It may return the other error codes. In general, the negative
2156-
* error code means that |conn| encountered a connection error, and
2157-
* the connection should be closed.
2156+
* It may return the other error codes. The negative error code means
2157+
* that |conn| encountered a connection error, and the connection must
2158+
* be closed. Calling nghttp3 API other than `nghttp3_conn_del`
2159+
* causes undefined behavior.
21582160
*/
21592161
NGHTTP3_EXTERN nghttp3_ssize nghttp3_conn_writev_stream(nghttp3_conn *conn,
21602162
int64_t *pstream_id,
@@ -2198,6 +2200,9 @@ NGHTTP3_EXTERN int nghttp3_conn_add_write_offset(nghttp3_conn *conn,
21982200
* If a stream denoted by |stream_id| is not found, this function
21992201
* returns 0.
22002202
*
2203+
* Alternatively, `nghttp3_conn_update_ack_offset` can be used to
2204+
* accomplish the same thing.
2205+
*
22012206
* This function returns 0 if it succeeds, or one of the following
22022207
* negative error codes:
22032208
*
@@ -2207,6 +2212,31 @@ NGHTTP3_EXTERN int nghttp3_conn_add_write_offset(nghttp3_conn *conn,
22072212
NGHTTP3_EXTERN int nghttp3_conn_add_ack_offset(nghttp3_conn *conn,
22082213
int64_t stream_id, uint64_t n);
22092214

2215+
/**
2216+
* @function
2217+
*
2218+
* `nghttp3_conn_update_ack_offset` tells |conn| that QUIC stack has
2219+
* acknowledged the stream data up to |offset| for a stream denoted by
2220+
* |stream_id|.
2221+
*
2222+
* If a stream denoted by |stream_id| is not found, this function
2223+
* returns 0.
2224+
*
2225+
* Alternatively, `nghttp3_conn_add_ack_offset` can be used to
2226+
* accomplish the same thing.
2227+
*
2228+
* This function returns 0 if it succeeds, or one of the following
2229+
* negative error codes:
2230+
*
2231+
* :macro:`NGHTTP3_ERR_INVALID_ARGUMENT`
2232+
* |offset| is less than the number of bytes acknowledged so far.
2233+
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`
2234+
* User callback failed.
2235+
*/
2236+
NGHTTP3_EXTERN int nghttp3_conn_update_ack_offset(nghttp3_conn *conn,
2237+
int64_t stream_id,
2238+
uint64_t offset);
2239+
22102240
/**
22112241
* @function
22122242
*
@@ -2314,9 +2344,9 @@ NGHTTP3_EXTERN int nghttp3_conn_resume_stream(nghttp3_conn *conn,
23142344
/**
23152345
* @function
23162346
*
2317-
* `nghttp3_conn_close_stream` closes stream identified by
2318-
* |stream_id|. QUIC application error code |app_error_code| is the
2319-
* reason of the closure.
2347+
* `nghttp3_conn_close_stream` tells the library that a stream
2348+
* identified by |stream_id| has been closed. QUIC application error
2349+
* code |app_error_code| is the reason of the closure.
23202350
*
23212351
* This function returns 0 if it succeeds, or one of the following
23222352
* negative error codes:
@@ -2419,8 +2449,8 @@ nghttp3_conn_set_max_concurrent_streams(nghttp3_conn *conn,
24192449
* stream.
24202450
*/
24212451
typedef nghttp3_ssize (*nghttp3_read_data_callback)(
2422-
nghttp3_conn *conn, int64_t stream_id, nghttp3_vec *vec, size_t veccnt,
2423-
uint32_t *pflags, void *conn_user_data, void *stream_user_data);
2452+
nghttp3_conn *conn, int64_t stream_id, nghttp3_vec *vec, size_t veccnt,
2453+
uint32_t *pflags, void *conn_user_data, void *stream_user_data);
24242454

24252455
/**
24262456
* @struct
@@ -2460,8 +2490,8 @@ typedef struct nghttp3_data_reader {
24602490
* Out of memory.
24612491
*/
24622492
NGHTTP3_EXTERN int nghttp3_conn_submit_request(
2463-
nghttp3_conn *conn, int64_t stream_id, const nghttp3_nv *nva, size_t nvlen,
2464-
const nghttp3_data_reader *dr, void *stream_user_data);
2493+
nghttp3_conn *conn, int64_t stream_id, const nghttp3_nv *nva, size_t nvlen,
2494+
const nghttp3_data_reader *dr, void *stream_user_data);
24652495

24662496
/**
24672497
* @function
@@ -2667,7 +2697,7 @@ typedef struct NGHTTP3_ALIGN(8) nghttp3_pri {
26672697
* Stream not found.
26682698
*/
26692699
NGHTTP3_EXTERN int nghttp3_conn_get_stream_priority_versioned(
2670-
nghttp3_conn *conn, int pri_version, nghttp3_pri *dest, int64_t stream_id);
2700+
nghttp3_conn *conn, int pri_version, nghttp3_pri *dest, int64_t stream_id);
26712701

26722702
/**
26732703
* @function
@@ -2720,8 +2750,8 @@ NGHTTP3_EXTERN int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn,
27202750
* Out of memory.
27212751
*/
27222752
NGHTTP3_EXTERN int nghttp3_conn_set_server_stream_priority_versioned(
2723-
nghttp3_conn *conn, int64_t stream_id, int pri_version,
2724-
const nghttp3_pri *pri);
2753+
nghttp3_conn *conn, int64_t stream_id, int pri_version,
2754+
const nghttp3_pri *pri);
27252755

27262756
/**
27272757
* @function
@@ -2884,7 +2914,7 @@ NGHTTP3_EXTERN int nghttp3_err_is_fatal(int liberr);
28842914
*/
28852915
#define nghttp3_conn_set_server_stream_priority(CONN, STREAM_ID, PRI) \
28862916
nghttp3_conn_set_server_stream_priority_versioned( \
2887-
(CONN), (STREAM_ID), NGHTTP3_PRI_VERSION, (PRI))
2917+
(CONN), (STREAM_ID), NGHTTP3_PRI_VERSION, (PRI))
28882918

28892919
/*
28902920
* `nghttp3_conn_get_stream_priority` is a wrapper around
@@ -2906,6 +2936,6 @@ NGHTTP3_EXTERN int nghttp3_err_is_fatal(int liberr);
29062936

29072937
#ifdef __cplusplus
29082938
}
2909-
#endif
2939+
#endif /* defined(__cplusplus) */
29102940

2911-
#endif /* NGHTTP3_H */
2941+
#endif /* !defined(NGHTTP3_H) */

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

Lines changed: 3 additions & 3 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 "0.7.0"
34+
#define NGHTTP3_VERSION "1.6.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 0x000700
44+
#define NGHTTP3_VERSION_NUM 0x010600
4545

46-
#endif /* NGHTTP3_VERSION_H */
46+
#endif /* !defined(NGHTTP3_VERSION_H) */

deps/ngtcp2/nghttp3/lib/nghttp3_balloc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ int nghttp3_balloc_get(nghttp3_balloc *balloc, void **pbuf, size_t n) {
6666
assert(n <= balloc->blklen);
6767

6868
if (nghttp3_buf_left(&balloc->buf) < n) {
69-
p = nghttp3_mem_malloc(balloc->mem, sizeof(nghttp3_memblock_hd) + 0x10u +
70-
balloc->blklen);
69+
p = nghttp3_mem_malloc(balloc->mem,
70+
sizeof(nghttp3_memblock_hd) + 0x8u + balloc->blklen);
7171
if (p == NULL) {
7272
return NGHTTP3_ERR_NOMEM;
7373
}
@@ -76,10 +76,10 @@ int nghttp3_balloc_get(nghttp3_balloc *balloc, void **pbuf, size_t n) {
7676
hd->next = balloc->head;
7777
balloc->head = hd;
7878
nghttp3_buf_wrap_init(
79-
&balloc->buf,
80-
(uint8_t *)(((uintptr_t)p + sizeof(nghttp3_memblock_hd) + 0xfu) &
81-
~(uintptr_t)0xfu),
82-
balloc->blklen);
79+
&balloc->buf,
80+
(uint8_t *)(((uintptr_t)p + sizeof(nghttp3_memblock_hd) + 0xfu) &
81+
~(uintptr_t)0xfu),
82+
balloc->blklen);
8383
}
8484

8585
assert(((uintptr_t)balloc->buf.last & 0xfu) == 0);

deps/ngtcp2/nghttp3/lib/nghttp3_balloc.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#ifdef HAVE_CONFIG_H
3030
# include <config.h>
31-
#endif /* HAVE_CONFIG_H */
31+
#endif /* defined(HAVE_CONFIG_H) */
3232

3333
#include <nghttp3/nghttp3.h>
3434

@@ -40,7 +40,10 @@ typedef struct nghttp3_memblock_hd nghttp3_memblock_hd;
4040
* nghttp3_memblock_hd is the header of memory block.
4141
*/
4242
struct nghttp3_memblock_hd {
43-
nghttp3_memblock_hd *next;
43+
union {
44+
nghttp3_memblock_hd *next;
45+
uint64_t pad;
46+
};
4447
};
4548

4649
/*
@@ -89,4 +92,4 @@ int nghttp3_balloc_get(nghttp3_balloc *balloc, void **pbuf, size_t n);
8992
*/
9093
void nghttp3_balloc_clear(nghttp3_balloc *balloc);
9194

92-
#endif /* NGHTTP3_BALLOC_H */
95+
#endif /* !defined(NGHTTP3_BALLOC_H) */

deps/ngtcp2/nghttp3/lib/nghttp3_buf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#ifdef HAVE_CONFIG_H
3030
# include <config.h>
31-
#endif /* HAVE_CONFIG_H */
31+
#endif /* defined(HAVE_CONFIG_H) */
3232

3333
#include <nghttp3/nghttp3.h>
3434

@@ -71,4 +71,4 @@ void nghttp3_typed_buf_init(nghttp3_typed_buf *tbuf, const nghttp3_buf *buf,
7171

7272
void nghttp3_typed_buf_free(nghttp3_typed_buf *tbuf);
7373

74-
#endif /* NGHTTP3_BUF_H */
74+
#endif /* !defined(NGHTTP3_BUF_H) */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy