Commit 7ab42062 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Tear down connection if SETTINGS makes window size overflow

parent e74fbdf6
...@@ -2562,7 +2562,7 @@ static int nghttp2_update_remote_initial_window_size_func ...@@ -2562,7 +2562,7 @@ static int nghttp2_update_remote_initial_window_size_func
arg->new_window_size, arg->new_window_size,
arg->old_window_size); arg->old_window_size);
if(rv != 0) { if(rv != 0) {
return nghttp2_session_add_rst_stream(arg->session, stream->stream_id, return nghttp2_session_terminate_session(arg->session,
NGHTTP2_FLOW_CONTROL_ERROR); NGHTTP2_FLOW_CONTROL_ERROR);
} }
/* If window size gets positive, push deferred DATA frame to /* If window size gets positive, push deferred DATA frame to
...@@ -2619,7 +2619,7 @@ static int nghttp2_update_local_initial_window_size_func ...@@ -2619,7 +2619,7 @@ static int nghttp2_update_local_initial_window_size_func
arg->new_window_size, arg->new_window_size,
arg->old_window_size); arg->old_window_size);
if(rv != 0) { if(rv != 0) {
return nghttp2_session_add_rst_stream(arg->session, stream->stream_id, return nghttp2_session_terminate_session(arg->session,
NGHTTP2_FLOW_CONTROL_ERROR); NGHTTP2_FLOW_CONTROL_ERROR);
} }
if(!(arg->session->opt_flags & if(!(arg->session->opt_flags &
......
...@@ -2791,7 +2791,10 @@ void test_nghttp2_submit_settings_update_local_window_size(void) ...@@ -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_send(session));
CU_ASSERT(0 == nghttp2_session_on_settings_received(session, &ack_frame, 0)); 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_session_del(session);
nghttp2_frame_settings_free(&ack_frame.settings); nghttp2_frame_settings_free(&ack_frame.settings);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment