cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: connection reuse with proxies and ssl

From: Gautam Kachroo <gk4curl_at_gmail.com>
Date: Thu, 24 Jan 2008 16:54:49 -0800

On Jan 24, 2008 3:27 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Wed, 23 Jan 2008, Gautam Kachroo wrote:
>
> > It would still be nice if the connection structure kept track of the
> > protocol initialization being finished, i.e. ConnectionExists could
> > look at check->bits.protoconndone.
>
> > It would also be nice if the ssl connect state keps a done flag, "use" only
> > seems to record that the ssl connect process started.
>
> How about simply changing the 'use' variable from a boolean to a state
> variable with values such as:
>
> NONE
> NEGOTIATION
> COMPLETE
>
> (Notably, all non-openssl libs would never be in the middle state since they
> do the "negotiate" phase blocking.)
>
> Would you be able to take a stab at introducing something like this?

Sure.
 Some complications were in ftp.c. I'm not familiar with that code, so
I tried to change it minimally, hence I left the current "use" flag in
place and added a new state field.

I only have openssl to test with, so the changes to gtls, nss, and
qssl haven't been tested. I noticed that gtls, nss didn't set use to
false on errors. I didn't change that.
Curl_qsossl_connect does set use to FALSE if there's an errror, but
not when Curl_qsossl_handshake fails, which seems inconsistent.

The diff is attached.

-gk

Received on 2008-01-25