From ed4ea51bb81d250e711b7450dd27b92df915f30e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 7 May 2018 20:36:56 +0200 Subject: [PATCH] connector: Add missing check for POLLHUP to detect EOF Thanks to Chris Townsend. Fixes T81 Signed-off-by: Andreas Schneider --- src/connector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/connector.c b/src/connector.c index ac29635e..407aa522 100644 --- a/src/connector.c +++ b/src/connector.c @@ -372,7 +372,8 @@ static int ssh_connector_fd_cb(ssh_poll_handle p, ssh_connector_except(connector, fd); } else if((revents & (POLLIN|POLLHUP)) && fd == connector->in_fd) { ssh_connector_fd_in_cb(connector); - } else if((revents & POLLOUT) && fd == connector->out_fd) { + } else if(((revents & POLLOUT) || (revents & POLLHUP)) && + fd == connector->out_fd) { ssh_connector_fd_out_cb(connector); } ssh_connector_reset_pollevents(connector);