diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2011-03-20 23:24:45 +0100 | 
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2011-03-20 23:24:45 +0100 | 
| commit | 058fb3355715747e754ede5395c52390ec3394be (patch) | |
| tree | 4c02db43b485f072439eabac7515b74d6b702edd | |
| parent | 0355e33b5f7b234cf3ddd7d9deef0e8616e177ce (diff) | |
retry-request: rewind if data was sent
When libcurl sends a HTTP request on a re-used connection and detects it
being closed (ie no data at all was read from it), it is important to
rewind if any data in the request was sent using the read callback or
was read from file, as otherwise the retried request will be broken.
Reported by: Chris Smowton
Bug: http://curl.haxx.se/bug/view.cgi?id=3195205
| -rw-r--r-- | lib/transfer.c | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/lib/transfer.c b/lib/transfer.c index 266b83441..c33cf13fd 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -2085,6 +2085,9 @@ CURLcode Curl_retry_request(struct connectdata *conn,                                  prevent i.e HTTP transfers to return                                  error just because nothing has been                                  transfered! */ + +    if(data->state.proto.http->writebytecount) +      Curl_readrewind(conn);    }    return CURLE_OK;  } | 
