Skip to content

Commit fc94992

Browse files
nodejs-github-botRafaelGSS
authored andcommitted
deps: update nghttp2 to 1.62.0
PR-URL: #52966 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>
1 parent ec83431 commit fc94992

13 files changed

+74
-44
lines changed

deps/nghttp2/lib/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ EXTRACFLAG = @EXTRACFLAG@
328328
EXTRA_DEFS = @EXTRA_DEFS@
329329
FGREP = @FGREP@
330330
GREP = @GREP@
331-
HAVE_CXX14 = @HAVE_CXX14@
331+
HAVE_CXX20 = @HAVE_CXX20@
332332
INSTALL = @INSTALL@
333333
INSTALL_DATA = @INSTALL_DATA@
334334
INSTALL_PROGRAM = @INSTALL_PROGRAM@

deps/nghttp2/lib/includes/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ EXTRACFLAG = @EXTRACFLAG@
233233
EXTRA_DEFS = @EXTRA_DEFS@
234234
FGREP = @FGREP@
235235
GREP = @GREP@
236-
HAVE_CXX14 = @HAVE_CXX14@
236+
HAVE_CXX20 = @HAVE_CXX20@
237237
INSTALL = @INSTALL@
238238
INSTALL_DATA = @INSTALL_DATA@
239239
INSTALL_PROGRAM = @INSTALL_PROGRAM@

deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
* @macro
3030
* Version number of the nghttp2 library release
3131
*/
32-
#define NGHTTP2_VERSION "1.61.0"
32+
#define NGHTTP2_VERSION "1.62.0"
3333

3434
/**
3535
* @macro
3636
* Numerical representation of the version number of the nghttp2 library
3737
* release. This is a 24 bit number with 8 bits for major number, 8 bits
3838
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
3939
*/
40-
#define NGHTTP2_VERSION_NUM 0x013d00
40+
#define NGHTTP2_VERSION_NUM 0x013e00
4141

4242
#endif /* NGHTTP2VER_H */

deps/nghttp2/lib/nghttp2_buf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap, nghttp2_mem *mem) {
6161
return 0;
6262
}
6363

64-
new_cap = nghttp2_max(new_cap, cap * 2);
64+
new_cap = nghttp2_max_size(new_cap, cap * 2);
6565

6666
ptr = nghttp2_mem_realloc(mem, buf->begin, new_cap);
6767
if (ptr == NULL) {
@@ -343,7 +343,7 @@ int nghttp2_bufs_add(nghttp2_bufs *bufs, const void *data, size_t len) {
343343
while (len) {
344344
buf = &bufs->cur->buf;
345345

346-
nwrite = nghttp2_min(nghttp2_buf_avail(buf), len);
346+
nwrite = nghttp2_min_size(nghttp2_buf_avail(buf), len);
347347
if (nwrite == 0) {
348348
rv = bufs_alloc_chain(bufs);
349349
if (rv != 0) {

deps/nghttp2/lib/nghttp2_hd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,13 +1245,13 @@ static void hd_context_shrink_table_size(nghttp2_hd_context *context,
12451245

12461246
int nghttp2_hd_deflate_change_table_size(
12471247
nghttp2_hd_deflater *deflater, size_t settings_max_dynamic_table_size) {
1248-
size_t next_bufsize = nghttp2_min(settings_max_dynamic_table_size,
1249-
deflater->deflate_hd_table_bufsize_max);
1248+
size_t next_bufsize = nghttp2_min_size(
1249+
settings_max_dynamic_table_size, deflater->deflate_hd_table_bufsize_max);
12501250

12511251
deflater->ctx.hd_table_bufsize_max = next_bufsize;
12521252

12531253
deflater->min_hd_table_bufsize_max =
1254-
nghttp2_min(deflater->min_hd_table_bufsize_max, next_bufsize);
1254+
nghttp2_min_size(deflater->min_hd_table_bufsize_max, next_bufsize);
12551255

12561256
deflater->notify_table_size_change = 1;
12571257

@@ -1738,7 +1738,7 @@ static nghttp2_ssize hd_inflate_read_huff(nghttp2_hd_inflater *inflater,
17381738
static nghttp2_ssize hd_inflate_read(nghttp2_hd_inflater *inflater,
17391739
nghttp2_buf *buf, const uint8_t *in,
17401740
const uint8_t *last) {
1741-
size_t len = nghttp2_min((size_t)(last - in), inflater->left);
1741+
size_t len = nghttp2_min_size((size_t)(last - in), inflater->left);
17421742

17431743
buf->last = nghttp2_cpymem(buf->last, in, len);
17441744

@@ -1962,8 +1962,8 @@ nghttp2_ssize nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
19621962
rfin = 0;
19631963
rv = hd_inflate_read_len(
19641964
inflater, &rfin, in, last, 5,
1965-
nghttp2_min(inflater->min_hd_table_bufsize_max,
1966-
inflater->settings_hd_table_bufsize_max));
1965+
nghttp2_min_size(inflater->min_hd_table_bufsize_max,
1966+
inflater->settings_hd_table_bufsize_max));
19671967
if (rv < 0) {
19681968
goto fail;
19691969
}

deps/nghttp2/lib/nghttp2_hd_huffman.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ nghttp2_ssize nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
116116
uint8_t c;
117117

118118
/* We use the decoding algorithm described in
119-
http://graphics.ics.uci.edu/pub/Prefix.pdf */
119+
- http://graphics.ics.uci.edu/pub/Prefix.pdf [!!! NO LONGER VALID !!!]
120+
- https://ics.uci.edu/~dan/pubs/Prefix.pdf
121+
- https://github.com/nghttp2/nghttp2/files/15141264/Prefix.pdf */
120122
for (; src != end;) {
121123
c = *src++;
122124
t = &huff_decode_table[t->fstate & 0x1ff][c >> 4];

deps/nghttp2/lib/nghttp2_helper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr,
160160
int32_t recv_reduction_delta;
161161
int32_t delta;
162162
int32_t new_recv_window_size =
163-
nghttp2_max(0, *recv_window_size_ptr) - *delta_ptr;
163+
nghttp2_max_int32(0, *recv_window_size_ptr) - *delta_ptr;
164164

165165
if (new_recv_window_size >= 0) {
166166
*recv_window_size_ptr = new_recv_window_size;
@@ -177,7 +177,7 @@ int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr,
177177
*local_window_size_ptr += delta;
178178
/* If there is recv_reduction due to earlier window_size
179179
reduction, we have to adjust it too. */
180-
recv_reduction_delta = nghttp2_min(*recv_reduction_ptr, delta);
180+
recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta);
181181
*recv_reduction_ptr -= recv_reduction_delta;
182182
if (*recv_window_size_ptr < 0) {
183183
*recv_window_size_ptr += recv_reduction_delta;
@@ -233,7 +233,7 @@ int nghttp2_increase_local_window_size(int32_t *local_window_size_ptr,
233233
*local_window_size_ptr += delta;
234234
/* If there is recv_reduction due to earlier window_size
235235
reduction, we have to adjust it too. */
236-
recv_reduction_delta = nghttp2_min(*recv_reduction_ptr, delta);
236+
recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta);
237237
*recv_reduction_ptr -= recv_reduction_delta;
238238

239239
*recv_window_size_ptr += recv_reduction_delta;

deps/nghttp2/lib/nghttp2_helper.h

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,31 @@
3535
#include <nghttp2/nghttp2.h>
3636
#include "nghttp2_mem.h"
3737

38-
#define nghttp2_min(A, B) ((A) < (B) ? (A) : (B))
39-
#define nghttp2_max(A, B) ((A) > (B) ? (A) : (B))
38+
#define nghttp2_max_def(SUFFIX, T) \
39+
static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
40+
41+
nghttp2_max_def(int8, int8_t);
42+
nghttp2_max_def(int16, int16_t);
43+
nghttp2_max_def(int32, int32_t);
44+
nghttp2_max_def(int64, int64_t);
45+
nghttp2_max_def(uint8, uint8_t);
46+
nghttp2_max_def(uint16, uint16_t);
47+
nghttp2_max_def(uint32, uint32_t);
48+
nghttp2_max_def(uint64, uint64_t);
49+
nghttp2_max_def(size, size_t);
50+
51+
#define nghttp2_min_def(SUFFIX, T) \
52+
static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
53+
54+
nghttp2_min_def(int8, int8_t);
55+
nghttp2_min_def(int16, int16_t);
56+
nghttp2_min_def(int32, int32_t);
57+
nghttp2_min_def(int64, int64_t);
58+
nghttp2_min_def(uint8, uint8_t);
59+
nghttp2_min_def(uint16, uint16_t);
60+
nghttp2_min_def(uint32, uint32_t);
61+
nghttp2_min_def(uint64, uint64_t);
62+
nghttp2_min_def(size, size_t);
4063

4164
#define lstreq(A, B, N) ((sizeof((A)) - 1) == (N) && memcmp((A), (B), (N)) == 0)
4265

deps/nghttp2/lib/nghttp2_pq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int nghttp2_pq_push(nghttp2_pq *pq, nghttp2_pq_entry *item) {
6969
void *nq;
7070
size_t ncapacity;
7171

72-
ncapacity = nghttp2_max(4, (pq->capacity * 2));
72+
ncapacity = nghttp2_max_size(4, (pq->capacity * 2));
7373

7474
nq = nghttp2_mem_realloc(pq->mem, pq->q,
7575
ncapacity * sizeof(nghttp2_pq_entry *));

deps/nghttp2/lib/nghttp2_ratelim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void nghttp2_ratelim_update(nghttp2_ratelim *rl, uint64_t tstamp) {
6161
}
6262

6363
rl->val += gain;
64-
rl->val = nghttp2_min(rl->val, rl->burst);
64+
rl->val = nghttp2_min_uint64(rl->val, rl->burst);
6565
}
6666

6767
int nghttp2_ratelim_drain(nghttp2_ratelim *rl, uint64_t n) {

0 commit comments

Comments
 (0)