From c3f27ea45708e0fb1b3660a21c24b50a40bbe7f6 Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Mon, 28 Apr 2025 07:28:40 -0400 Subject: [PATCH] http: http2_transport_conn_reschedule_callback Type: improvement Change-Id: I96f9bf3587ccf9ed5b779d2d387785e91e9d303a Signed-off-by: Matus Fabian --- src/plugins/http/http2/http2.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/plugins/http/http2/http2.c b/src/plugins/http/http2/http2.c index 3c6949c3bc2..6c420c59625 100644 --- a/src/plugins/http/http2/http2.c +++ b/src/plugins/http/http2/http2.c @@ -1599,7 +1599,27 @@ http2_transport_reset_callback (http_conn_t *hc) static void http2_transport_conn_reschedule_callback (http_conn_t *hc) { - /* TODO */ + u32 req_index, stream_id; + http2_req_t *req; + http2_conn_ctx_t *h2c; + + HTTP_DBG (1, "hc [%u]%x", hc->c_thread_index, hc->hc_hc_index); + ASSERT (hc->flags & HTTP_CONN_F_HAS_REQUEST); + + if (!(hc->flags & HTTP_CONN_F_HAS_REQUEST)) + return; + + h2c = http2_conn_ctx_get_w_thread (hc); + hash_foreach ( + stream_id, req_index, h2c->req_by_stream_id, ({ + req = http2_req_get (req_index, hc->c_thread_index); + if (req->stream_state != HTTP2_STREAM_STATE_CLOSED && + transport_connection_is_descheduled (&req->base.connection)) + { + HTTP_DBG (1, "req_index %u", req_index); + transport_connection_reschedule (&req->base.connection); + } + })); } static void -- 2.16.6