curl-library
Re: [Patch]: Prepare for credential retrieving callback.
Date: Fri, 31 Oct 2008 00:03:50 +0100 (CET)
On Thu, 30 Oct 2008, Josef Wolf wrote:
> The rest of this patch moves user_passwd/proxy_user_passwd flags
> from conn->bits into conn->data.state.auth[host|proxy].
This won't work. Let me do a quick description:
'conn' is the standard name for the 'struct connectdata' and it holds
everything related to a single physical actual connection to a host. 'data' is
the 'struct SessionHandle' which is the 'CURL *' externally. It is basically a
placeholder for all currently set options for upcoming transfers, and for DNS
cache etc etc.
When the multi or share interfaces are used, some of the stuff otherwise held
by the 'data' struct is then kept by the multi or the shared objects.
Thus, libcurl creates a new 'conn' in case there's no existing one to re-use
and it will keep N 'conn' structs around. Each connection can of course have
its own set of credentials, protocol, states and more. This is also why
there's a set of data copied from 'data' to 'conn' at the creation of the
connection.
> + if (!authinfo->user_passwd) return FALSE; /* no authentication requested */
I prefer statements like this to use two lines.
The rest looked fine, but with the struct mix mentioned above cleaned up I'll
have another look!
-- / daniel.haxx.seReceived on 2008-10-31