From abecd1f9e7a7d1d802be83156ac2f8720f2e977b Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 21 Sep 2023 20:37:13 +0000 Subject: Some bugfixes Signed-off-by: Laurent Bercot --- src/tipideed/tipideed.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/tipideed/tipideed.c b/src/tipideed/tipideed.c index 7202bde..13e5d7b 100644 --- a/src/tipideed/tipideed.c +++ b/src/tipideed/tipideed.c @@ -140,6 +140,13 @@ static uint32_t get_uint32 (char const *key) return n ; } +static void inittto (tain *tto, char const *key) +{ + uint32_t ms = get_uint32(key) ; + if (ms) tain_from_millisecs(tto, ms) ; + else *tto = tain_infinite_relative ; +} + static inline unsigned int indexify (tipidee_rql const *rql, char *s, struct stat *st) { unsigned int e = 0 ; @@ -368,9 +375,9 @@ int main (int argc, char const *const *argv, char const *const *envp) } prep_env() ; - tain_from_millisecs(&g.readtto, get_uint32("G:read_timeout")) ; - tain_from_millisecs(&g.writetto, get_uint32("G:write_timeout")) ; - tain_from_millisecs(&g.cgitto, get_uint32("G:cgi_timeout")) ; + inittto(&g.readtto, "G:read_timeout") ; + inittto(&g.writetto, "G:write_timeout") ; + inittto(&g.cgitto, "G:cgi_timeout") ; g.maxrqbody = get_uint32("G:max_request_body_length") ; g.maxcgibody = get_uint32("G:max_cgi_body_length") ; { -- cgit v1.2.3