From 27b8814017a19009b22e4b51aea1ae711ec20459 Mon Sep 17 00:00:00 2001
From: Ben Winslow <rain@bluecherry.net>
Date: Fri, 22 Jul 2011 22:50:58 +0200
Subject: [PATCH] progress: reset flags at transfer start

When an easy handle is used to download an URI which has no
Content-Length header (or equivalent) after downloading an URI which
does, the value from the previous transfer is reused and returned by
CURLINFO_CONTENT_LENGTH_DOWNLOAD. This is because the progress flags
(used to determine whether such a header was received) are not reset
between transfers.

Bug: http://curl.haxx.se/bug/view.cgi?id=3370895
---
 lib/progress.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/progress.c b/lib/progress.c
index 8655dc4c29..9f20a0068a 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -201,6 +201,7 @@ void Curl_pgrsStartNow(struct SessionHandle *data)
 {
   data->progress.speeder_c = 0; /* reset the progress meter display */
   data->progress.start = Curl_tvnow();
+  data->progress.flags = 0;
 }
 
 void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size)
-- 
GitLab