cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1854175 ] Digest proxy auth with CURLOPT_READFUNCTION fails / behavior

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 19 Dec 2007 07:24:22 -0800

Bugs item #1854175, was opened at 2007-12-19 15:24
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1854175&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Spacen Jasset (sjasset)
Assigned to: Daniel Stenberg (bagder)
Summary: Digest proxy auth with CURLOPT_READFUNCTION fails / behavior

Initial Comment:
We are using curl 7.17.0 on various platforms.

We set:

curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);

and use a CURLOPT_READFUNCTION.

We use squid or ISA server as a proxy with Digest authentication enabled.

There are two things that happen number (2) depends on timing.

(1)
We make a largeish size post (> 64K) of misc (binary) data using the read callback.
Curl recieves a 407 from squid.
Curl sends us a CURLIOCMD_RESTARTREAD which we honor
Curl then starts sending the post data again on the same connection

Curl then re-tries with digest authentication and succeeds.

The problem here is that curl rewinds the data stream and yet still sends all the data -- plus the bit it sent before the rewind. See case1.log

(2) Like (1) except the proxy server closes the connection as soon as it realises that curl is sending more post data than it should, the request sequence then ends in a failure. This is harder to reproduce, and in fact is far more prevalent on an slow or loaded machine. See case2.log

Because we see (2) quite often I have compiled a patch, which passes the unit tests I have run. The patch may not be in the correct place, and may not be proper as I don't have a full understanding of how the flags work.

RCS file: /cvsroot/3rdParty/curl-7.17.0/lib/transfer.c,v
retrieving revision 1.1
diff -u -r1.1 transfer.c
--- transfer.c 26 Sep 2007 14:05:39 -0000 1.1
+++ transfer.c 18 Dec 2007 17:20:25 -0000
@@ -656,6 +656,8 @@
                   infof(data, "Keep sending data to get tossed away!\n");
                   k->keepon |= KEEP_WRITE;
                 }
+ else
+ k->keepon &= ~KEEP_WRITE;
               }
 #endif /* CURL_DISABLE_HTTP */

See with_patch.log

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1854175&group_id=976
Received on 2007-12-19

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET