summaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps
diff options
context:
space:
mode:
authorMaros Ondrejicka <maros.ondrejicka@pantheon.tech>2022-11-03 13:30:08 +0100
committerFlorin Coras <florin.coras@gmail.com>2022-11-03 16:35:55 +0000
commite69d97438530511a1b71216f1460fe1a8c1450fe (patch)
treec5dbdda92f4c74e194dde75608ff60b62c11102b /src/plugins/hs_apps
parent7a87c71542ae42626e4bc4f5b9a1e98b8a8e400a (diff)
misc: fix failing TestNs/TestHttpTps test in hstf
Type: fix Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech> Change-Id: I03cbd05d6d887d2ce8e7b7d20522e04012c5fe7a
Diffstat (limited to 'src/plugins/hs_apps')
-rw-r--r--src/plugins/hs_apps/http_tps.c7
1 files changed, 6 insertions, 1 deletions
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;
}