Skip to content

Commit 058fb33

Browse files
committed
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
1 parent 0355e33 commit 058fb33

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/transfer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,9 @@ CURLcode Curl_retry_request(struct connectdata *conn,
20852085
prevent i.e HTTP transfers to return
20862086
error just because nothing has been
20872087
transfered! */
2088+
2089+
if(data->state.proto.http->writebytecount)
2090+
Curl_readrewind(conn);
20882091
}
20892092
return CURLE_OK;
20902093
}

0 commit comments

Comments
 (0)