cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Re: http proxy tunnel, connect-only and authentication

From: Shmulik Regev <shmulbox_at_gmail.com>
Date: Fri, 13 Jul 2007 09:03:29 +0200

> Hm, then I must've misunderstood the flow that lead to the problem your
patch
> addressed... I was trying to prevent the problem from happening rather
than
> surviving the effects from it. BTW, I committed my patch just now but I'll
> re-evaluate it's value with input from you.

I'll try to supply a repeatable scenario (as I mentioned I discovered the
problem in a rather artificial manner).

> Yes, if both are zero that's most likely a fine close that we should treat
as
> such. Of course we should make an effort to behave and continue working
> properly even for this case.

I have a fix for this but validating that it really does the job requires
handling the bigger issue I'm still struggling with. I'll forward it to you
once I'm back at work.

> So you're using asynch dns resolves to connect over a proxy? The resolve
is
> thus for the proxy name, right? (Just asking to get some things straight
in
> myhead.)
This is indeed the case.

> In the Curl_connect() case, it is done because the name resolve is fast
> enough or done synchronously, as otherwise it is done from
> Curl_async_resolved() when the name finally is resolved.

Thought so. I'm dealing with 2 proxies:
1. On our LAN, with NTLM authentication. It sends a ''Proxy-Connection:
Close'' header with the first 407 response.
2. One outside the LAN with Basic authentication. It closes the socket
(without any Connection headers) with the first 407 response.

Working with the first proxy is ok as indeed connect is instant and works
when called from Curl_async_resolved. On the other hand with the remote
proxy connect usually doesn't complete when called from Curl_async_resolved.

> I don't think I follow you about the "socket closure is not correctly
> handled". What socket closure? You mean the one that happens in the middle
of
> Curl_proxyCONNECT() ? The only "handling" of that situation is what is
done in> lib/url.c:SetupConnection(). Possibly that > is not enough...

I meant that the fact that the proxy closes the socket is properly handled
when dealing with the first proxy. Indeed SetupConnection when called from
Curl_async_resolved handles it correctly.

Cheers,
Shmul
Received on 2007-07-13