diff options
Diffstat (limited to 'methods/https.cc')
-rw-r--r-- | methods/https.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/methods/https.cc b/methods/https.cc index fc649d6c2..335699907 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -10,11 +10,14 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include <config.h> + #include <apt-pkg/fileutl.h> #include <apt-pkg/acquire-method.h> #include <apt-pkg/error.h> #include <apt-pkg/hashes.h> #include <apt-pkg/netrc.h> +#include <apt-pkg/configuration.h> #include <sys/stat.h> #include <sys/time.h> @@ -25,12 +28,11 @@ #include <errno.h> #include <string.h> #include <iostream> -#include <apti18n.h> #include <sstream> #include "config.h" #include "https.h" - +#include <apti18n.h> /*}}}*/ using namespace std; @@ -51,7 +53,7 @@ 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)dltotal; + me->Res.Size = (unsigned long long)dltotal; me->URIStart(me->Res); } return 0; @@ -270,14 +272,17 @@ bool HttpsMethod::Fetch(FetchItem *Itm) long curl_servdate; curl_easy_getinfo(curl, CURLINFO_FILETIME, &curl_servdate); + File->Close(); + // cleanup if(success != 0) { _error->Error("%s", curl_errorstr); + // unlink, no need keep 401/404 page content in partial/ + unlink(File->Name().c_str()); Fail(); return true; } - File->Close(); // Timestamp struct utimbuf UBuf; |