cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl retry without notifying application?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 27 Aug 2009 17:03:24 +0200 (CEST)

On Thu, 27 Aug 2009, Mark Aldred wrote:

> This comment in Curl_retry_request() indicates that curl is doing exactly
> what I thought. Sounds like it is retrying a PUT without returning an
> error. This behavior is fine for GETs and DELETEs, but not PUTs.

You draw the wrong conclusions based on what I believe are misunderstandings
of what you read in a particular piece of the code.

libcurl supports PUT and POST and we even have test cases that rewind data
when libcurl has to send the same data again. This is not a design flaw in
libcurl, you're experience a bug of some kind.

I think it'd be better if you would clarify in more details exactly how this
bug appears and what the server has sent up to this point and what your read
callback has done up to this point.

> data->req.upload_present != 0 && ///////////////////////// ADDED
> THIS LINE

(please consider using diff -u to show patches)

This is the wrong fix. The upload_present field only says how much data there
is in the upload buffer, it is now a good indicator if anything has been read
with the read callback or not.

-- 
  / daniel.haxx.se
Received on 2009-08-27