Commit 010726a8 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

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.
parent 6c1a76af
...@@ -3593,15 +3593,9 @@ int nghttp2_session_on_headers_received(nghttp2_session *session, ...@@ -3593,15 +3593,9 @@ int nghttp2_session_on_headers_received(nghttp2_session *session,
return rv; return rv;
} }
return 0; 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 /* If this is remote peer initiated stream, it is OK unless it
has sent END_STREAM frame already. But if stream is in has sent END_STREAM frame already. But if stream is in
......
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