diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 0031789b..31492f86 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -2239,11 +2239,13 @@ int nghttp2_priority_spec_check_default(const nghttp2_priority_spec *pri_spec); * * .. warning:: * - * This function returns assigned stream ID if it succeeds. But - * that stream is not opened yet. The application must not submit - * frame to that stream ID before + * This function returns assigned stream ID if it succeeds and + * |stream_id| is -1. But that stream is not opened yet. The + * application must not submit WINDOW_UPDATE frame using + * `nghttp2_submit_window_update()` to that stream ID before * :member:`nghttp2_session_callbacks.before_frame_send_callback` is - * called for this frame. + * called for this frame. Other types of frames can be submitted to + * the returned stream ID. * */ int32_t nghttp2_submit_request(nghttp2_session *session, @@ -2367,9 +2369,11 @@ int nghttp2_submit_response(nghttp2_session *session, * * This function returns assigned stream ID if it succeeds and * |stream_id| is -1. But that stream is not opened yet. The - * application must not submit frame to that stream ID before + * application must not submit WINDOW_UPDATE frame using + * `nghttp2_submit_window_update()` to that stream ID before * :member:`nghttp2_session_callbacks.before_frame_send_callback` is - * called for this frame. + * called for this frame. Other types of frames can be submitted to + * the returned stream ID. * */ int32_t nghttp2_submit_headers(nghttp2_session *session, uint8_t flags, @@ -2538,14 +2542,6 @@ int nghttp2_submit_settings(nghttp2_session *session, uint8_t flags, * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * - * .. warning:: - * - * This function returns assigned promised stream ID if it succeeds. - * But that stream is not opened yet. The application must not - * submit frame to that stream ID before - * :member:`nghttp2_session_callbacks.before_frame_send_callback` is - * called for this frame. - * */ int32_t nghttp2_submit_push_promise(nghttp2_session *session, uint8_t flags, int32_t stream_id, diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 71f64c82..21a8b55e 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -634,11 +634,6 @@ int nghttp2_session_add_frame(nghttp2_session *session, stream = nghttp2_session_get_stream(session, frame->hd.stream_id); switch(frame->hd.type) { - case NGHTTP2_HEADERS: - case NGHTTP2_PUSH_PROMISE: - item->weight = NGHTTP2_MAX_WEIGHT; - - break; case NGHTTP2_RST_STREAM: if(stream) { /* We rely on the stream state to decide whether number of diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index 567cd2ee..0e3b13bc 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -4666,25 +4666,12 @@ void test_nghttp2_session_on_ctrl_not_send(void) CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(1 == user_data.frame_not_send_cb_called); CU_ASSERT(NGHTTP2_HEADERS == user_data.not_sent_frame_type); - CU_ASSERT(NGHTTP2_ERR_STREAM_CLOSED == user_data.not_sent_error); + CU_ASSERT(NGHTTP2_ERR_STREAM_CLOSING == user_data.not_sent_error); stream = nghttp2_session_open_stream(session, 3, NGHTTP2_STREAM_FLAG_NONE, &pri_spec_default, NGHTTP2_STREAM_OPENED, &user_data); - /* Check HEADERS */ - user_data.frame_not_send_cb_called = 0; - /* Queue RST_STREAM */ - CU_ASSERT(0 == - nghttp2_submit_headers(session, NGHTTP2_FLAG_END_STREAM, 3, - NULL, NULL, 0, NULL)); - CU_ASSERT(0 == nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, 3, - NGHTTP2_INTERNAL_ERROR)); - CU_ASSERT(0 == nghttp2_session_send(session)); - CU_ASSERT(1 == user_data.frame_not_send_cb_called); - CU_ASSERT(NGHTTP2_HEADERS == user_data.not_sent_frame_type); - CU_ASSERT(NGHTTP2_ERR_STREAM_CLOSED == user_data.not_sent_error); - nghttp2_session_del(session); /* Check request HEADERS */