summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c5
1 files changed, 3 insertions, 2 deletions
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);
}