From 204ff787fa7a45abb604b6c9c0d91ed85385284f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 28 Nov 2014 00:23:46 +0900 Subject: [PATCH] nghttpx: Submit RST_STREAM if HEADERS appears in the middle of a stream --- src/shrpx_http2_upstream.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 9b76032f..416fd4dc 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -461,7 +461,12 @@ int on_frame_recv_callback(nghttp2_session *session, const nghttp2_frame *frame, downstream->end_upload_data(); downstream->set_request_state(Downstream::MSG_COMPLETE); } else { - return NGHTTP2_ERR_CALLBACK_FAILURE; + rv = nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, + frame->hd.stream_id, + NGHTTP2_PROTOCOL_ERROR); + if (rv != 0) { + return NGHTTP2_ERR_CALLBACK_FAILURE; + } } break;