From 295507fd9ec5a2c54875c67203eb92378ae18ae5 Mon Sep 17 00:00:00 2001 From: default Date: Wed, 22 Feb 2023 10:02:24 +0100 Subject: Close everything if xs_socket_accept() returns NULL. --- httpd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 63a9b94..a617600 100644 --- a/httpd.c +++ b/httpd.c @@ -478,9 +478,12 @@ void httpd(void) for (;;) { FILE *f = xs_socket_accept(rs); - xs *job = xs_data_new(&f, sizeof(FILE *)); - - job_post(job); + if (f != NULL) { + xs *job = xs_data_new(&f, sizeof(FILE *)); + job_post(job); + } + else + break; } } -- cgit v1.2.3