http: http2_transport_conn_reschedule_callback 06/42906/3
authorMatus Fabian <[email protected]>
Mon, 28 Apr 2025 11:28:40 +0000 (07:28 -0400)
committerFlorin Coras <[email protected]>
Tue, 6 May 2025 06:37:07 +0000 (06:37 +0000)
Type: improvement

Change-Id: I96f9bf3587ccf9ed5b779d2d387785e91e9d303a
Signed-off-by: Matus Fabian <[email protected]>
src/plugins/http/http2/http2.c

index 3c6949c..6c420c5 100644 (file)
@@ -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