snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 295507fd9ec5a2c54875c67203eb92378ae18ae5
parent 3283536cfab70d96671458a2d6ac2cf8bebc3940
Author: default <nobody@localhost>
Date:   Wed, 22 Feb 2023 10:02:24 +0100

Close everything if xs_socket_accept() returns NULL.

Diffstat:
Mhttpd.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 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; } }