http: format_http_transport_half_open fix 99/43499/1
authorMatus Fabian <[email protected]>
Wed, 30 Jul 2025 13:23:40 +0000 (09:23 -0400)
committerMatus Fabian <[email protected]>
Wed, 30 Jul 2025 13:23:40 +0000 (09:23 -0400)
with postponed ho clenup underlying transport ho session might not
exist anymore

Type: fix

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

index b387b61..094260f 100644 (file)
@@ -1375,11 +1375,18 @@ format_http_transport_half_open (u8 *s, va_list *args)
   session_t *tcp_ho;
 
   ho_hc = http_ho_conn_get (ho_index);
-  tcp_ho = session_get_from_handle (ho_hc->hc_tc_session_handle);
+  tcp_ho = session_get_from_handle_if_valid (ho_hc->hc_tc_session_handle);
 
-  s = format (s, "[%d:%d][H] half-open app_wrk %u ts %d:%d",
+  if (tcp_ho)
+    s =
+      format (s, "[%d:%d][H] half-open app_wrk %u ts %d:%d",
              ho_hc->c_thread_index, ho_hc->c_s_index, ho_hc->hc_pa_wrk_index,
              tcp_ho->thread_index, tcp_ho->session_index);
+  else
+    s =
+      format (s, "[%d:%d][H] half-open app_wrk %u (postponed cleanup)",
+             ho_hc->c_thread_index, ho_hc->c_s_index, ho_hc->hc_pa_wrk_index);
+
   return s;
 }