From 7ae3064210123fe19cb036c7b879418e1262ec2f Mon Sep 17 00:00:00 2001 From: default Date: Wed, 28 Sep 2022 16:27:53 +0200 Subject: Better coping with timeouts. --- httpd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 3ff13c6..c6959e6 100644 --- a/httpd.c +++ b/httpd.c @@ -106,6 +106,12 @@ void httpd_connection(int rs) req = xs_httpd_request(f, &payload, &p_size); + if (req == NULL) { + /* probably because a timeout */ + fclose(f); + return; + } + method = xs_dict_get(req, "method"); q_path = xs_dup(xs_dict_get(req, "path")); -- cgit v1.2.3