mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
connector: Check for POLLHUP on in_fd
POLLHUP needs to be checked on in_fd, which may be a pipe. A pipe in Linux signals EOF through POLLHUP (see: http://www.greenend.org.uk/rjk/tech/poll.html) Without checking POLLHUP, a client could spin up indefinetely doing ssh_event_dopoll. Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
d11869bdb6
commit
25f31760aa
@@ -370,7 +370,7 @@ static int ssh_connector_fd_cb(ssh_poll_handle p,
|
||||
|
||||
if (revents & POLLERR) {
|
||||
ssh_connector_except(connector, fd);
|
||||
} else if((revents & POLLIN) && fd == connector->in_fd) {
|
||||
} else if((revents & (POLLIN|POLLHUP)) && fd == connector->in_fd) {
|
||||
ssh_connector_fd_in_cb(connector);
|
||||
} else if((revents & POLLOUT) && fd == connector->out_fd) {
|
||||
ssh_connector_fd_out_cb(connector);
|
||||
|
||||
Reference in New Issue
Block a user