Skip to content

Commit 87b8827

Browse files
matfabia-ciscoflorincoras
authored andcommitted
http: http2_app_reset_callback fix
do not send RST_STREAM for idle streams, this might happen if client app open stream session and reset it before send request or it was otherwise unused parent session Type: fix Change-Id: I35d146c8fd4b0383d5962aad0714f472a29e7095 Signed-off-by: Matus Fabian <matfabia@cisco.com>
1 parent fcaa912 commit 87b8827

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/plugins/http/http2/http2.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,10 +2988,12 @@ http2_app_reset_callback (http_ctx_t *hc, u32 req_index, clib_thread_index_t thr
29882988
req = http_ctx_get_w_thread (req_index, thread_index);
29892989
req->req_flags |= HTTP_REQ_F_APP_CLOSED;
29902990
http_stats_stream_reset_by_app_inc (thread_index);
2991-
http2_send_stream_error (hc, req->stream_id,
2992-
(req->req_flags & HTTP_REQ_F_IS_TUNNEL) ? HTTP2_ERROR_CONNECT_ERROR :
2993-
HTTP2_ERROR_INTERNAL_ERROR,
2994-
0);
2991+
/* in case client app just open stream and don't send request yet */
2992+
if (req->stream_state > HTTP2_STREAM_STATE_IDLE)
2993+
http2_send_stream_error (hc, req->stream_id,
2994+
(req->req_flags & HTTP_REQ_F_IS_TUNNEL) ? HTTP2_ERROR_CONNECT_ERROR :
2995+
HTTP2_ERROR_INTERNAL_ERROR,
2996+
0);
29952997
session_transport_delete_notify (&req->connection);
29962998
if (req->req_flags & HTTP_REQ_F_IS_PARENT)
29972999
{

0 commit comments

Comments
 (0)