sftp_opendir blocks forever on abnormal disconnection
When calling
auto dir = sftp_opendir(m_sftp_session, remote_root.c_str());
if remote host disconnects abnormally, method never returns. This occurs because ssh_handle_packets_termination
never returns SSH_ERROR
.
I've changed session.c
line 799 from:
ret = fct(user) ? SSH_OK : SSH_AGAIN;
to
ret = fct(user) ? SSH_OK : SSH_ERROR;
Now seems to work fine. Are there any contraindications in making this change?