mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
socket: don't attempt reading a non-connected socket
This commit is contained in:
@@ -245,7 +245,7 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd, int r
|
|||||||
/* force a read to get an explanation */
|
/* force a read to get an explanation */
|
||||||
revents |= POLLIN;
|
revents |= POLLIN;
|
||||||
}
|
}
|
||||||
if(revents & POLLIN){
|
if((revents & POLLIN) && s->state == SSH_SOCKET_CONNECTED){
|
||||||
s->read_wontblock=1;
|
s->read_wontblock=1;
|
||||||
r=ssh_socket_unbuffered_read(s,buffer,sizeof(buffer));
|
r=ssh_socket_unbuffered_read(s,buffer,sizeof(buffer));
|
||||||
if(r<0){
|
if(r<0){
|
||||||
|
|||||||
Reference in New Issue
Block a user