From e69d97438530511a1b71216f1460fe1a8c1450fe Mon Sep 17 00:00:00 2001 From: Maros Ondrejicka Date: Thu, 3 Nov 2022 13:30:08 +0100 Subject: misc: fix failing TestNs/TestHttpTps test in hstf Type: fix Signed-off-by: Maros Ondrejicka Change-Id: I03cbd05d6d887d2ce8e7b7d20522e04012c5fe7a --- src/plugins/hs_apps/http_tps.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/plugins/hs_apps') diff --git a/src/plugins/hs_apps/http_tps.c b/src/plugins/hs_apps/http_tps.c index 59c18abc04d..920f7ea731f 100644 --- a/src/plugins/hs_apps/http_tps.c +++ b/src/plugins/hs_apps/http_tps.c @@ -507,6 +507,7 @@ hts_start_listen (hts_main_t *htm, session_endpoint_cfg_t *sep, u8 *uri, u8 need_crypto; hts_session_t *hls; session_t *ls; + u32 thread_index = 0; int rv; clib_memset (a, 0, sizeof (*a)); @@ -532,13 +533,17 @@ hts_start_listen (hts_main_t *htm, session_endpoint_cfg_t *sep, u8 *uri, if (rv) return rv; - hls = hts_session_alloc (0); + hls = hts_session_alloc (thread_index); hls->uri = vec_dup (uri); hls->close_rate = (f64) 1 / rnd_close; ls = listen_session_get_from_handle (a->handle); hls->vpp_session_index = ls->session_index; hash_set_mem (htm->uri_to_handle, hls->uri, hls->session_index); + /* opaque holds index of hls, which is used in `hts_ts_accept_callback` + * to get back the pointer to hls */ + ls->opaque = hls - htm->sessions[thread_index]; + return 0; } -- cgit 1.2.3-korg