Skip to content

Commit 3133097

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update nghttp2 to 1.70.0
PR-URL: #64939 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
1 parent a395157 commit 3133097

34 files changed

Lines changed: 5117 additions & 5680 deletions

deps/nghttp2/lib/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ EXTRA_DEFS = @EXTRA_DEFS@
329329
FGREP = @FGREP@
330330
FILECMD = @FILECMD@
331331
GREP = @GREP@
332-
HAVE_CXX20 = @HAVE_CXX20@
332+
HAVE_CXX23 = @HAVE_CXX23@
333333
INSTALL = @INSTALL@
334334
INSTALL_DATA = @INSTALL_DATA@
335335
INSTALL_PROGRAM = @INSTALL_PROGRAM@

deps/nghttp2/lib/includes/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ EXTRA_DEFS = @EXTRA_DEFS@
234234
FGREP = @FGREP@
235235
FILECMD = @FILECMD@
236236
GREP = @GREP@
237-
HAVE_CXX20 = @HAVE_CXX20@
237+
HAVE_CXX23 = @HAVE_CXX23@
238238
INSTALL = @INSTALL@
239239
INSTALL_DATA = @INSTALL_DATA@
240240
INSTALL_PROGRAM = @INSTALL_PROGRAM@

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -664,12 +664,12 @@ typedef enum {
664664
* The ALTSVC frame, which is defined in `RFC 7383
665665
* <https://tools.ietf.org/html/rfc7838#section-4>`_.
666666
*/
667-
NGHTTP2_ALTSVC = 0x0a,
667+
NGHTTP2_ALTSVC = 0x0A,
668668
/**
669669
* The ORIGIN frame, which is defined by `RFC 8336
670670
* <https://tools.ietf.org/html/rfc8336>`_.
671671
*/
672-
NGHTTP2_ORIGIN = 0x0c,
672+
NGHTTP2_ORIGIN = 0x0C,
673673
/**
674674
* The PRIORITY_UPDATE frame, which is defined by :rfc:`9218`.
675675
*/
@@ -756,7 +756,7 @@ typedef enum {
756756
*
757757
* .. warning::
758758
*
759-
* Deprecated. The initial max concurrent streams is 0xffffffffu.
759+
* Deprecated. The initial max concurrent streams is 0xFFFFFFFFU.
760760
*
761761
* Default maximum number of incoming concurrent streams. Use
762762
* `nghttp2_submit_settings()` with
@@ -818,19 +818,19 @@ typedef enum {
818818
/**
819819
* CONNECT_ERROR
820820
*/
821-
NGHTTP2_CONNECT_ERROR = 0x0a,
821+
NGHTTP2_CONNECT_ERROR = 0x0A,
822822
/**
823823
* ENHANCE_YOUR_CALM
824824
*/
825-
NGHTTP2_ENHANCE_YOUR_CALM = 0x0b,
825+
NGHTTP2_ENHANCE_YOUR_CALM = 0x0B,
826826
/**
827827
* INADEQUATE_SECURITY
828828
*/
829-
NGHTTP2_INADEQUATE_SECURITY = 0x0c,
829+
NGHTTP2_INADEQUATE_SECURITY = 0x0C,
830830
/**
831831
* HTTP_1_1_REQUIRED
832832
*/
833-
NGHTTP2_HTTP_1_1_REQUIRED = 0x0d
833+
NGHTTP2_HTTP_1_1_REQUIRED = 0x0D
834834
} nghttp2_error_code;
835835

836836
/**

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.69.0"
32+
#define NGHTTP2_VERSION "1.70.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 0x014500
40+
#define NGHTTP2_VERSION_NUM 0x014600
4141

4242
#endif /* NGHTTP2VER_H */

deps/nghttp2/lib/nghttp2_buf.c

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
#include "nghttp2_helper.h"
3030
#include "nghttp2_debug.h"
3131

32-
void nghttp2_buf_init(nghttp2_buf *buf) {
33-
buf->begin = NULL;
34-
buf->end = NULL;
35-
buf->pos = NULL;
36-
buf->last = NULL;
37-
buf->mark = NULL;
38-
}
32+
void nghttp2_buf_init(nghttp2_buf *buf) { *buf = (nghttp2_buf){0}; }
3933

4034
int nghttp2_buf_init2(nghttp2_buf *buf, size_t initial, nghttp2_mem *mem) {
4135
nghttp2_buf_init(buf);
@@ -212,16 +206,15 @@ int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len,
212206

213207
nghttp2_buf_wrap_init(&chain->buf, begin, len);
214208

215-
bufs->mem = mem;
216-
bufs->offset = 0;
217-
218-
bufs->head = chain;
219-
bufs->cur = bufs->head;
220-
221-
bufs->chunk_length = len;
222-
bufs->chunk_used = 1;
223-
bufs->max_chunk = 1;
224-
bufs->chunk_keep = 1;
209+
*bufs = (nghttp2_bufs){
210+
.head = chain,
211+
.cur = chain,
212+
.mem = mem,
213+
.chunk_length = len,
214+
.max_chunk = 1,
215+
.chunk_used = 1,
216+
.chunk_keep = 1,
217+
};
225218

226219
return 0;
227220
}
@@ -251,17 +244,15 @@ int nghttp2_bufs_wrap_init2(nghttp2_bufs *bufs, const nghttp2_vec *vec,
251244
dst_chain = &cur_chain->next;
252245
}
253246

254-
bufs->mem = mem;
255-
bufs->offset = 0;
256-
257-
bufs->head = head_chain;
258-
bufs->cur = bufs->head;
259-
260-
/* We don't use chunk_length since no allocation is expected. */
261-
bufs->chunk_length = 0;
262-
bufs->chunk_used = veclen;
263-
bufs->max_chunk = veclen;
264-
bufs->chunk_keep = veclen;
247+
*bufs = (nghttp2_bufs){
248+
.head = head_chain,
249+
.cur = head_chain,
250+
.mem = mem,
251+
/* We don't use chunk_length since no allocation is expected. */
252+
.max_chunk = veclen,
253+
.chunk_used = veclen,
254+
.chunk_keep = veclen,
255+
};
265256

266257
return 0;
267258
}

deps/nghttp2/lib/nghttp2_extpri.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ uint8_t nghttp2_extpri_to_uint8(const nghttp2_extpri *extpri) {
3131
}
3232

3333
void nghttp2_extpri_from_uint8(nghttp2_extpri *extpri, uint8_t u8extpri) {
34-
extpri->urgency = nghttp2_extpri_uint8_urgency(u8extpri);
35-
extpri->inc = nghttp2_extpri_uint8_inc(u8extpri);
34+
*extpri = (nghttp2_extpri){
35+
.urgency = nghttp2_extpri_uint8_urgency(u8extpri),
36+
.inc = nghttp2_extpri_uint8_inc(u8extpri),
37+
};
3638
}
3739

3840
int nghttp2_extpri_parse_priority(nghttp2_extpri *extpri, const uint8_t *value,

deps/nghttp2/lib/nghttp2_extpri.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* NGHTTP2_EXTPRI_INC_MASK is a bit mask to retrieve incremental bit
3737
* from a value produced by nghttp2_extpri_to_uint8.
3838
*/
39-
#define NGHTTP2_EXTPRI_INC_MASK (1 << 7)
39+
#define NGHTTP2_EXTPRI_INC_MASK 0x80U
4040

4141
/*
4242
* nghttp2_extpri_to_uint8 encodes |pri| into uint8_t variable.

deps/nghttp2/lib/nghttp2_frame.c

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,22 @@ void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd) {
4343
}
4444

4545
void nghttp2_frame_unpack_frame_hd(nghttp2_frame_hd *hd, const uint8_t *buf) {
46-
hd->length = nghttp2_get_uint32(&buf[0]) >> 8;
47-
hd->type = buf[3];
48-
hd->flags = buf[4];
49-
hd->stream_id = nghttp2_get_uint32(&buf[5]) & NGHTTP2_STREAM_ID_MASK;
50-
hd->reserved = 0;
46+
*hd = (nghttp2_frame_hd){
47+
.length = nghttp2_get_uint32(&buf[0]) >> 8,
48+
.stream_id = nghttp2_get_uint32(&buf[5]) & NGHTTP2_STREAM_ID_MASK,
49+
.type = buf[3],
50+
.flags = buf[4],
51+
};
5152
}
5253

5354
void nghttp2_frame_hd_init(nghttp2_frame_hd *hd, size_t length, uint8_t type,
5455
uint8_t flags, int32_t stream_id) {
55-
hd->length = length;
56-
hd->type = type;
57-
hd->flags = flags;
58-
hd->stream_id = stream_id;
59-
hd->reserved = 0;
56+
*hd = (nghttp2_frame_hd){
57+
.length = length,
58+
.stream_id = stream_id,
59+
.type = type,
60+
.flags = flags,
61+
};
6062
}
6163

6264
void nghttp2_frame_headers_init(nghttp2_headers *frame, uint8_t flags,
@@ -199,16 +201,15 @@ void nghttp2_frame_extension_free(nghttp2_extension *frame) { (void)frame; }
199201
void nghttp2_frame_altsvc_init(nghttp2_extension *frame, int32_t stream_id,
200202
uint8_t *origin, size_t origin_len,
201203
uint8_t *field_value, size_t field_value_len) {
202-
nghttp2_ext_altsvc *altsvc;
203-
204204
nghttp2_frame_hd_init(&frame->hd, 2 + origin_len + field_value_len,
205205
NGHTTP2_ALTSVC, NGHTTP2_FLAG_NONE, stream_id);
206206

207-
altsvc = frame->payload;
208-
altsvc->origin = origin;
209-
altsvc->origin_len = origin_len;
210-
altsvc->field_value = field_value;
211-
altsvc->field_value_len = field_value_len;
207+
*(nghttp2_ext_altsvc *)frame->payload = (nghttp2_ext_altsvc){
208+
.origin = origin,
209+
.origin_len = origin_len,
210+
.field_value = field_value,
211+
.field_value_len = field_value_len,
212+
};
212213
}
213214

214215
void nghttp2_frame_altsvc_free(nghttp2_extension *frame, nghttp2_mem *mem) {
@@ -225,7 +226,6 @@ void nghttp2_frame_altsvc_free(nghttp2_extension *frame, nghttp2_mem *mem) {
225226

226227
void nghttp2_frame_origin_init(nghttp2_extension *frame,
227228
nghttp2_origin_entry *ov, size_t nov) {
228-
nghttp2_ext_origin *origin;
229229
size_t payloadlen = 0;
230230
size_t i;
231231

@@ -236,9 +236,10 @@ void nghttp2_frame_origin_init(nghttp2_extension *frame,
236236
nghttp2_frame_hd_init(&frame->hd, payloadlen, NGHTTP2_ORIGIN,
237237
NGHTTP2_FLAG_NONE, 0);
238238

239-
origin = frame->payload;
240-
origin->ov = ov;
241-
origin->nov = nov;
239+
*(nghttp2_ext_origin *)frame->payload = (nghttp2_ext_origin){
240+
.ov = ov,
241+
.nov = nov,
242+
};
242243
}
243244

244245
void nghttp2_frame_origin_free(nghttp2_extension *frame, nghttp2_mem *mem) {
@@ -256,15 +257,15 @@ void nghttp2_frame_origin_free(nghttp2_extension *frame, nghttp2_mem *mem) {
256257
void nghttp2_frame_priority_update_init(nghttp2_extension *frame,
257258
int32_t stream_id, uint8_t *field_value,
258259
size_t field_value_len) {
259-
nghttp2_ext_priority_update *priority_update;
260-
261260
nghttp2_frame_hd_init(&frame->hd, 4 + field_value_len,
262261
NGHTTP2_PRIORITY_UPDATE, NGHTTP2_FLAG_NONE, 0);
263262

264-
priority_update = frame->payload;
265-
priority_update->stream_id = stream_id;
266-
priority_update->field_value = field_value;
267-
priority_update->field_value_len = field_value_len;
263+
*(nghttp2_ext_priority_update *)frame->payload =
264+
(nghttp2_ext_priority_update){
265+
.stream_id = stream_id,
266+
.field_value = field_value,
267+
.field_value_len = field_value_len,
268+
};
268269
}
269270

270271
void nghttp2_frame_priority_update_free(nghttp2_extension *frame,
@@ -517,8 +518,10 @@ void nghttp2_frame_unpack_settings_payload(nghttp2_settings *frame,
517518

518519
void nghttp2_frame_unpack_settings_entry(nghttp2_settings_entry *iv,
519520
const uint8_t *payload) {
520-
iv->settings_id = nghttp2_get_uint16(&payload[0]);
521-
iv->value = nghttp2_get_uint32(&payload[2]);
521+
*iv = (nghttp2_settings_entry){
522+
.settings_id = nghttp2_get_uint16(&payload[0]),
523+
.value = nghttp2_get_uint32(&payload[2]),
524+
};
522525
}
523526

524527
int nghttp2_frame_unpack_settings_payload2(nghttp2_settings_entry **iv_ptr,
@@ -752,10 +755,7 @@ void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame,
752755
altsvc = frame->payload;
753756

754757
if (payloadlen == 0) {
755-
altsvc->origin = NULL;
756-
altsvc->origin_len = 0;
757-
altsvc->field_value = NULL;
758-
altsvc->field_value_len = 0;
758+
*altsvc = (nghttp2_ext_altsvc){0};
759759

760760
return;
761761
}
@@ -862,8 +862,7 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
862862
}
863863

864864
if (nov == 0) {
865-
origin->ov = NULL;
866-
origin->nov = 0;
865+
*origin = (nghttp2_ext_origin){0};
867866

868867
return 0;
869868
}
@@ -875,8 +874,10 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
875874
return NGHTTP2_ERR_NOMEM;
876875
}
877876

878-
origin->ov = ov;
879-
origin->nov = nov;
877+
*origin = (nghttp2_ext_origin){
878+
.nov = nov,
879+
.ov = ov,
880+
};
880881

881882
dst = (uint8_t *)ov + nov * sizeof(nghttp2_origin_entry);
882883
p = payload;
@@ -887,8 +888,10 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
887888
if (originlen == 0) {
888889
continue;
889890
}
890-
ov->origin = dst;
891-
ov->origin_len = originlen;
891+
*ov = (nghttp2_origin_entry){
892+
.origin = dst,
893+
.origin_len = originlen,
894+
};
892895
dst = nghttp2_cpymem(dst, p, originlen);
893896
*dst++ = '\0';
894897
p += originlen;

0 commit comments

Comments
 (0)