cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Passing raw data through a proxy

From: Karl M <karlm30_at_hotmail.com>
Date: Mon, 06 Feb 2006 00:34:57 -0800

Hi Daniel...

Here is a first installment for a connect_only patch. Please take a look at
it and comment.

Notes:

I have not tested the multi interface, as I don't use it.

The addition of "&& bits.httpproxy" in the condition for calling
Curl_proxyCONNECT (3 places) is more general than just connect_only. If you
turn on proxy tunneling, but don't have a proxy (because you may or may not
get one from the environment variables), libcurl incorrectly calls
Curl_proxyCONNECT and this is difficult to work around from the application.
This solves the problem and seems reasonable to me.

The easy interface works with and without a proxy, controlled from the
environment variables. :.)

I had a problem with CURLAUTH_ANYSAFE and had to change to CURLAUTH_NTLM. My
proxy closes the connection after responding to the first connect request
(DOS protection) and libcurl does not connect again to send the connect with
the auth type 1 stuff. I saw something about this on an older version of
libcurl that indicated that it was fixed, but I still see the problem.

Perhaps CURLINFO_LASTSOCKET would be better that CURLINFO_SOCKET, to
emphasize that it is the most recently used socket for the session handle.

Thanks,

...Karl

>From: Allen Chan
>Subject: Re: Passing raw data through a proxy
>Date: Mon, 16 Jan 2006 18:16:55 +0900
>
>On 1/16/06, Daniel Stenberg wrote:
> > On Mon, 16 Jan 2006, Allen Chan wrote:
> > I'm not sure what you're asking.
> >
> > The lib/url.c:Curl_done() function gets called when a single request has
> > completed. In there you also see that the connection is sometimes closed
>and
> > the connectdata struct is killed at this time.
> >
> > In that function you could simply store a pointer (most likely in the
>struct
> > UrlState part of the SessionHandle struct) to the connectdata struct if
>the
> > connection is still alive, or set it to NULL if not and then rely on
>that
> > pointer to hold the truth when you extract the socket later...
> >
> > Also, as I forgot in my last response, please update the documentation
> > accordingly for your new features. Edit the nroff files (with a .3
>extension)
> > and include the changes in your patch. Just follow the syntax already
>used and
> > you should have no trouble.
>
>Okay, thanks Daniel, I understand, I'll get right on it.
>
>Allen
> >
> > --
> > Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
> >
>

Received on 2006-02-06