summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-28 16:27:53 +0200
committerdefault <nobody@localhost>2022-09-28 16:27:53 +0200
commit7ae3064210123fe19cb036c7b879418e1262ec2f (patch)
tree84455eed7c9e7b4c7b34974924a97f1af4dae681 /httpd.c
parenta22a515e0f45071c892d30373f6a799cef5ccb00 (diff)
Better coping with timeouts.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c6
1 files changed, 6 insertions, 0 deletions
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"));