]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-method.cc
Revert "Fix select timeout to be 50msec instead of 0.5msec" for acquire
[apt.git] / apt-pkg / acquire-method.cc
index c78e95e58959fdfeed64ad25c45c45ea90652ae9..991e6780a6e71bf375e82430d51f8b73de812157 100644 (file)
@@ -127,7 +127,7 @@ void pkgAcqMethod::Fail(string Err,bool Transient)
 /* */
 void pkgAcqMethod::DropPrivsOrDie()
 {
 /* */
 void pkgAcqMethod::DropPrivsOrDie()
 {
-   if (!DropPrivs()) {
+   if (!DropPrivileges()) {
       Fail(false);
       exit(112);       /* call the european emergency number */
    }
       Fail(false);
       exit(112);       /* call the european emergency number */
    }
@@ -376,7 +376,10 @@ int pkgAcqMethod::Run(bool Single)
                  Tmp->ExpectedHashes.push_back(HashString(*t, hash));
            }
             char *End;
                  Tmp->ExpectedHashes.push_back(HashString(*t, hash));
            }
             char *End;
-            Tmp->MaximumSize = strtoll(LookupTag(Message, "Maximum-Size", "0").c_str(), &End, 10);
+           if (Tmp->ExpectedHashes.FileSize() > 0)
+              Tmp->MaximumSize = Tmp->ExpectedHashes.FileSize();
+           else
+              Tmp->MaximumSize = strtoll(LookupTag(Message, "Maximum-Size", "0").c_str(), &End, 10);
            Tmp->Next = 0;
            
            // Append it to the list
            Tmp->Next = 0;
            
            // Append it to the list
@@ -385,14 +388,14 @@ int pkgAcqMethod::Run(bool Single)
            *I = Tmp;
            if (QueueBack == 0)
               QueueBack = Tmp;
            *I = Tmp;
            if (QueueBack == 0)
               QueueBack = Tmp;
-           
+
            // Notify that this item is to be fetched.
            // Notify that this item is to be fetched.
-           if (Fetch(Tmp) == false)
+           if (URIAcquire(Message, Tmp) == false)
               Fail();
               Fail();
-           
-           break;                                           
-        }   
-      }      
+
+           break;
+        }
+      }
    }
 
    Exit();
    }
 
    Exit();
@@ -400,8 +403,6 @@ int pkgAcqMethod::Run(bool Single)
 }
                                                                        /*}}}*/
 // AcqMethod::PrintStatus - privately really send a log/status message /*{{{*/
 }
                                                                        /*}}}*/
 // AcqMethod::PrintStatus - privately really send a log/status message /*{{{*/
-// ---------------------------------------------------------------------
-/* */
 void pkgAcqMethod::PrintStatus(char const * const header, const char* Format,
                               va_list &args) const
 {
 void pkgAcqMethod::PrintStatus(char const * const header, const char* Format,
                               va_list &args) const
 {
@@ -456,7 +457,7 @@ void pkgAcqMethod::Redirect(const string &NewURI)
 // ---------------------------------------------------------------------
 /* */
 pkgAcqMethod::FetchResult::FetchResult() : LastModified(0),
 // ---------------------------------------------------------------------
 /* */
 pkgAcqMethod::FetchResult::FetchResult() : LastModified(0),
-                                   IMSHit(false), Size(0), ResumePoint(0)
+                                   IMSHit(false), Size(0), ResumePoint(0), d(NULL)
 {
 }
                                                                        /*}}}*/
 {
 }
                                                                        /*}}}*/
@@ -477,3 +478,9 @@ void pkgAcqMethod::Dequeue() {                                              /*{{{*/
    delete Tmp;
 }
                                                                        /*}}}*/
    delete Tmp;
 }
                                                                        /*}}}*/
+pkgAcqMethod::~pkgAcqMethod() {}
+
+pkgAcqMethod::FetchItem::FetchItem() : d(NULL) {}
+pkgAcqMethod::FetchItem::~FetchItem() {}
+
+pkgAcqMethod::FetchResult::~FetchResult() {}