(sftpfs_open_connection): handle EAGAIN for libssh2_session_handshake().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-07-10 16:46:02 +03:00
parent b0450a1e18
commit fdd6706245
1 changed files with 6 additions and 3 deletions

View File

@ -464,11 +464,14 @@ sftpfs_open_connection (struct vfs_s_super *super, GError ** mcerror)
/* ... start it up. This will trade welcome banners, exchange keys,
* and setup crypto, compression, and MAC layers
*/
rc = libssh2_session_handshake (sftpfs_super->session,
(libssh2_socket_t) sftpfs_super->socket_handle);
while ((rc =
libssh2_session_handshake (sftpfs_super->session,
(libssh2_socket_t) sftpfs_super->socket_handle)) ==
LIBSSH2_ERROR_EAGAIN)
;
if (rc != 0)
{
mc_propagate_error (mcerror, rc, "%s", _("sftp: Failure establishing SSH session"));
mc_propagate_error (mcerror, rc, "%s", _("sftp: failure establishing SSH session"));
return (-1);
}