diff options
author | 2024-10-17 13:41:51 +0200 | |
---|---|---|
committer | 2024-10-25 23:33:15 +0000 | |
commit | 841672258a55defb28b1ca6a35b6ad9830c132cf (patch) | |
tree | d9a0fa5366f5c53c8040b03e0904ee2569562b40 /src/plugins/http/http_timer.h | |
parent | dced40dcaca0186d11eccbf5c75e21446db931b9 (diff) |
http: pass timeout using extended config
App can now pass http connection timeout using extended configuration,
ext cfg type TRANSPORT_ENDPT_EXT_CFG_HTTP, value (in seconds) set in ext
cfg member opaque.
It is optional, default value is 60 seconds.
Type: improvement
Change-Id: Ibeff4bbd3153421be350ff564ec3c8e52e5b9639
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/http/http_timer.h')
-rw-r--r-- | src/plugins/http/http_timer.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/http/http_timer.h b/src/plugins/http/http_timer.h index 06baa1f8557..43d20d004d8 100644 --- a/src/plugins/http/http_timer.h +++ b/src/plugins/http/http_timer.h @@ -43,15 +43,13 @@ http_conn_timer_start (http_conn_t *hc) { http_tw_ctx_t *twc = &http_tw_ctx; u32 hs_handle; - u64 timeout; ASSERT (hc->timer_handle == HTTP_TIMER_HANDLE_INVALID); - timeout = HTTP_CONN_TIMEOUT; hs_handle = hc->c_thread_index << 24 | hc->c_c_index; clib_spinlock_lock (&twc->tw_lock); hc->timer_handle = - tw_timer_start_2t_1w_2048sl (&twc->tw, hs_handle, 0, timeout); + tw_timer_start_2t_1w_2048sl (&twc->tw, hs_handle, 0, hc->timeout); clib_spinlock_unlock (&twc->tw_lock); } @@ -74,19 +72,16 @@ static inline void http_conn_timer_update (http_conn_t *hc) { http_tw_ctx_t *twc = &http_tw_ctx; - u64 timeout; u32 hs_handle; - timeout = HTTP_CONN_TIMEOUT; - clib_spinlock_lock (&twc->tw_lock); if (hc->timer_handle != HTTP_TIMER_HANDLE_INVALID) - tw_timer_update_2t_1w_2048sl (&twc->tw, hc->timer_handle, timeout); + tw_timer_update_2t_1w_2048sl (&twc->tw, hc->timer_handle, hc->timeout); else { hs_handle = hc->c_thread_index << 24 | hc->c_c_index; hc->timer_handle = - tw_timer_start_2t_1w_2048sl (&twc->tw, hs_handle, 0, timeout); + tw_timer_start_2t_1w_2048sl (&twc->tw, hs_handle, 0, hc->timeout); } clib_spinlock_unlock (&twc->tw_lock); } |