From 10fb6d0fd6849f6e453e117add73c5933fbe51e6 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 27 Oct 2025 13:11:41 -0400 Subject: [PATCH] http: h2 close transport even when conn has no req Type: fix Change-Id: Iab1759c1a49b61c361ec284d9b7eca96cc2b0b77 Signed-off-by: Florin Coras --- src/plugins/hs_apps/http_connect_proxy_client.c | 3 +++ src/plugins/http/http2/http2.c | 2 ++ src/vnet/tls/tls.c | 33 ++++++++++++++++--------- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/plugins/hs_apps/http_connect_proxy_client.c b/src/plugins/hs_apps/http_connect_proxy_client.c index 759c8ed2117..1b3812e37fb 100644 --- a/src/plugins/hs_apps/http_connect_proxy_client.c +++ b/src/plugins/hs_apps/http_connect_proxy_client.c @@ -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, diff --git a/src/plugins/http/http2/http2.c b/src/plugins/http/http2/http2.c index 6ff90a25203..ae4bd72b713 100644 --- a/src/plugins/http/http2/http2.c +++ b/src/plugins/http/http2/http2.c @@ -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; } diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index 8c5d8174d3f..1fab154433c 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -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; } -- 2.16.6