Skip to content

Commit 1424404

Browse files
nodejs-github-botruyadorno
authored andcommitted
deps: update nghttp2 to 1.56.0
PR-URL: #49582 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 521a932 commit 1424404

File tree

7 files changed

+83
-234
lines changed

7 files changed

+83
-234
lines changed

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

+2-2
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.55.1"
32+
#define NGHTTP2_VERSION "1.56.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 0x013701
40+
#define NGHTTP2_VERSION_NUM 0x013800
4141

4242
#endif /* NGHTTP2VER_H */

deps/nghttp2/lib/nghttp2_frame.c

+16-33
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ void nghttp2_frame_unpack_priority_spec(nghttp2_priority_spec *pri_spec,
418418
nghttp2_priority_spec_init(pri_spec, dep_stream_id, weight, exclusive);
419419
}
420420

421-
int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
422-
const uint8_t *payload) {
421+
void nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
422+
const uint8_t *payload) {
423423
if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) {
424424
nghttp2_frame_unpack_priority_spec(&frame->pri_spec, payload);
425425
} else {
@@ -428,11 +428,9 @@ int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
428428

429429
frame->nva = NULL;
430430
frame->nvlen = 0;
431-
432-
return 0;
433431
}
434432

435-
int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) {
433+
void nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) {
436434
nghttp2_buf *buf;
437435

438436
assert(bufs->head == bufs->cur);
@@ -448,17 +446,15 @@ int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) {
448446
nghttp2_frame_pack_priority_spec(buf->last, &frame->pri_spec);
449447

450448
buf->last += NGHTTP2_PRIORITY_SPECLEN;
451-
452-
return 0;
453449
}
454450

455451
void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame,
456452
const uint8_t *payload) {
457453
nghttp2_frame_unpack_priority_spec(&frame->pri_spec, payload);
458454
}
459455

460-
int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
461-
nghttp2_rst_stream *frame) {
456+
void nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
457+
nghttp2_rst_stream *frame) {
462458
nghttp2_buf *buf;
463459

464460
assert(bufs->head == bufs->cur);
@@ -473,8 +469,6 @@ int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
473469

474470
nghttp2_put_uint32be(buf->last, frame->error_code);
475471
buf->last += 4;
476-
477-
return 0;
478472
}
479473

480474
void nghttp2_frame_unpack_rst_stream_payload(nghttp2_rst_stream *frame,
@@ -592,16 +586,15 @@ int nghttp2_frame_pack_push_promise(nghttp2_bufs *bufs,
592586
return frame_pack_headers_shared(bufs, &frame->hd);
593587
}
594588

595-
int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
596-
const uint8_t *payload) {
589+
void nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
590+
const uint8_t *payload) {
597591
frame->promised_stream_id =
598592
nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
599593
frame->nva = NULL;
600594
frame->nvlen = 0;
601-
return 0;
602595
}
603596

604-
int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) {
597+
void nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) {
605598
nghttp2_buf *buf;
606599

607600
assert(bufs->head == bufs->cur);
@@ -616,8 +609,6 @@ int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) {
616609

617610
buf->last =
618611
nghttp2_cpymem(buf->last, frame->opaque_data, sizeof(frame->opaque_data));
619-
620-
return 0;
621612
}
622613

623614
void nghttp2_frame_unpack_ping_payload(nghttp2_ping *frame,
@@ -697,8 +688,8 @@ int nghttp2_frame_unpack_goaway_payload2(nghttp2_goaway *frame,
697688
return 0;
698689
}
699690

700-
int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
701-
nghttp2_window_update *frame) {
691+
void nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
692+
nghttp2_window_update *frame) {
702693
nghttp2_buf *buf;
703694

704695
assert(bufs->head == bufs->cur);
@@ -713,8 +704,6 @@ int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
713704

714705
nghttp2_put_uint32be(buf->last, (uint32_t)frame->window_size_increment);
715706
buf->last += 4;
716-
717-
return 0;
718707
}
719708

720709
void nghttp2_frame_unpack_window_update_payload(nghttp2_window_update *frame,
@@ -723,7 +712,7 @@ void nghttp2_frame_unpack_window_update_payload(nghttp2_window_update *frame,
723712
nghttp2_get_uint32(payload) & NGHTTP2_WINDOW_SIZE_INCREMENT_MASK;
724713
}
725714

726-
int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) {
715+
void nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) {
727716
int rv;
728717
nghttp2_buf *buf;
729718
nghttp2_ext_altsvc *altsvc;
@@ -752,8 +741,6 @@ int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) {
752741
rv = nghttp2_bufs_add(bufs, altsvc->field_value, altsvc->field_value_len);
753742

754743
assert(rv == 0);
755-
756-
return 0;
757744
}
758745

759746
void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame,
@@ -901,8 +888,8 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
901888
return 0;
902889
}
903890

904-
int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
905-
nghttp2_extension *frame) {
891+
void nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
892+
nghttp2_extension *frame) {
906893
int rv;
907894
nghttp2_buf *buf;
908895
nghttp2_ext_priority_update *priority_update;
@@ -927,8 +914,6 @@ int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
927914
priority_update->field_value_len);
928915

929916
assert(rv == 0);
930-
931-
return 0;
932917
}
933918

934919
void nghttp2_frame_unpack_priority_update_payload(nghttp2_extension *frame,
@@ -1186,14 +1171,14 @@ static void frame_set_pad(nghttp2_buf *buf, size_t padlen, int framehd_only) {
11861171
buf->last += trail_padlen;
11871172
}
11881173

1189-
int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
1190-
size_t padlen, int framehd_only) {
1174+
void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
1175+
size_t padlen, int framehd_only) {
11911176
nghttp2_buf *buf;
11921177

11931178
if (padlen == 0) {
11941179
DEBUGF("send: padlen = 0, nothing to do\n");
11951180

1196-
return 0;
1181+
return;
11971182
}
11981183

11991184
/*
@@ -1226,6 +1211,4 @@ int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
12261211
hd->flags |= NGHTTP2_FLAG_PADDED;
12271212

12281213
DEBUGF("send: final payloadlen=%zu, padlen=%zu\n", hd->length, padlen);
1229-
1230-
return 0;
12311214
}

deps/nghttp2/lib/nghttp2_frame.h

+15-47
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,18 @@ int nghttp2_frame_pack_headers(nghttp2_bufs *bufs, nghttp2_headers *frame,
143143
* Unpacks HEADERS frame byte sequence into |frame|. This function
144144
* only unapcks bytes that come before name/value header block and
145145
* after possible Pad Length field.
146-
*
147-
* This function always succeeds and returns 0.
148146
*/
149-
int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
150-
const uint8_t *payload);
147+
void nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
148+
const uint8_t *payload);
151149

152150
/*
153151
* Packs PRIORITY frame |frame| in wire format and store it in
154152
* |bufs|.
155153
*
156154
* The caller must make sure that nghttp2_bufs_reset(bufs) is called
157155
* before calling this function.
158-
*
159-
* This function always succeeds and returns 0.
160156
*/
161-
int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame);
157+
void nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame);
162158

163159
/*
164160
* Unpacks PRIORITY wire format into |frame|.
@@ -172,11 +168,9 @@ void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame,
172168
*
173169
* The caller must make sure that nghttp2_bufs_reset(bufs) is called
174170
* before calling this function.
175-
*
176-
* This function always succeeds and returns 0.
177171
*/
178-
int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
179-
nghttp2_rst_stream *frame);
172+
void nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
173+
nghttp2_rst_stream *frame);
180174

181175
/*
182176
* Unpacks RST_STREAM frame byte sequence into |frame|.
@@ -265,26 +259,18 @@ int nghttp2_frame_pack_push_promise(nghttp2_bufs *bufs,
265259
* Unpacks PUSH_PROMISE frame byte sequence into |frame|. This
266260
* function only unapcks bytes that come before name/value header
267261
* block and after possible Pad Length field.
268-
*
269-
* This function returns 0 if it succeeds or one of the following
270-
* negative error codes:
271-
*
272-
* NGHTTP2_ERR_PROTO
273-
* TODO END_HEADERS flag is not set
274262
*/
275-
int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
276-
const uint8_t *payload);
263+
void nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
264+
const uint8_t *payload);
277265

278266
/*
279267
* Packs PING frame |frame| in wire format and store it in
280268
* |bufs|.
281269
*
282270
* The caller must make sure that nghttp2_bufs_reset(bufs) is called
283271
* before calling this function.
284-
*
285-
* This function always succeeds and returns 0.
286272
*/
287-
int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame);
273+
void nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame);
288274

289275
/*
290276
* Unpacks PING wire format into |frame|.
@@ -343,11 +329,9 @@ int nghttp2_frame_unpack_goaway_payload2(nghttp2_goaway *frame,
343329
*
344330
* The caller must make sure that nghttp2_bufs_reset(bufs) is called
345331
* before calling this function.
346-
*
347-
* This function always succeeds and returns 0.
348332
*/
349-
int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
350-
nghttp2_window_update *frame);
333+
void nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
334+
nghttp2_window_update *frame);
351335

352336
/*
353337
* Unpacks WINDOW_UPDATE frame byte sequence into |frame|.
@@ -361,17 +345,13 @@ void nghttp2_frame_unpack_window_update_payload(nghttp2_window_update *frame,
361345
*
362346
* The caller must make sure that nghttp2_bufs_reset(bufs) is called
363347
* before calling this function.
364-
*
365-
* This function always succeeds and returns 0.
366348
*/
367-
int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *ext);
349+
void nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *ext);
368350

369351
/*
370352
* Unpacks ALTSVC wire format into |frame|. The |payload| of
371353
* |payloadlen| bytes contains frame payload. This function assumes
372354
* that frame->payload points to the nghttp2_ext_altsvc object.
373-
*
374-
* This function always succeeds and returns 0.
375355
*/
376356
void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame,
377357
size_t origin_len, uint8_t *payload,
@@ -431,19 +411,15 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
431411
*
432412
* The caller must make sure that nghttp2_bufs_reset(bufs) is called
433413
* before calling this function.
434-
*
435-
* This function always succeeds and returns 0.
436414
*/
437-
int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
438-
nghttp2_extension *ext);
415+
void nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
416+
nghttp2_extension *ext);
439417

440418
/*
441419
* Unpacks PRIORITY_UPDATE wire format into |frame|. The |payload| of
442420
* |payloadlen| bytes contains frame payload. This function assumes
443421
* that frame->payload points to the nghttp2_ext_priority_update
444422
* object.
445-
*
446-
* This function always succeeds and returns 0.
447423
*/
448424
void nghttp2_frame_unpack_priority_update_payload(nghttp2_extension *frame,
449425
uint8_t *payload,
@@ -654,16 +630,8 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv);
654630
* |padlen| including Pad Length field. The |hd| is the frame header
655631
* for the serialized data. This function fills zeros padding region
656632
* unless framehd_only is nonzero.
657-
*
658-
* This function returns 0 if it succeeds, or one of the following
659-
* negative error codes:
660-
*
661-
* NGHTTP2_ERR_NOMEM
662-
* Out of memory.
663-
* NGHTTP2_ERR_FRAME_SIZE_ERROR
664-
* The length of the resulting frame is too large.
665633
*/
666-
int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
667-
size_t padlen, int framehd_only);
634+
void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
635+
size_t padlen, int framehd_only);
668636

669637
#endif /* NGHTTP2_FRAME_H */

0 commit comments

Comments
 (0)