cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: NTLM proxy authentication with CURLOPT_READDATA seems broken.

From: Spacen Jasset <spacenjasset_at_yahoo.co.uk>
Date: Wed, 05 Dec 2007 17:04:04 +0000

Spacen Jasset wrote:
> Daniel Stenberg wrote:
>> On Wed, 5 Dec 2007, Spacen Jasset wrote:
>>
>>> It looks like the calls to Curl_setup_transfer are wrong, they should
>>> use postsize to 'tern' on rather than http->postdata which is always
>>> true. The POSTFIELD version uses postsize.
>>>
>>> With these changes it works as expected.
>>
>> Sorry, but http->postdata is not always true and your change breaks
>> all sorts of operations as a 'make test' quickly reveals...
>>
>> I'm working on setting up a test 547 that repeats your problem. Test
>> 548 is already committed now and should be your case but using
>> CURLOPT_POSTFIELDS (and thus working).
>>
> Ok, I see. Pitty I didn't perform the fix on a unix platform.
>
>

I have formed another patch (wich passes the current unit tests) to use
for now, but I'll apply your patch when you get a chance to look at it
Here is what I have this time around:

diff -u -r1.1 http.c
--- http.c 26 Sep 2007 14:05:38 -0000 1.1
+++ http.c 5 Dec 2007 16:46:50 -0000
@@ -2497,7 +2497,14 @@

            /* set the pointer to mark that we will send the post body using
               the read callback */
- http->postdata = (char *)&http->postdata;
+
+ /* Do not set any post data if authentication "conversations"
+ are taking place, the Content-Length has already been set
+ to 0 for this purpose*/
+ if (conn->bits.authneg)
+ http->postdata = NULL;
+ else
+ http->postdata = (char *)&http->postdata;
          }
        }
        /* issue the request */
Received on 2007-12-05