diff options
author | default <nobody@localhost> | 2023-02-22 10:02:24 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-02-22 10:02:24 +0100 |
commit | 295507fd9ec5a2c54875c67203eb92378ae18ae5 (patch) | |
tree | 16dee966cbfc13addb41865d0bc1d95ab630cb62 /httpd.c | |
parent | 3283536cfab70d96671458a2d6ac2cf8bebc3940 (diff) |
Close everything if xs_socket_accept() returns NULL.
Diffstat (limited to 'httpd.c')
-rw-r--r-- | httpd.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; } } |