diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h index fba310c7888d0c..7f5251a6243e41 100644 --- a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h @@ -29,7 +29,7 @@ * @macro * Version number of the nghttp2 library release */ -#define NGHTTP2_VERSION "1.55.1" +#define NGHTTP2_VERSION "1.56.0" /** * @macro @@ -37,6 +37,6 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define NGHTTP2_VERSION_NUM 0x013701 +#define NGHTTP2_VERSION_NUM 0x013800 #endif /* NGHTTP2VER_H */ diff --git a/deps/nghttp2/lib/nghttp2_frame.c b/deps/nghttp2/lib/nghttp2_frame.c index 35072c15fc18e6..77cb463df5441f 100644 --- a/deps/nghttp2/lib/nghttp2_frame.c +++ b/deps/nghttp2/lib/nghttp2_frame.c @@ -418,8 +418,8 @@ void nghttp2_frame_unpack_priority_spec(nghttp2_priority_spec *pri_spec, nghttp2_priority_spec_init(pri_spec, dep_stream_id, weight, exclusive); } -int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame, - const uint8_t *payload) { +void nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame, + const uint8_t *payload) { if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) { nghttp2_frame_unpack_priority_spec(&frame->pri_spec, payload); } else { @@ -428,11 +428,9 @@ int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame, frame->nva = NULL; frame->nvlen = 0; - - return 0; } -int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) { +void nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) { nghttp2_buf *buf; assert(bufs->head == bufs->cur); @@ -448,8 +446,6 @@ int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) { nghttp2_frame_pack_priority_spec(buf->last, &frame->pri_spec); buf->last += NGHTTP2_PRIORITY_SPECLEN; - - return 0; } void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame, @@ -457,8 +453,8 @@ void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame, nghttp2_frame_unpack_priority_spec(&frame->pri_spec, payload); } -int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs, - nghttp2_rst_stream *frame) { +void nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs, + nghttp2_rst_stream *frame) { nghttp2_buf *buf; assert(bufs->head == bufs->cur); @@ -473,8 +469,6 @@ int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs, nghttp2_put_uint32be(buf->last, frame->error_code); buf->last += 4; - - return 0; } void nghttp2_frame_unpack_rst_stream_payload(nghttp2_rst_stream *frame, @@ -592,16 +586,15 @@ int nghttp2_frame_pack_push_promise(nghttp2_bufs *bufs, return frame_pack_headers_shared(bufs, &frame->hd); } -int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame, - const uint8_t *payload) { +void nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame, + const uint8_t *payload) { frame->promised_stream_id = nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK; frame->nva = NULL; frame->nvlen = 0; - return 0; } -int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) { +void nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) { nghttp2_buf *buf; assert(bufs->head == bufs->cur); @@ -616,8 +609,6 @@ int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) { buf->last = nghttp2_cpymem(buf->last, frame->opaque_data, sizeof(frame->opaque_data)); - - return 0; } void nghttp2_frame_unpack_ping_payload(nghttp2_ping *frame, @@ -697,8 +688,8 @@ int nghttp2_frame_unpack_goaway_payload2(nghttp2_goaway *frame, return 0; } -int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs, - nghttp2_window_update *frame) { +void nghttp2_frame_pack_window_update(nghttp2_bufs *bufs, + nghttp2_window_update *frame) { nghttp2_buf *buf; assert(bufs->head == bufs->cur); @@ -713,8 +704,6 @@ int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs, nghttp2_put_uint32be(buf->last, (uint32_t)frame->window_size_increment); buf->last += 4; - - return 0; } 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, nghttp2_get_uint32(payload) & NGHTTP2_WINDOW_SIZE_INCREMENT_MASK; } -int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) { +void nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) { int rv; nghttp2_buf *buf; nghttp2_ext_altsvc *altsvc; @@ -752,8 +741,6 @@ int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) { rv = nghttp2_bufs_add(bufs, altsvc->field_value, altsvc->field_value_len); assert(rv == 0); - - return 0; } void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame, @@ -901,8 +888,8 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame, return 0; } -int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs, - nghttp2_extension *frame) { +void nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs, + nghttp2_extension *frame) { int rv; nghttp2_buf *buf; nghttp2_ext_priority_update *priority_update; @@ -927,8 +914,6 @@ int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs, priority_update->field_value_len); assert(rv == 0); - - return 0; } 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) { buf->last += trail_padlen; } -int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, - size_t padlen, int framehd_only) { +void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, + size_t padlen, int framehd_only) { nghttp2_buf *buf; if (padlen == 0) { DEBUGF("send: padlen = 0, nothing to do\n"); - return 0; + return; } /* @@ -1226,6 +1211,4 @@ int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, hd->flags |= NGHTTP2_FLAG_PADDED; DEBUGF("send: final payloadlen=%zu, padlen=%zu\n", hd->length, padlen); - - return 0; } diff --git a/deps/nghttp2/lib/nghttp2_frame.h b/deps/nghttp2/lib/nghttp2_frame.h index 5f6152b74587ae..d58668806c432a 100644 --- a/deps/nghttp2/lib/nghttp2_frame.h +++ b/deps/nghttp2/lib/nghttp2_frame.h @@ -143,11 +143,9 @@ int nghttp2_frame_pack_headers(nghttp2_bufs *bufs, nghttp2_headers *frame, * Unpacks HEADERS frame byte sequence into |frame|. This function * only unapcks bytes that come before name/value header block and * after possible Pad Length field. - * - * This function always succeeds and returns 0. */ -int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame, - const uint8_t *payload); +void nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame, + const uint8_t *payload); /* * Packs PRIORITY frame |frame| in wire format and store it in @@ -155,10 +153,8 @@ int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame, * * The caller must make sure that nghttp2_bufs_reset(bufs) is called * before calling this function. - * - * This function always succeeds and returns 0. */ -int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame); +void nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame); /* * Unpacks PRIORITY wire format into |frame|. @@ -172,11 +168,9 @@ void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame, * * The caller must make sure that nghttp2_bufs_reset(bufs) is called * before calling this function. - * - * This function always succeeds and returns 0. */ -int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs, - nghttp2_rst_stream *frame); +void nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs, + nghttp2_rst_stream *frame); /* * Unpacks RST_STREAM frame byte sequence into |frame|. @@ -265,15 +259,9 @@ int nghttp2_frame_pack_push_promise(nghttp2_bufs *bufs, * Unpacks PUSH_PROMISE frame byte sequence into |frame|. This * function only unapcks bytes that come before name/value header * block and after possible Pad Length field. - * - * This function returns 0 if it succeeds or one of the following - * negative error codes: - * - * NGHTTP2_ERR_PROTO - * TODO END_HEADERS flag is not set */ -int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame, - const uint8_t *payload); +void nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame, + const uint8_t *payload); /* * Packs PING frame |frame| in wire format and store it in @@ -281,10 +269,8 @@ int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame, * * The caller must make sure that nghttp2_bufs_reset(bufs) is called * before calling this function. - * - * This function always succeeds and returns 0. */ -int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame); +void nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame); /* * Unpacks PING wire format into |frame|. @@ -343,11 +329,9 @@ int nghttp2_frame_unpack_goaway_payload2(nghttp2_goaway *frame, * * The caller must make sure that nghttp2_bufs_reset(bufs) is called * before calling this function. - * - * This function always succeeds and returns 0. */ -int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs, - nghttp2_window_update *frame); +void nghttp2_frame_pack_window_update(nghttp2_bufs *bufs, + nghttp2_window_update *frame); /* * Unpacks WINDOW_UPDATE frame byte sequence into |frame|. @@ -361,17 +345,13 @@ void nghttp2_frame_unpack_window_update_payload(nghttp2_window_update *frame, * * The caller must make sure that nghttp2_bufs_reset(bufs) is called * before calling this function. - * - * This function always succeeds and returns 0. */ -int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *ext); +void nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *ext); /* * Unpacks ALTSVC wire format into |frame|. The |payload| of * |payloadlen| bytes contains frame payload. This function assumes * that frame->payload points to the nghttp2_ext_altsvc object. - * - * This function always succeeds and returns 0. */ void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame, size_t origin_len, uint8_t *payload, @@ -431,19 +411,15 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame, * * The caller must make sure that nghttp2_bufs_reset(bufs) is called * before calling this function. - * - * This function always succeeds and returns 0. */ -int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs, - nghttp2_extension *ext); +void nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs, + nghttp2_extension *ext); /* * Unpacks PRIORITY_UPDATE wire format into |frame|. The |payload| of * |payloadlen| bytes contains frame payload. This function assumes * that frame->payload points to the nghttp2_ext_priority_update * object. - * - * This function always succeeds and returns 0. */ void nghttp2_frame_unpack_priority_update_payload(nghttp2_extension *frame, uint8_t *payload, @@ -654,16 +630,8 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv); * |padlen| including Pad Length field. The |hd| is the frame header * for the serialized data. This function fills zeros padding region * unless framehd_only is nonzero. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * NGHTTP2_ERR_NOMEM - * Out of memory. - * NGHTTP2_ERR_FRAME_SIZE_ERROR - * The length of the resulting frame is too large. */ -int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, - size_t padlen, int framehd_only); +void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, + size_t padlen, int framehd_only); #endif /* NGHTTP2_FRAME_H */ diff --git a/deps/nghttp2/lib/nghttp2_session.c b/deps/nghttp2/lib/nghttp2_session.c index 71858a39e07db7..a45cbeef673108 100644 --- a/deps/nghttp2/lib/nghttp2_session.c +++ b/deps/nghttp2/lib/nghttp2_session.c @@ -937,8 +937,8 @@ static int session_ob_data_push(nghttp2_session *session, return 0; } -static int session_ob_data_remove(nghttp2_session *session, - nghttp2_stream *stream) { +static void session_ob_data_remove(nghttp2_session *session, + nghttp2_stream *stream) { uint32_t urgency; assert(stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES); @@ -951,8 +951,6 @@ static int session_ob_data_remove(nghttp2_session *session, nghttp2_pq_remove(&session->sched[urgency].ob_data, &stream->pq_entry); stream->queued = 0; - - return 0; } static int session_attach_stream_item(nghttp2_session *session, @@ -972,38 +970,28 @@ static int session_attach_stream_item(nghttp2_session *session, return session_ob_data_push(session, stream); } -static int session_detach_stream_item(nghttp2_session *session, - nghttp2_stream *stream) { - int rv; - - rv = nghttp2_stream_detach_item(stream); - if (rv != 0) { - return rv; - } +static void session_detach_stream_item(nghttp2_session *session, + nghttp2_stream *stream) { + nghttp2_stream_detach_item(stream); if (!(stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) || !stream->queued) { - return 0; + return; } - return session_ob_data_remove(session, stream); + session_ob_data_remove(session, stream); } -static int session_defer_stream_item(nghttp2_session *session, - nghttp2_stream *stream, uint8_t flags) { - int rv; - - rv = nghttp2_stream_defer_item(stream, flags); - if (rv != 0) { - return rv; - } +static void session_defer_stream_item(nghttp2_session *session, + nghttp2_stream *stream, uint8_t flags) { + nghttp2_stream_defer_item(stream, flags); if (!(stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) || !stream->queued) { - return 0; + return; } - return session_ob_data_remove(session, stream); + session_ob_data_remove(session, stream); } static int session_resume_deferred_stream_item(nghttp2_session *session, @@ -1476,11 +1464,7 @@ int nghttp2_session_close_stream(nghttp2_session *session, int32_t stream_id, item = stream->item; - rv = session_detach_stream_item(session, stream); - - if (rv != 0) { - return rv; - } + session_detach_stream_item(session, stream); /* If item is queued, it will be deleted when it is popped (nghttp2_session_prep_frame() will fail). If session->aob.item @@ -2221,7 +2205,6 @@ static ssize_t session_call_select_padding(nghttp2_session *session, frame->push_promise has also padlen in the same position. */ static int session_headers_add_pad(nghttp2_session *session, nghttp2_frame *frame) { - int rv; ssize_t padded_payloadlen; nghttp2_active_outbound_item *aob; nghttp2_bufs *framebufs; @@ -2246,11 +2229,7 @@ static int session_headers_add_pad(nghttp2_session *session, DEBUGF("send: padding selected: payloadlen=%zd, padlen=%zu\n", padded_payloadlen, padlen); - rv = nghttp2_frame_add_pad(framebufs, &frame->hd, padlen, 0); - - if (rv != 0) { - return rv; - } + nghttp2_frame_add_pad(framebufs, &frame->hd, padlen, 0); frame->headers.padlen = padlen; @@ -2333,13 +2312,7 @@ static int session_prep_frame(nghttp2_session *session, // Search stream including closed again. stream = nghttp2_session_get_stream_raw(session, frame->hd.stream_id); if (stream) { - int rv2; - - rv2 = session_detach_stream_item(session, stream); - - if (nghttp2_is_fatal(rv2)) { - return rv2; - } + session_detach_stream_item(session, stream); } return rv; @@ -2354,12 +2327,8 @@ static int session_prep_frame(nghttp2_session *session, queue when session->remote_window_size > 0 */ assert(session->remote_window_size > 0); - rv = session_defer_stream_item(session, stream, - NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL); - - if (nghttp2_is_fatal(rv)) { - return rv; - } + session_defer_stream_item(session, stream, + NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL); session->aob.item = NULL; active_outbound_item_reset(&session->aob, mem); @@ -2373,23 +2342,15 @@ static int session_prep_frame(nghttp2_session *session, return rv; } if (rv == NGHTTP2_ERR_DEFERRED) { - rv = session_defer_stream_item(session, stream, - NGHTTP2_STREAM_FLAG_DEFERRED_USER); - - if (nghttp2_is_fatal(rv)) { - return rv; - } + session_defer_stream_item(session, stream, + NGHTTP2_STREAM_FLAG_DEFERRED_USER); session->aob.item = NULL; active_outbound_item_reset(&session->aob, mem); return NGHTTP2_ERR_DEFERRED; } if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) { - rv = session_detach_stream_item(session, stream); - - if (nghttp2_is_fatal(rv)) { - return rv; - } + session_detach_stream_item(session, stream); rv = nghttp2_session_add_rst_stream(session, frame->hd.stream_id, NGHTTP2_INTERNAL_ERROR); @@ -2399,13 +2360,7 @@ static int session_prep_frame(nghttp2_session *session, return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; } if (rv != 0) { - int rv2; - - rv2 = session_detach_stream_item(session, stream); - - if (nghttp2_is_fatal(rv2)) { - return rv2; - } + session_detach_stream_item(session, stream); return rv; } @@ -2907,10 +2862,7 @@ static int session_after_frame_sent1(nghttp2_session *session) { } if (stream && aux_data->eof) { - rv = session_detach_stream_item(session, stream); - if (nghttp2_is_fatal(rv)) { - return rv; - } + session_detach_stream_item(session, stream); /* Call on_frame_send_callback after nghttp2_stream_detach_item(), so that application can issue @@ -3143,17 +3095,8 @@ static int session_after_frame_sent1(nghttp2_session *session) { /* * Called after a frame is sent and session_after_frame_sent1. This * function is responsible to reset session->aob. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * NGHTTP2_ERR_NOMEM - * Out of memory. - * NGHTTP2_ERR_CALLBACK_FAILURE - * The callback function failed. */ -static int session_after_frame_sent2(nghttp2_session *session) { - int rv; +static void session_after_frame_sent2(nghttp2_session *session) { nghttp2_active_outbound_item *aob = &session->aob; nghttp2_outbound_item *item = aob->item; nghttp2_bufs *framebufs = &aob->framebufs; @@ -3176,13 +3119,13 @@ static int session_after_frame_sent2(nghttp2_session *session) { DEBUGF("send: next CONTINUATION frame, %zu bytes\n", nghttp2_buf_len(&framebufs->cur->buf)); - return 0; + return; } } active_outbound_item_reset(&session->aob, mem); - return 0; + return; } /* DATA frame */ @@ -3196,7 +3139,7 @@ static int session_after_frame_sent2(nghttp2_session *session) { if (aux_data->eof) { active_outbound_item_reset(aob, mem); - return 0; + return; } /* Reset no_copy here because next write may not use this. */ @@ -3208,22 +3151,18 @@ static int session_after_frame_sent2(nghttp2_session *session) { further data. */ if (nghttp2_session_predicate_data_send(session, stream) != 0) { if (stream) { - rv = session_detach_stream_item(session, stream); - - if (nghttp2_is_fatal(rv)) { - return rv; - } + session_detach_stream_item(session, stream); } active_outbound_item_reset(aob, mem); - return 0; + return; } aob->item = NULL; active_outbound_item_reset(&session->aob, mem); - return 0; + return; } static int session_call_send_data(nghttp2_session *session, @@ -3454,7 +3393,7 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session, /* Frame has completely sent */ if (fast_cb) { - rv = session_after_frame_sent2(session); + session_after_frame_sent2(session); } else { rv = session_after_frame_sent1(session); if (rv < 0) { @@ -3462,12 +3401,7 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session, assert(nghttp2_is_fatal(rv)); return rv; } - rv = session_after_frame_sent2(session); - } - if (rv < 0) { - /* FATAL */ - assert(nghttp2_is_fatal(rv)); - return rv; + session_after_frame_sent2(session); } /* We have already adjusted the next state */ break; @@ -3506,11 +3440,7 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session, } if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) { - rv = session_detach_stream_item(session, stream); - - if (nghttp2_is_fatal(rv)) { - return rv; - } + session_detach_stream_item(session, stream); rv = nghttp2_session_add_rst_stream(session, frame->hd.stream_id, NGHTTP2_INTERNAL_ERROR); @@ -3534,11 +3464,7 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session, assert(nghttp2_is_fatal(rv)); return rv; } - rv = session_after_frame_sent2(session); - if (rv < 0) { - assert(nghttp2_is_fatal(rv)); - return rv; - } + session_after_frame_sent2(session); /* We have already adjusted the next state */ @@ -4424,17 +4350,12 @@ int nghttp2_session_on_headers_received(nghttp2_session *session, } static int session_process_headers_frame(nghttp2_session *session) { - int rv; nghttp2_inbound_frame *iframe = &session->iframe; nghttp2_frame *frame = &iframe->frame; nghttp2_stream *stream; - rv = nghttp2_frame_unpack_headers_payload(&frame->headers, iframe->sbuf.pos); + nghttp2_frame_unpack_headers_payload(&frame->headers, iframe->sbuf.pos); - if (rv != 0) { - return nghttp2_session_terminate_session_with_reason( - session, NGHTTP2_PROTOCOL_ERROR, "HEADERS: could not unpack"); - } stream = nghttp2_session_get_stream(session, frame->hd.stream_id); if (!stream) { frame->headers.cat = NGHTTP2_HCAT_REQUEST; @@ -5097,17 +5018,11 @@ int nghttp2_session_on_push_promise_received(nghttp2_session *session, } static int session_process_push_promise_frame(nghttp2_session *session) { - int rv; nghttp2_inbound_frame *iframe = &session->iframe; nghttp2_frame *frame = &iframe->frame; - rv = nghttp2_frame_unpack_push_promise_payload(&frame->push_promise, - iframe->sbuf.pos); - - if (rv != 0) { - return nghttp2_session_terminate_session_with_reason( - session, NGHTTP2_PROTOCOL_ERROR, "PUSH_PROMISE: could not unpack"); - } + nghttp2_frame_unpack_push_promise_payload(&frame->push_promise, + iframe->sbuf.pos); return nghttp2_session_on_push_promise_received(session, frame); } @@ -7808,11 +7723,8 @@ int nghttp2_session_pack_data(nghttp2_session *session, nghttp2_bufs *bufs, nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); - rv = nghttp2_frame_add_pad(bufs, &frame->hd, frame->data.padlen, - aux_data->no_copy); - if (rv != 0) { - return rv; - } + nghttp2_frame_add_pad(bufs, &frame->hd, frame->data.padlen, + aux_data->no_copy); session_reschedule_stream(session, stream); diff --git a/deps/nghttp2/lib/nghttp2_stream.c b/deps/nghttp2/lib/nghttp2_stream.c index b3614a0b02761e..f1951f879d7927 100644 --- a/deps/nghttp2/lib/nghttp2_stream.c +++ b/deps/nghttp2/lib/nghttp2_stream.c @@ -465,14 +465,12 @@ static int stream_update_dep_on_attach_item(nghttp2_stream *stream) { return 0; } -static int stream_update_dep_on_detach_item(nghttp2_stream *stream) { +static void stream_update_dep_on_detach_item(nghttp2_stream *stream) { if (nghttp2_pq_empty(&stream->obq)) { stream_obq_remove(stream); } validate_tree(stream); - - return 0; } int nghttp2_stream_attach_item(nghttp2_stream *stream, @@ -503,20 +501,20 @@ int nghttp2_stream_attach_item(nghttp2_stream *stream, return 0; } -int nghttp2_stream_detach_item(nghttp2_stream *stream) { +void nghttp2_stream_detach_item(nghttp2_stream *stream) { DEBUGF("stream: stream=%d detach item=%p\n", stream->stream_id, stream->item); stream->item = NULL; stream->flags = (uint8_t)(stream->flags & ~NGHTTP2_STREAM_FLAG_DEFERRED_ALL); if (stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) { - return 0; + return; } - return stream_update_dep_on_detach_item(stream); + stream_update_dep_on_detach_item(stream); } -int nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags) { +void nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags) { assert(stream->item); DEBUGF("stream: stream=%d defer item=%p cause=%02x\n", stream->stream_id, @@ -525,10 +523,10 @@ int nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags) { stream->flags |= flags; if (stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) { - return 0; + return; } - return stream_update_dep_on_detach_item(stream); + stream_update_dep_on_detach_item(stream); } int nghttp2_stream_resume_deferred_item(nghttp2_stream *stream, uint8_t flags) { diff --git a/deps/nghttp2/lib/nghttp2_stream.h b/deps/nghttp2/lib/nghttp2_stream.h index 7a8e4c6c1ddb08..71b9fb1140c932 100644 --- a/deps/nghttp2/lib/nghttp2_stream.h +++ b/deps/nghttp2/lib/nghttp2_stream.h @@ -258,14 +258,8 @@ void nghttp2_stream_shutdown(nghttp2_stream *stream, nghttp2_shut_flag flag); * more of NGHTTP2_STREAM_FLAG_DEFERRED_USER and * NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL. The |flags| indicates * the reason of this action. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * NGHTTP2_ERR_NOMEM - * Out of memory */ -int nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags); +void nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags); /* * Put back deferred data in this stream to active state. The |flags| @@ -379,14 +373,8 @@ int nghttp2_stream_attach_item(nghttp2_stream *stream, /* * Detaches |stream->item|. This function does not free * |stream->item|. The caller must free it. - * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: - * - * NGHTTP2_ERR_NOMEM - * Out of memory */ -int nghttp2_stream_detach_item(nghttp2_stream *stream); +void nghttp2_stream_detach_item(nghttp2_stream *stream); /* * Makes the |stream| depend on the |dep_stream|. This dependency is