From 93a1414e29a6ef8b8f70276c458fe318a01170bd Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 25 Feb 2015 15:53:29 +1100 Subject: [PATCH] Explicitly check for HUP in proxy_recv, avoiding an attempt at reading a line --- src/generator.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generator.c b/src/generator.c index 0cec54b0..1a13a423 100644 --- a/src/generator.c +++ b/src/generator.c @@ -1978,7 +1978,10 @@ static void *proxy_recv(void *arg) if (likely(ret > 0)) { subproxy = event.data.ptr; cs = subproxy->cs; - ret = read_socket_line(cs, 5); + if (event.events & EPOLLHUP) + ret = -1; + else + ret = read_socket_line(cs, 5); } if (ret < 1) { LOGNOTICE("Proxy %ld:%d %s failed to epoll/read_socket_line in proxy_recv",