cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: NTLM proxy nightmare - POST problem?

From: Jonathan Arnold <jarnold_at_insors.com>
Date: Fri, 09 Mar 2007 18:26:42 -0500

(sorry to keep replying to my own posts, but information is just
pouring in, and I'm closing up shop for the night!)

Jonathan Arnold wrote:
> Daniel Stenberg wrote:
>> On Fri, 9 Mar 2007, Jonathan Arnold wrote:
>>
>>> In the Curl_http_auth_act routine, 'perhapsrewind' is called if the
>>> request isn't either a POST or a HEAD and if pickhost or pickproxy is
>>> true (in this case, pickproxy is true). 'perhapsrewind' sets the
>>> conn's rewindaftersend to be true, even though there is nothing to be
>>> sent and thus curl just loops, sending nothing and receiving nothing.
>>>
>>> rewindwaftersend gets set to true because of this peculiar if:
>>>
>>> http.c(258):
>>
>> What about the line immediately before that line? It says:
>>
>> if((expectsend == -1) || (expectsend > bytessent)) {
>>
>> What are the contents of the variables expectsend and bytessent in
>> this case?
>
> expectsend == -1 and bytessent == 0
>
>>> And yes, authproxy.picked == CURLAUTH_NTLM. And expectsend == -1,
>>> because it never gets changed from its initial setting (not sure if
>>> the HTTPREQ_POST should be picking up a postfieldsize or not).
>>
>> Ah, you haven't set a postfieldsize. Did you try simply changing your
>> app to do that?
>
> I didn't try that, as I thought it was supposed to use strlen to do it. But
> maybe that hasn't happened yet. I will try that to see what happens.

Okay, I added the call to CURLOPT_POSTFIELDSIZE and backed out my changes. There
is still the problem where it thinks there is something to send, but there is no
socket opened to send it. But it does point out a flaw in my little hack, because
expectsend now equals 6, so it would fall through into the bad if conditional
anyway. This may also show some kind of bug where the postfieldsize isn't getting
set early enough if it isn't set by the user?

-- 
Jonathan Arnold           Software Engineer
inSORS Integrated Communications, Inc
jarnold_at_insors.com Office/fax: 781.391.2818
Received on 2007-03-10