diff options
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r-- | apt-pkg/acquire-item.cc | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 21d990fba..3e858175c 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -276,6 +276,26 @@ static HashStringList GetExpectedHashesFromFor(metaIndex * const Parser, std::st } /*}}}*/ +class pkgAcquire::Item::Private /*{{{*/ +{ +public: + struct AlternateURI + { + std::string URI; + std::unordered_map<std::string, std::string> changefields; + AlternateURI(std::string &&u, decltype(changefields) &&cf) : URI(u), changefields(cf) {} + }; + std::list<AlternateURI> AlternativeURIs; + std::vector<std::string> PastRedirections; + std::unordered_map<std::string, std::string> CustomFields; + unsigned int Retries; + + Private() : Retries(_config->FindI("Acquire::Retries", 0)) + { + } +}; + /*}}}*/ + // all ::HashesRequired and ::GetExpectedHashes implementations /*{{{*/ /* ::GetExpectedHashes is abstract and has to be implemented by all subclasses. It is best to implement it as broadly as possible, while ::HashesRequired defaults @@ -682,24 +702,6 @@ class APT_HIDDEN CleanupItem : public pkgAcqTransactionItem /*{{{*/ /*}}}*/ // Acquire::Item::Item - Constructor /*{{{*/ -class pkgAcquire::Item::Private -{ -public: - struct AlternateURI - { - std::string const URI; - std::unordered_map<std::string, std::string> changefields; - AlternateURI(std::string &&u, decltype(changefields) &&cf) : URI(u), changefields(cf) {} - }; - std::list<AlternateURI> AlternativeURIs; - std::vector<std::string> PastRedirections; - std::unordered_map<std::string, std::string> CustomFields; - unsigned int Retries; - - Private() : Retries(_config->FindI("Acquire::Retries", 0)) - { - } -}; APT_IGNORE_DEPRECATED_PUSH pkgAcquire::Item::Item(pkgAcquire * const owner) : FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false), @@ -960,7 +962,7 @@ void pkgAcquire::Item::Done(string const &/*Message*/, HashStringList const &Has } Status = StatDone; ErrorText.clear(); - Owner->Dequeue(this); + Dequeue(); } /*}}}*/ // Acquire::Item::Rename - Rename a file /*{{{*/ @@ -985,6 +987,7 @@ bool pkgAcquire::Item::Rename(string const &From,string const &To) /*}}}*/ void pkgAcquire::Item::Dequeue() /*{{{*/ { + d->AlternativeURIs.clear(); Owner->Dequeue(this); } /*}}}*/ @@ -1187,7 +1190,7 @@ void pkgAcqMetaBase::AbortTransaction() { (*I)->ExpectedAdditionalItems = 0; if ((*I)->Status != pkgAcquire::Item::StatFetching) - Owner->Dequeue(*I); + (*I)->Dequeue(); (*I)->TransactionState(TransactionAbort); } Transaction.clear(); |