aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/http/http.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2024-07-02 04:34:54 -0700
committerDave Barach <vpp@barachs.net>2024-07-08 16:27:06 +0000
commit75e8e1e948da182dbf4f6b3394f1b7fc44c1403a (patch)
treef35ad5134743fda3ac732bb5f7d3945e5005ac28 /src/plugins/http/http.c
parent6df9f442277603d3ebd3bcf950f7dd0d28fb42f5 (diff)
session: improve enable and disable handling
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c79d16f6a19767d990e8a4683c296219b559ccd
Diffstat (limited to 'src/plugins/http/http.c')
-rw-r--r--src/plugins/http/http.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/http/http.c b/src/plugins/http/http.c
index 22aaaeb59b5..c5e2cc1df7d 100644
--- a/src/plugins/http/http.c
+++ b/src/plugins/http/http.c
@@ -1392,8 +1392,6 @@ http_transport_enable (vlib_main_t *vm, u8 is_en)
return 0;
}
- vec_validate (hm->wrk, vlib_num_workers ());
-
clib_memset (a, 0, sizeof (*a));
clib_memset (options, 0, sizeof (options));
@@ -1415,10 +1413,16 @@ http_transport_enable (vlib_main_t *vm, u8 is_en)
hm->app_index = a->app_index;
vec_free (a->name);
+ if (hm->is_init)
+ return 0;
+
+ vec_validate (hm->wrk, vlib_num_workers ());
+
clib_timebase_init (&hm->timebase, 0 /* GMT */, CLIB_TIMEBASE_DAYLIGHT_NONE,
&vm->clib_time /* share the system clock */);
http_timers_init (vm, http_conn_timeout_cb);
+ hm->is_init = 1;
return 0;
}