mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
connector: Add missing check for POLLHUP to detect EOF
Thanks to Chris Townsend. Fixes T81 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -372,7 +372,8 @@ static int ssh_connector_fd_cb(ssh_poll_handle p,
|
|||||||
ssh_connector_except(connector, fd);
|
ssh_connector_except(connector, fd);
|
||||||
} else if((revents & (POLLIN|POLLHUP)) && fd == connector->in_fd) {
|
} else if((revents & (POLLIN|POLLHUP)) && fd == connector->in_fd) {
|
||||||
ssh_connector_fd_in_cb(connector);
|
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_fd_out_cb(connector);
|
||||||
}
|
}
|
||||||
ssh_connector_reset_pollevents(connector);
|
ssh_connector_reset_pollevents(connector);
|
||||||
|
|||||||
Reference in New Issue
Block a user