You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling curl_easy_perform() more than once on one easy handle for a SSH connection (sftp:// URL), the connection is not reused. See example code below.
It seems to try reusing the connection, but then says that the connection is dead. See excerpt from the output of my example program below.
...
* SFTP DONE done
* SSH 0x556ccafe29c0 state change from SSH_SFTP_CLOSE to SSH_STOP (line 1651)
* Connection #0 to host localhost left intact
* Expire cleared (transfer 0x556ccafe41a8)
Second curl_easy_perform() call...
* Expire in 0 ms for 6 (transfer 0x556ccafe41a8)
* STATE: INIT => CONNECT handle 0x556ccafe41a8; line 1443 (connection #-5000)
* Found bundle for host localhost: 0x556ccafe0418 [serially]
* Connection 0 seems to be dead!
* The cache now contains 0 members
* SSH DISCONNECT starts now
...
The text was updated successfully, but these errors were encountered:
Looks like the check for the connection does not work correctly for libssh connections.
in url.c:
dead=SocketIsDead(conn->sock[FIRSTSOCKET]);
I tried deactivating this check, and the connection is successfully reused.
Which meaning does conn->sock[FIRSTSOCKET] have for libssh connections? This is not the socket which we would get using ssh_get_fd().
By default, libssh creates a new socket, instead of using the socket
created by curl for SSH connections.
Pass the socket created by curl to libssh using ssh_options_set() with
SSH_OPTIONS_FD directly after ssh_new(). So libssh uses our socket
instead of creating a new one.
This approach is very similar to what is done in the libssh2 code, where
the socket created by curl is passed to libssh2 when
libssh2_session_startup() is called.
Fixescurl#3491
When calling curl_easy_perform() more than once on one easy handle for a SSH connection (sftp:// URL), the connection is not reused. See example code below.
It seems to try reusing the connection, but then says that the connection is dead. See excerpt from the output of my example program below.
curl/libcurl version
Same on Windows with CURL 7.63.0 on Windows 7, compiled with Visual Studio 2017 and libssh 0.8.6
tested operating systems
example program source code
excerpt from the output of the example program
The text was updated successfully, but these errors were encountered: