diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-05-07 20:36:56 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-05-07 20:36:56 +0200 |
commit | ed4ea51bb81d250e711b7450dd27b92df915f30e (patch) | |
tree | 6df3c7b2396bb6a8119b5ca1474760cdff0c2897 /src/connector.c | |
parent | 22a92da30dd11356153959e56bc3680dbea5fd80 (diff) | |
download | libssh-ed4ea51bb81d250e711b7450dd27b92df915f30e.tar.gz libssh-ed4ea51bb81d250e711b7450dd27b92df915f30e.tar.xz libssh-ed4ea51bb81d250e711b7450dd27b92df915f30e.zip |
connector: Add missing check for POLLHUP to detect EOF
Thanks to Chris Townsend.
Fixes T81
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/connector.c')
-rw-r--r-- | src/connector.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |