From cdb096d59660c19d00f7326fd5afd31d8e1727d7 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 3 Jun 2021 20:13:59 +0200 Subject: more robustness --- hittpd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hittpd.c') diff --git a/hittpd.c b/hittpd.c index 26f628c..2404e47 100644 --- a/hittpd.c +++ b/hittpd.c @@ -767,6 +767,7 @@ close_connection(int i) free(datas[i].host); datas[i] = (struct conn_data){ 0 }; + datas[i].stream_fd = -1; } void @@ -1144,7 +1145,7 @@ main(int argc, char *argv[]) if (--nready <= 0) break; /* no more readable descriptors */ } - else if (client[i].revents & (POLLRDNORM | POLLERR)) { + else if (client[i].revents & (POLLRDNORM | POLLHUP | POLLERR)) { read_client(i); datas[i].deadline = now + TIMEOUT; -- cgit 1.4.1