1
0
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:
Aris Adamantiadis
2014-01-05 21:54:08 +01:00
parent d9c5d0767c
commit b514957af7

View File

@@ -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 */
revents |= POLLIN;
}
if(revents & POLLIN){
if((revents & POLLIN) && s->state == SSH_SOCKET_CONNECTED){
s->read_wontblock=1;
r=ssh_socket_unbuffered_read(s,buffer,sizeof(buffer));
if(r<0){