From 3d00893c37a725da6ead642a8d8852e9f5c13628 Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Mon, 13 May 2024 10:29:11 +0200 Subject: http: notify client when connection failed Type: fix Change-Id: I87054e9667fe990d9a2dc3950bc3ce348460018a Signed-off-by: Matus Fabian --- src/plugins/http/http.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/plugins/http') diff --git a/src/plugins/http/http.c b/src/plugins/http/http.c index 59cb094eabe..797be1b7a16 100644 --- a/src/plugins/http/http.c +++ b/src/plugins/http/http.c @@ -267,17 +267,21 @@ http_ts_connected_callback (u32 http_app_index, u32 ho_hc_index, session_t *ts, app_worker_t *app_wrk; int rv; + ho_hc = http_conn_get_w_thread (ho_hc_index, 0); + ASSERT (ho_hc->state == HTTP_CONN_STATE_CONNECTING); + if (err) { - clib_warning ("ERROR: %d", err); + clib_warning ("half-open hc index %d, error: %U", ho_hc_index, + format_session_error, err); + app_wrk = app_worker_get_if_valid (ho_hc->h_pa_wrk_index); + if (app_wrk) + app_worker_connect_notify (app_wrk, 0, err, ho_hc->h_pa_app_api_ctx); return 0; } new_hc_index = http_conn_alloc_w_thread (ts->thread_index); hc = http_conn_get_w_thread (new_hc_index, ts->thread_index); - ho_hc = http_conn_get_w_thread (ho_hc_index, 0); - - ASSERT (ho_hc->state == HTTP_CONN_STATE_CONNECTING); clib_memcpy_fast (hc, ho_hc, sizeof (*hc)); -- cgit 1.2.3-korg