summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-method.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-06-23 12:17:35 +0100
committerMichael Vogt <mvo@debian.org>2015-06-23 12:17:35 +0100
commit245dde96193702f7f51389d3583dee547f8ba366 (patch)
tree6cf8c191641c760bcc6a6c08fb0ff65d27e0cffd /apt-pkg/acquire-method.cc
parent5530255b5f3ad7de2e23dfcb39ce325001126501 (diff)
parentc8a4ce6cbed57ae108dc955d4a850f9b129a0693 (diff)
Merge remote-tracking branch 'donkult/debian/experimental' into debian/experimental
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r--apt-pkg/acquire-method.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index c29ef469e..d3aff4d5e 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -376,7 +376,10 @@ int pkgAcqMethod::Run(bool Single)
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
@@ -385,14 +388,14 @@ int pkgAcqMethod::Run(bool Single)
*I = Tmp;
if (QueueBack == 0)
QueueBack = Tmp;
-
+
// Notify that this item is to be fetched.
- if (Fetch(Tmp) == false)
+ if (URIAcquire(Message, Tmp) == false)
Fail();
-
- break;
- }
- }
+
+ break;
+ }
+ }
}
Exit();
@@ -400,8 +403,6 @@ int pkgAcqMethod::Run(bool Single)
}
/*}}}*/
// AcqMethod::PrintStatus - privately really send a log/status message /*{{{*/
-// ---------------------------------------------------------------------
-/* */
void pkgAcqMethod::PrintStatus(char const * const header, const char* Format,
va_list &args) const
{
@@ -477,5 +478,9 @@ void pkgAcqMethod::Dequeue() { /*{{{*/
delete Tmp;
}
/*}}}*/
-
pkgAcqMethod::~pkgAcqMethod() {}
+
+pkgAcqMethod::FetchItem::FetchItem() {}
+pkgAcqMethod::FetchItem::~FetchItem() {}
+
+pkgAcqMethod::FetchResult::~FetchResult() {}