summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-02-13 23:38:28 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-02-14 00:45:10 +0100
commitf9b4f12d65b827612b29071f05d605bc05fa62bd (patch)
treee614e695c4dd6387b02ba31ecfabea888a1a460e /methods
parent4bca852015e95a36fddfba4b8874f2666da3c2ff (diff)
report https download start only if we really get it
Reporting it via progress means that e.g. a redirect will trigger it, too, so you get a Get & Hit while http only reports a Hit as it should be.
Diffstat (limited to 'methods')
-rw-r--r--methods/https.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/methods/https.cc b/methods/https.cc
index 146b2bfb8..d97fddf9e 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -75,6 +75,8 @@ HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp)
{
HttpsMethod *me = (HttpsMethod *)userp;
+ if (me->Res.Size == 0)
+ me->URIStart(me->Res);
if(me->File->Write(buffer, size*nmemb) != true)
return false;
@@ -88,7 +90,6 @@ HttpsMethod::progress_callback(void *clientp, double dltotal, double dlnow,
HttpsMethod *me = (HttpsMethod *)clientp;
if(dltotal > 0 && me->Res.Size == 0) {
me->Res.Size = (unsigned long long)dltotal;
- me->URIStart(me->Res);
}
return 0;
}