Call on_frame_recv_callback for DATA even if stream has been closed

This makes the callback semantics consistent with the other
frames like HEADERS/PUSH_PROMISE.
This commit is contained in:
Tatsuhiro Tsujikawa 2014-01-29 21:34:48 +09:00
parent e186e01933
commit bbdc015e84
1 changed files with 7 additions and 4 deletions

View File

@ -3154,6 +3154,13 @@ int nghttp2_session_on_data_received(nghttp2_session *session,
int rv = 0; int rv = 0;
nghttp2_stream *stream; nghttp2_stream *stream;
/* We call on_frame_recv_callback even if stream has been closed
already */
rv = nghttp2_session_call_on_frame_received(session, frame);
if(nghttp2_is_fatal(rv)) {
return rv;
}
stream = nghttp2_session_get_stream(session, frame->hd.stream_id); stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
if(!stream) { if(!stream) {
/* This should be treated as stream error, but it results in lots /* This should be treated as stream error, but it results in lots
@ -3161,10 +3168,6 @@ int nghttp2_session_on_data_received(nghttp2_session *session,
for now. */ for now. */
return 0; return 0;
} }
rv = nghttp2_session_call_on_frame_received(session, frame);
if(nghttp2_is_fatal(rv)) {
return rv;
}
if(!nghttp2_session_is_my_stream_id(session, frame->hd.stream_id)) { if(!nghttp2_session_is_my_stream_id(session, frame->hd.stream_id)) {
if(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) { if(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
rv = nghttp2_session_call_on_request_recv(session, frame->hd.stream_id); rv = nghttp2_session_call_on_request_recv(session, frame->hd.stream_id);