Close everything if xs_socket_accept() returns NULL.

This commit is contained in:
default 2023-02-22 10:02:24 +01:00
parent 3283536cfa
commit 295507fd9e

View File

@ -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;
}
}