http: h2 close transport even when conn has no req 48/43948/4
authorFlorin Coras <[email protected]>
Mon, 27 Oct 2025 17:11:41 +0000 (13:11 -0400)
committerFlorin Coras <[email protected]>
Mon, 27 Oct 2025 17:15:25 +0000 (17:15 +0000)
Type: fix

Change-Id: Iab1759c1a49b61c361ec284d9b7eca96cc2b0b77
Signed-off-by: Florin Coras <[email protected]>
src/plugins/hs_apps/http_connect_proxy_client.c
src/plugins/http/http2/http2.c
src/vnet/tls/tls.c

index 759c8ed..1b3812e 100644 (file)
@@ -969,6 +969,9 @@ hcpc_connect_http_connection ()
   transport_endpt_ext_cfg_t *ext_cfg;
   transport_endpt_cfg_http_t http_cfg = { 120, HTTP_UDP_TUNNEL_DGRAM, 0 };
 
+  if (hcpcm->http_state >= HCPC_HTTP_STATE_CONNECTING)
+    return;
+
   vec_validate (a, 0);
   clib_memset (a, 0, sizeof (a[0]));
   clib_memcpy (&a->sep_ext, &hcpcm->proxy_server_sep,
index 6ff90a2..ae4bd72 100644 (file)
@@ -3185,6 +3185,8 @@ http2_transport_close_callback (http_conn_t *hc)
 
   if (!(hc->flags & HTTP_CONN_F_HAS_REQUEST))
     {
+      ASSERT (hc->flags & HTTP_CONN_F_NO_APP_SESSION);
+      http_disconnect_transport (hc);
       HTTP_DBG (1, "no request");
       return;
     }
index 8c5d817..1fab154 100644 (file)
@@ -1043,27 +1043,36 @@ format_tls_listener (u8 * s, va_list * args)
   return s;
 }
 
+static u8 *
+format_tls_ho_conn_id (u8 *s, va_list *args)
+{
+  tls_ctx_t *ho_ctx = va_arg (*args, tls_ctx_t *);
+
+  s = format (s, "[%d:%d][%s] half-open app_wrk %u engine %u ts %d:%d",
+             ho_ctx->c_thread_index, ho_ctx->c_s_index, "TLS",
+             ho_ctx->parent_app_wrk_index, ho_ctx->tls_ctx_engine,
+             session_thread_from_handle (ho_ctx->tls_session_handle),
+             session_index_from_handle (ho_ctx->tls_session_handle));
+  return s;
+}
+
 u8 *
-format_tls_half_open (u8 * s, va_list * args)
+format_tls_half_open (u8 *s, va_list *args)
 {
   u32 ho_index = va_arg (*args, u32);
   u32 __clib_unused thread_index = va_arg (*args, u32);
-  u32 __clib_unused verbose = va_arg (*args, u32);
+  u32 verbose = va_arg (*args, u32);
   tls_ctx_t *ho_ctx;
 
   ho_ctx = tls_ctx_half_open_get (ho_index);
 
-  s = format (s, "[%d:%d][%s] half-open app_wrk %u engine %u ts %d:%d",
-             ho_ctx->c_thread_index, ho_ctx->c_s_index, "TLS",
-             ho_ctx->parent_app_wrk_index, ho_ctx->tls_ctx_engine,
-             session_thread_from_handle (ho_ctx->tls_session_handle),
-             session_index_from_handle (ho_ctx->tls_session_handle));
+  s = format (s, "%-" SESSION_CLI_ID_LEN "U", format_tls_ho_conn_id, ho_ctx);
   if (verbose)
-    s = format (
-      s, "%-" SESSION_CLI_STATE_LEN "s",
-      (ho_ctx->tls_session_handle == SESSION_INVALID_HANDLE) ?
-       ((ho_ctx->flags & TLS_CONN_F_HO_DONE) ? "CLOSED" : "CLOSED-PNDG") :
-       "CONNECTING");
+    s = format (s, "%-" SESSION_CLI_STATE_LEN "s",
+               (ho_ctx->tls_session_handle == SESSION_INVALID_HANDLE) ?
+                 (ho_ctx->flags & TLS_CONN_F_HO_DONE) ? "CLOSED" :
+                                                        "CLOSED-PNDG" :
+                 "CONNECTING");
 
   return s;
 }