diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 00c4e65f..92941d1d 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -2562,8 +2562,8 @@ static int nghttp2_update_remote_initial_window_size_func arg->new_window_size, arg->old_window_size); if(rv != 0) { - return nghttp2_session_add_rst_stream(arg->session, stream->stream_id, - NGHTTP2_FLOW_CONTROL_ERROR); + return nghttp2_session_terminate_session(arg->session, + NGHTTP2_FLOW_CONTROL_ERROR); } /* If window size gets positive, push deferred DATA frame to outbound queue. */ @@ -2619,8 +2619,8 @@ static int nghttp2_update_local_initial_window_size_func arg->new_window_size, arg->old_window_size); if(rv != 0) { - return nghttp2_session_add_rst_stream(arg->session, stream->stream_id, - NGHTTP2_FLOW_CONTROL_ERROR); + return nghttp2_session_terminate_session(arg->session, + NGHTTP2_FLOW_CONTROL_ERROR); } if(!(arg->session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_STREAM_WINDOW_UPDATE)) { diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index eccc314c..0669ee96 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -2791,7 +2791,10 @@ void test_nghttp2_submit_settings_update_local_window_size(void) CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(0 == nghttp2_session_on_settings_received(session, &ack_frame, 0)); - CU_ASSERT(NGHTTP2_STREAM_CLOSING == stream->state); + + item = nghttp2_session_get_next_ob_item(session); + CU_ASSERT(NGHTTP2_GOAWAY == OB_CTRL_TYPE(item)); + CU_ASSERT(NGHTTP2_FLOW_CONTROL_ERROR == OB_CTRL(item)->goaway.error_code); nghttp2_session_del(session); nghttp2_frame_settings_free(&ack_frame.settings);