New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connection reuse does not work with libssh #3491
Comments
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. |
|
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. Fixes curl#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: