From 428e57352527e33b141e976b45e290ac65fd68fc Mon Sep 17 00:00:00 2001 From: default Date: Thu, 20 Jun 2024 17:38:02 +0200 Subject: Minor tweak. --- httpd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 104edcf..7aae6ca 100644 --- a/httpd.c +++ b/httpd.c @@ -847,9 +847,10 @@ void httpd(void) if (setjmp(on_break) == 0) { for (;;) { - FILE *f = xs_socket_accept(rs); + int cs = xs_socket_accept(rs); - if (f != NULL) { + if (cs != -1) { + FILE *f = fdopen(cs, "r+"); xs *job = xs_data_new(&f, sizeof(FILE *)); job_post(job, 1); } -- cgit v1.2.3