- User Since
- Nov 9 2018, 10:26 PM (4 w, 4 d)
Hi Andreas, the issue still persists. Looking at this commit: https://git.libssh.org/users/asn/libssh.git/commit/?h=master-poll&id=917ced39e0c8aaae4d2c22bcdbcb767f6355e62d
Wed, Dec 5
The remaining issue is that the only time bsd_socket_compute_revents is called is when FD_ISSET(fds[i].fd, &readfds) returns true. However, with some instances of the application, FD_ISSET(fds[i].fd, &readfds) will consistently return false, resulting in the infinite loop since bsd_socket_compute_revents doesn't get called.
It's not clear to me why FD_ISSET() is needed. WSAGetLastError() does correctly return WSAECONNRESET.
Thu, Nov 29
I think we are getting closer to fixing this issue. The timeout is correctly being propagated to the winsock select() function. WSAGetLastError() is returning WSAECONNRESET.
Wed, Nov 28
Tue, Nov 27
It looks like bsd_socket_disconnected() isn't even getting called.
Mon, Nov 26
I pulled the latest master-poll and am no longer seeing a seg fault. However, I'm seeing the same infinite poll issue as before. It happens maybe 75% of the time.
Wed, Nov 21
Thanks again for working with me on this issue.
Tue, Nov 20
Thank you for your feedback Andreas. I have attached the updated patch.
Thanks for spending time on this Andreas.
Before the fix: On Windows, during a successful download, ssh_poll() returns > 0. When there is a disconnect that occurs in the middle of the download, ssh_poll() returns 0.
Thanks Andreas. I have attached an updated patch for the sftp.c file using sftp->session->opts.timeout instead of SSH_OPTIONS_TIMEOUT:
Mon, Nov 19
See https://bugs.libssh.org/T47 for two patches that address part of this problem.
This is still occurring as of release 0.8.4. This issue is related: https://bugs.libssh.org/T33
Tue, Nov 13
I am seeing this issue with sftp_read(). The sftp_read() function call was getting hung when there was a disconnect. I traced it to ssh_channel_read() which isn't using the user defined timeout.
I have tested with 0.8.4. It looks like SSH_TIMEOUT_DEFAULT is always -1 even if I set SSH_OPTIONS_TIMEOUT.
Nov 9 2018
This is related to this issue discussed here: https://www.libssh.org/archive/libssh/2016-02/0000010.html