Use NGHTTP2_PROTOCOL_ERROR when peer exceeds MAX_CONCURRENT_STREAMS limit

Kudos to h2spec to find this details
This commit is contained in:
Tatsuhiro Tsujikawa 2015-02-02 00:14:17 +09:00
parent 928b49a916
commit e2bbc94616
2 changed files with 4 additions and 4 deletions

View File

@ -3256,7 +3256,7 @@ int nghttp2_session_on_request_headers_received(nghttp2_session *session,
if (session_is_incoming_concurrent_streams_max(session)) {
return session_inflate_handle_invalid_connection(
session, frame, NGHTTP2_ENHANCE_YOUR_CALM,
session, frame, NGHTTP2_PROTOCOL_ERROR,
"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)) {
return session_inflate_handle_invalid_connection(
session, frame, NGHTTP2_ENHANCE_YOUR_CALM,
session, frame, NGHTTP2_PROTOCOL_ERROR,
"push response HEADERS: max concurrent streams exceeded");
}
if (session_is_incoming_concurrent_streams_pending_max(session)) {

View File

@ -1942,7 +1942,7 @@ void test_nghttp2_session_on_push_response_headers_received(void) {
stream));
item = nghttp2_session_get_next_ob_item(session);
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);
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);
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_session_del(session);