commit 295507f
default
·
2023-02-22 09:02:24 +0000 UTC
parent 3283536
Close everything if xs_socket_accept() returns NULL.
1 files changed,
+6,
-3
M
httpd.c
M
httpd.c
+6,
-3
1@@ -478,9 +478,12 @@ void httpd(void)
2 for (;;) {
3 FILE *f = xs_socket_accept(rs);
4
5- xs *job = xs_data_new(&f, sizeof(FILE *));
6-
7- job_post(job);
8+ if (f != NULL) {
9+ xs *job = xs_data_new(&f, sizeof(FILE *));
10+ job_post(job);
11+ }
12+ else
13+ break;
14 }
15 }
16