Simplify error handling in nghttp2_session_on_headers_received

return session_inflate_handle_invalid_stream(...) case is for streams
for INITIAL state, but this is rare case.  In general, we'd like to
reduce RST_STREAM transmission, and it is suffice to ignore this frame
for now.
This commit is contained in:
Tatsuhiro Tsujikawa 2015-12-20 23:20:14 +09:00
parent 6c1a76af6e
commit 010726a875
1 changed files with 2 additions and 8 deletions

View File

@ -3593,15 +3593,9 @@ int nghttp2_session_on_headers_received(nghttp2_session *session,
return rv;
}
return 0;
} else if (stream->state == NGHTTP2_STREAM_CLOSING) {
/* This is race condition. NGHTTP2_STREAM_CLOSING indicates
that we queued RST_STREAM but it has not been sent. It will
eventually sent, so we just ignore this frame. */
return NGHTTP2_ERR_IGN_HEADER_BLOCK;
} else {
return session_inflate_handle_invalid_stream(session, frame,
NGHTTP2_ERR_PROTO);
}
return NGHTTP2_ERR_IGN_HEADER_BLOCK;
}
/* If this is remote peer initiated stream, it is OK unless it
has sent END_STREAM frame already. But if stream is in