diff options
author | Leah Neukirchen <leah@vuxu.org> | 2021-06-03 20:13:59 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2021-06-03 20:14:18 +0200 |
commit | cdb096d59660c19d00f7326fd5afd31d8e1727d7 (patch) | |
tree | efffe1f329c3eede4b1f8d8d4139cdd17c1679ab | |
parent | e794faae4318fc1d27743e225525e6bf0289edd1 (diff) | |
download | hittpd-cdb096d59660c19d00f7326fd5afd31d8e1727d7.tar.gz hittpd-cdb096d59660c19d00f7326fd5afd31d8e1727d7.tar.xz hittpd-cdb096d59660c19d00f7326fd5afd31d8e1727d7.zip |
more robustness
-rw-r--r-- | hittpd.c | 3 |
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; |