cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP Post with digest

From: Raf Nulens <raf.nulens_at_androme.com>
Date: Tue, 11 Mar 2008 14:48:46 +0100

Daniel Stenberg wrote:
> On Thu, 6 Mar 2008, Raf Nulens wrote:
>
>> This issue already has been reported over a year ago
>> (http://curl.haxx.se/mail/lib-2007-03/0043.html), but we're still
>> struggling with it in version 7.18.0.
>
> I have fixed all known issues with Digest and POST before 7.18.0, so I
> actually claim that even if may look like the same issue, it very
> probably is not.
>
>> POST /mmas/wbe_302S/wbe.picture.osp HTTP/1.1
>> Host: 193.166.131.188:8080
>> Accept: */*
>> Content-Type: image/png
>> Content-Length: 0
>>
>> Instead of waiting for a response from the server, the client starts
>> immediately sending the binary data!
>
> That does indeed sound like the wrong behavior!
>
>> The following curl options are set:
>
> For our conveniance, can you post a complete source snippet for an
> application that gets this?

Here is a full example with two cases: one digest POST without a read
callback, and one - malfunctioning - with read callback.

Note that the POST wont succeed with the current server & login
settings, but you should be able to see the different curl behavior.
POST without read callback waits for the 401 authorization required,
while POST with with read callback doesnt wait (or at least doesn't
resend the header with the provided authentication).

>
> Then we can covert it into a proper test case and proceed from there!
>
>> Problem seems to be that when data is received through the
>> read-callback, it is immediately sent without checking if
>> authentication is done.
>
> I don't think the read callback should be used at all if no data should
> be sent...
>
>> This seems to solve the issue, we enter the readwrite function again
>> when the second header (with digest authentication) has been sent.
>
> I can't approve that solution though, as it is too explicit for just
> your case and it fixes the effects of the problem rather than the roots
> of it.
>

Received on 2008-03-11