Use NGHTTP2_PROTOCOL_ERROR when peer exceeds MAX_CONCURRENT_STREAMS limit
Kudos to h2spec to find this details
This commit is contained in:
parent
928b49a916
commit
e2bbc94616
|
@ -3256,7 +3256,7 @@ int nghttp2_session_on_request_headers_received(nghttp2_session *session,
|
||||||
|
|
||||||
if (session_is_incoming_concurrent_streams_max(session)) {
|
if (session_is_incoming_concurrent_streams_max(session)) {
|
||||||
return session_inflate_handle_invalid_connection(
|
return session_inflate_handle_invalid_connection(
|
||||||
session, frame, NGHTTP2_ENHANCE_YOUR_CALM,
|
session, frame, NGHTTP2_PROTOCOL_ERROR,
|
||||||
"request HEADERS: max concurrent streams exceeded");
|
"request HEADERS: max concurrent streams exceeded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3333,7 +3333,7 @@ int nghttp2_session_on_push_response_headers_received(nghttp2_session *session,
|
||||||
|
|
||||||
if (session_is_incoming_concurrent_streams_max(session)) {
|
if (session_is_incoming_concurrent_streams_max(session)) {
|
||||||
return session_inflate_handle_invalid_connection(
|
return session_inflate_handle_invalid_connection(
|
||||||
session, frame, NGHTTP2_ENHANCE_YOUR_CALM,
|
session, frame, NGHTTP2_PROTOCOL_ERROR,
|
||||||
"push response HEADERS: max concurrent streams exceeded");
|
"push response HEADERS: max concurrent streams exceeded");
|
||||||
}
|
}
|
||||||
if (session_is_incoming_concurrent_streams_pending_max(session)) {
|
if (session_is_incoming_concurrent_streams_pending_max(session)) {
|
||||||
|
|
|
@ -1942,7 +1942,7 @@ void test_nghttp2_session_on_push_response_headers_received(void) {
|
||||||
stream));
|
stream));
|
||||||
item = nghttp2_session_get_next_ob_item(session);
|
item = nghttp2_session_get_next_ob_item(session);
|
||||||
CU_ASSERT(NGHTTP2_GOAWAY == item->frame.hd.type);
|
CU_ASSERT(NGHTTP2_GOAWAY == item->frame.hd.type);
|
||||||
CU_ASSERT(NGHTTP2_ENHANCE_YOUR_CALM == item->frame.goaway.error_code);
|
CU_ASSERT(NGHTTP2_PROTOCOL_ERROR == item->frame.goaway.error_code);
|
||||||
CU_ASSERT(1 == session->num_incoming_streams);
|
CU_ASSERT(1 == session->num_incoming_streams);
|
||||||
|
|
||||||
nghttp2_frame_headers_free(&frame.headers, mem);
|
nghttp2_frame_headers_free(&frame.headers, mem);
|
||||||
|
@ -4396,7 +4396,7 @@ void test_nghttp2_session_max_concurrent_streams(void) {
|
||||||
|
|
||||||
item = nghttp2_session_get_ob_pq_top(session);
|
item = nghttp2_session_get_ob_pq_top(session);
|
||||||
CU_ASSERT(NGHTTP2_GOAWAY == item->frame.hd.type);
|
CU_ASSERT(NGHTTP2_GOAWAY == item->frame.hd.type);
|
||||||
CU_ASSERT(NGHTTP2_ENHANCE_YOUR_CALM == item->frame.goaway.error_code);
|
CU_ASSERT(NGHTTP2_PROTOCOL_ERROR == item->frame.goaway.error_code);
|
||||||
|
|
||||||
nghttp2_frame_headers_free(&frame.headers, mem);
|
nghttp2_frame_headers_free(&frame.headers, mem);
|
||||||
nghttp2_session_del(session);
|
nghttp2_session_del(session);
|
||||||
|
|
Loading…
Reference in New Issue