curl-library
Re: Re: Reuse conditions of ssh connection?
Date: Sat, 31 Mar 2012 15:39:46 +0200 (CEST)
On Mon, 19 Mar 2012, Ellié Computing Open Source Program wrote:
> OK, I understand my scenario better now, here is what happens:
> - start a connection to a "site" 1 (some kind of "server+auth info"
> structure)
> - finish the job, and keep the CURL* easy handle in a list for reuse, reset
> it
> - start a connection to a site 2 very similar to previous one, only auth info
> changes
> - ConnectionExists reuses connection to site 1, because server + user/pwd
> match (but not AUTH_TYPES)
Right, that's what I think as well. For this SSH connection (and I don't know
if there are others as well), the new auth_types need to include the existing
one or the connections don't match.
> for connection reuse of SFTP/SCP we need to copy during connection the
> authentication related options, else we cannot know if those options changed
> since last request.
Exactly!
> It includes almost all CURLSSH_OPT_?? excluding the KEYFUNCTION/KEYDATA.
> where should I copy them? inside ssh_conn structure?
Sure, that seems like an excellent place to put them. All options that changes
the characteristics for the connection enough to be interesting to keep for
re-use and other purposes.
> may other protocols be touched by that remark? (i.e. stateful authentication
> => authentication info copied in connectdata)
I'm not sure how many others that do this, or how many others that have bugs
in this similar style.
-- / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-31