summaryrefslogtreecommitdiff
path: root/src/tipideed
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-09-21 20:37:13 +0000
committerLaurent Bercot <ska@appnovation.com>2023-09-21 20:37:13 +0000
commitabecd1f9e7a7d1d802be83156ac2f8720f2e977b (patch)
tree475cd246202b5a848cd8b976cf286e8ea9062bfd /src/tipideed
parent5fca55de8de3976be01c15141f3edc667a07d750 (diff)
downloadtipidee-abecd1f9e7a7d1d802be83156ac2f8720f2e977b.tar.xz
Some bugfixes
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tipideed')
-rw-r--r--src/tipideed/tipideed.c13
1 files changed, 10 insertions, 3 deletions
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") ;
{