diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index b405050d..f03002ef 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -2011,8 +2011,6 @@ int nghttp2_submit_headers(nghttp2_session *session, uint8_t flags, * * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. - * :enum:`NGHTTP2_ERR_STREAM_CLOSED` - * The stream is already closed or does not exist. */ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, int32_t stream_id, @@ -2034,8 +2032,6 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, * Out of memory. * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` * The |pri| is negative. - * :enum:`NGHTTP2_ERR_STREAM_CLOSED` - * The stream is already closed or does not exist. */ int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, int32_t stream_id, int32_t pri); @@ -2213,8 +2209,6 @@ int nghttp2_submit_goaway(nghttp2_session *session, uint8_t flags, * * :enum:`NGHTTP2_ERR_FLOW_CONTROL` * The local window size overflow or gets negative. - * :enum:`NGHTTP2_ERR_STREAM_CLOSED` - * The stream is already closed or does not exist. * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. */ diff --git a/lib/nghttp2_submit.c b/lib/nghttp2_submit.c index f4a20165..ced1a831 100644 --- a/lib/nghttp2_submit.c +++ b/lib/nghttp2_submit.c @@ -140,14 +140,9 @@ int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, { int r; nghttp2_frame *frame; - nghttp2_stream *stream; if(pri < 0) { return NGHTTP2_ERR_INVALID_ARGUMENT; } - stream = nghttp2_session_get_stream(session, stream_id); - if(stream == NULL) { - return NGHTTP2_ERR_STREAM_CLOSED; - } frame = malloc(sizeof(nghttp2_frame)); if(frame == NULL) { return NGHTTP2_ERR_NOMEM; @@ -248,7 +243,7 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, return rv; } } else { - return NGHTTP2_ERR_STREAM_CLOSED; + return 0; } } if(window_size_increment > 0) { @@ -309,9 +304,6 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, nghttp2_data *data_frame; uint8_t nflags = 0; - if(nghttp2_session_get_stream(session, stream_id) == NULL) { - return NGHTTP2_ERR_STREAM_CLOSED; - } data_frame = malloc(sizeof(nghttp2_data)); if(data_frame == NULL) { return NGHTTP2_ERR_NOMEM; diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index 3ccd593e..68b5c032 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -2651,7 +2651,9 @@ void test_nghttp2_submit_window_update(void) stream->local_flow_control = 0; CU_ASSERT(NGHTTP2_ERR_INVALID_ARGUMENT == nghttp2_submit_window_update(session, NGHTTP2_FLAG_NONE, 2, -1)); - CU_ASSERT(NGHTTP2_ERR_STREAM_CLOSED == + /* It is ok if stream is closed or does not exist at the call + time */ + CU_ASSERT(0 == nghttp2_submit_window_update(session, NGHTTP2_FLAG_NONE, 4, 4096)); nghttp2_session_del(session); @@ -3609,10 +3611,6 @@ void test_nghttp2_session_on_ctrl_not_send(void) CU_ASSERT(NGHTTP2_HEADERS == user_data.not_sent_frame_type); CU_ASSERT(NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE == user_data.not_sent_error); - /* Send PRIORITY to stream ID = 1 which does not exist */ - CU_ASSERT(NGHTTP2_ERR_STREAM_CLOSED == - nghttp2_submit_priority(session, NGHTTP2_FLAG_NONE, 1, 0)); - user_data.frame_not_send_cb_called = 0; /* Send GOAWAY */ CU_ASSERT(0 == nghttp2_submit_goaway(session, NGHTTP2_FLAG_NONE,