]> git.saurik.com Git - apt.git/blobdiff - methods/https.cc
test if TMPDIR is accessible before using
[apt.git] / methods / https.cc
index e0348ab58f7fd36b96e8c140f4eaf2bd31ff0cf1..366148e199678ccb112e5e5b6952585396f44dc7 100644 (file)
@@ -20,6 +20,7 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/proxy.h>
 
 #include <sys/stat.h>
 #include <sys/time.h>
                                                                        /*}}}*/
 using namespace std;
 
+bool HttpsMethod::Configuration(std::string Message)
+{
+   if (pkgAcqMethod::Configuration(Message) == false)
+      return false;
+
+   DropPrivsOrDie();
+
+   return true;
+}
+
 size_t
 HttpsMethod::parse_header(void *buffer, size_t size, size_t nmemb, void *userp)
 {
@@ -81,6 +92,12 @@ HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp)
    if(me->File->Write(buffer, size*nmemb) != true)
       return false;
 
+   if(me->Queue->MaximumSize > 0 && me->File->Tell() > me->Queue->MaximumSize)
+   {
+      me->SetFailReason("MaximumSizeExceeded");
+      return _error->Error("Writing more data than expected (%llu > %llu)",
+                           me->TotalWritten, me->Queue->MaximumSize);
+   }
    return size*nmemb;
 }
 
@@ -107,6 +124,9 @@ void HttpsMethod::SetupProxy()                                      /*{{{*/
 {
    URI ServerName = Queue->Uri;
 
+   // Determine the proxy setting
+   AutoDetectProxy(ServerName);
+
    // Curl should never read proxy settings from the environment, as
    // we determine which proxy to use.  Do this for consistency among
    // methods and prevent an environment variable overriding a