summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-08-11 08:33:36 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-08-11 08:33:36 +0200
commit31e33a9a4663e0bf62b0815d22af879f2209bf6f (patch)
treee0ac01f600faee986bd26fb9064b34ae130afa5a
parent04f84edd5bfaad5af81c165cbcecc53fdfc1251b (diff)
downloadcurl-31e33a9a4663e0bf62b0815d22af879f2209bf6f.tar.gz
HTTP: retry failed HEAD requests too
Mark's new document about HTTP Retries (https://mnot.github.io/I-D/httpbis-retry/) made me check our code and I spotted that we don't retry failed HEAD requests which seems totally inconsistent and I can't see any reason for that separate treatment. So, no separate treatment for HEAD starting now. A HTTP request sent over a reused connection that gets cut off before a single byte is received will be retried on a fresh connection. Made-aware-by: Mark Nottingham
-rw-r--r--lib/transfer.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 82a961f0e..e4a2835f8 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1890,13 +1890,12 @@ CURLcode Curl_retry_request(struct connectdata *conn,
return CURLE_OK;
if((data->req.bytecount + data->req.headerbytecount == 0) &&
- conn->bits.reuse &&
- !data->set.opt_no_body &&
- (data->set.rtspreq != RTSPREQ_RECEIVE)) {
- /* We got no data, we attempted to re-use a connection and yet we want a
- "body". This might happen if the connection was left alive when we were
- done using it before, but that was closed when we wanted to read from
- it again. Bad luck. Retry the same request on a fresh connect! */
+ conn->bits.reuse &&
+ (data->set.rtspreq != RTSPREQ_RECEIVE)) {
+ /* We didn't get a single byte when we attempted to re-use a
+ connection. This might happen if the connection was left alive when we
+ were done using it before, but that was closed when we wanted to use it
+ again. Bad luck. Retry the same request on a fresh connect! */
infof(conn->data, "Connection died, retrying a fresh connect\n");
*url = strdup(conn->data->change.url);
if(!*url)