summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-22 16:52:58 -0500
committerJune McEnroe <june@causal.agency>2019-12-22 16:52:58 -0500
commit407b8acb5a324c01fc5c2bd62573393d117fa78e (patch)
treee89dff9b37ae9c7c8d4618f889feb399637dc822
parentExit when server gets POLLHUP (diff)
downloadpounce-407b8acb5a324c01fc5c2bd62573393d117fa78e.tar.gz
pounce-407b8acb5a324c01fc5c2bd62573393d117fa78e.zip
Revert "Exit when server gets POLLHUP"
Turns out the more likely thing is that the fd will just continue to be
POLLIN and produce zero-length reads.

This reverts commit 5707b15920a1ce57f01db0d592487d833218be9d.
-rw-r--r--bounce.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/bounce.c b/bounce.c
index 8dc2850..2b1413d 100644
--- a/bounce.c
+++ b/bounce.c
@@ -413,10 +413,7 @@ int main(int argc, char *argv[]) {
 			if (!revents) continue;
 
 			if (event.fds[i].fd == server) {
-				if (revents & POLLIN) serverRecv();
-				if (revents & (POLLHUP | POLLERR)) {
-					errx(EX_UNAVAILABLE, "server closed connection");
-				}
+				serverRecv();
 				continue;
 			}