summary refs log tree commit diff
path: root/hittpd.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-06-03 20:13:59 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-06-03 20:14:18 +0200
commitcdb096d59660c19d00f7326fd5afd31d8e1727d7 (patch)
treeefffe1f329c3eede4b1f8d8d4139cdd17c1679ab /hittpd.c
parente794faae4318fc1d27743e225525e6bf0289edd1 (diff)
downloadhittpd-cdb096d59660c19d00f7326fd5afd31d8e1727d7.tar.gz
hittpd-cdb096d59660c19d00f7326fd5afd31d8e1727d7.tar.xz
hittpd-cdb096d59660c19d00f7326fd5afd31d8e1727d7.zip
more robustness
Diffstat (limited to 'hittpd.c')
-rw-r--r--hittpd.c3
1 files changed, 2 insertions, 1 deletions
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;