diff options
Diffstat (limited to 'methods')
-rw-r--r-- | methods/cdrom.cc | 3 | ||||
-rw-r--r-- | methods/ftp.cc | 5 | ||||
-rw-r--r-- | methods/gpgv.cc | 6 | ||||
-rw-r--r-- | methods/http.cc | 6 | ||||
-rw-r--r-- | methods/http.h | 14 | ||||
-rw-r--r-- | methods/mirror.cc | 24 | ||||
-rw-r--r-- | methods/rred.cc | 7 | ||||
-rw-r--r-- | methods/rsh.h | 2 |
8 files changed, 44 insertions, 23 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 82d806e9d..bc115d259 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -56,7 +56,8 @@ class CDROMMethod : public pkgAcqMethod CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | SendConfig | NeedsCleanup | Removable), - DatabaseLoaded(false), + DatabaseLoaded(false), + Debug(false), MountedByApt(false) { UdevCdroms.Dlopen(); diff --git a/methods/ftp.cc b/methods/ftp.cc index 87aa8d798..861647aea 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -71,7 +71,8 @@ time_t FtpMethod::FailTime = 0; // --------------------------------------------------------------------- /* */ FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1), - DataListenFd(-1), ServerName(Srv) + DataListenFd(-1), ServerName(Srv), + ForceExtended(false), TryPassive(true) { Debug = _config->FindB("Debug::Acquire::Ftp",false); PasvAddr = 0; @@ -561,7 +562,7 @@ bool FTPConn::ExtGoPasv() string::const_iterator List[4]; unsigned Count = 0; Pos++; - for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); I++) + for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); ++I) { if (*I != Msg[Pos]) continue; diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 9de29ddf3..251bcbc90 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -215,21 +215,21 @@ bool GPGVMethod::Fetch(FetchItem *Itm) { errmsg += _("The following signatures were invalid:\n"); for (vector<string>::iterator I = BadSigners.begin(); - I != BadSigners.end(); I++) + I != BadSigners.end(); ++I) errmsg += (*I + "\n"); } if (!WorthlessSigners.empty()) { errmsg += _("The following signatures were invalid:\n"); for (vector<string>::iterator I = WorthlessSigners.begin(); - I != WorthlessSigners.end(); I++) + I != WorthlessSigners.end(); ++I) errmsg += (*I + "\n"); } if (!NoPubKeySigners.empty()) { errmsg += _("The following signatures couldn't be verified because the public key is not available:\n"); for (vector<string>::iterator I = NoPubKeySigners.begin(); - I != NoPubKeySigners.end(); I++) + I != NoPubKeySigners.end(); ++I) errmsg += (*I + "\n"); } } diff --git a/methods/http.cc b/methods/http.cc index 51fdaa0cd..b60cfeb9e 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -404,10 +404,10 @@ ServerState::RunHeadersResult ServerState::RunHeaders() if (Debug == true) clog << Data; - for (string::const_iterator I = Data.begin(); I < Data.end(); I++) + for (string::const_iterator I = Data.begin(); I < Data.end(); ++I) { string::const_iterator J = I; - for (; J != Data.end() && *J != '\n' && *J != '\r';J++); + for (; J != Data.end() && *J != '\n' && *J != '\r'; ++J); if (HeaderLine(string(I,J)) == false) return RUN_HEADERS_PARSE_ERROR; I = J; @@ -1327,7 +1327,7 @@ int HttpMethod::Loop() StopRedirects = true; else { - for (StringVectorIterator I = R.begin(); I != R.end(); I++) + for (StringVectorIterator I = R.begin(); I != R.end(); ++I) if (Queue->Uri == *I) { R[0] = "STOP"; diff --git a/methods/http.h b/methods/http.h index b74740ab3..c47d7184a 100644 --- a/methods/http.h +++ b/methods/http.h @@ -36,14 +36,14 @@ class CircleBuf static struct timeval BwReadTick; static const unsigned int BW_HZ; - unsigned long long LeftRead() + unsigned long long LeftRead() const { unsigned long long Sz = Size - (InP - OutP); if (Sz > Size - (InP%Size)) Sz = Size - (InP%Size); return Sz; } - unsigned long long LeftWrite() + unsigned long long LeftWrite() const { unsigned long long Sz = InP - OutP; if (InP > MaxGet) @@ -68,12 +68,12 @@ class CircleBuf // Control the write limit void Limit(long long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;} - bool IsLimit() {return MaxGet == OutP;}; - void Print() {cout << MaxGet << ',' << OutP << endl;}; + bool IsLimit() const {return MaxGet == OutP;}; + void Print() const {cout << MaxGet << ',' << OutP << endl;}; // Test for free space in the buffer - bool ReadSpace() {return Size - (InP - OutP) > 0;}; - bool WriteSpace() {return InP - OutP > 0;}; + bool ReadSpace() const {return Size - (InP - OutP) > 0;}; + bool WriteSpace() const {return InP - OutP > 0;}; // Dump everything void Reset(); @@ -113,7 +113,7 @@ struct ServerState URI ServerName; bool HeaderLine(string Line); - bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; + bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0; Encoding = Closes; time(&Date); ServerFd = -1; Pipeline = true;}; diff --git a/methods/mirror.cc b/methods/mirror.cc index 768e6b3a3..61a7f12fd 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -10,6 +10,7 @@ // Include Files /*{{{*/ #include <config.h> +#include <apt-pkg/aptconfiguration.h> #include <apt-pkg/fileutl.h> #include <apt-pkg/acquire-method.h> #include <apt-pkg/acquire-item.h> @@ -56,7 +57,7 @@ using namespace std; */ MirrorMethod::MirrorMethod() - : HttpMethod(), DownloadedMirrorFile(false) + : HttpMethod(), DownloadedMirrorFile(false), Debug(false) { }; @@ -109,7 +110,7 @@ bool MirrorMethod::Clean(string Dir) continue; // see if we have that uri - for(I=list.begin(); I != list.end(); I++) + for(I=list.begin(); I != list.end(); ++I) { string uri = (*I)->GetURI(); if(uri.find("mirror://") != 0) @@ -136,9 +137,24 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) string fetch = BaseUri; fetch.replace(0,strlen("mirror://"),"http://"); +#if 0 // no need for this, the getArchitectures() will also include the main + // arch + // append main architecture + fetch += "?arch=" + _config->Find("Apt::Architecture"); +#endif + + // append all architectures + std::vector<std::string> vec = APT::Configuration::getArchitectures(); + for (std::vector<std::string>::const_iterator I = vec.begin(); + I != vec.end(); I++) + if (I == vec.begin()) + fetch += "?arch" + (*I); + else + fetch += "&arch=" + (*I); + // append the dist as a query string if (Dist != "") - fetch += "?dist=" + Dist; + fetch += "&dist=" + Dist; if(Debug) clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'" @@ -332,7 +348,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str) vector<metaIndex *>::const_iterator I; pkgSourceList list; list.ReadMainList(); - for(I=list.begin(); I != list.end(); I++) + for(I=list.begin(); I != list.end(); ++I) { string uristr = (*I)->GetURI(); if(Debug) diff --git a/methods/rred.cc b/methods/rred.cc index 57d9a8437..bc941ed04 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -53,7 +53,7 @@ protected: virtual bool Fetch(FetchItem *Itm); public: - RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig) {}; + RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig), Debug(false) {}; }; /*}}}*/ /** \brief applyFile - in reverse order with a tail recursion {{{ @@ -241,7 +241,9 @@ RredMethod::State RredMethod::patchFile(FileFd &Patch, FileFd &From, /*{{{*/ return result; } /*}}}*/ -struct EdCommand { /*{{{*/ +/* struct EdCommand {{{*/ +#ifdef _POSIX_MAPPED_FILES +struct EdCommand { size_t data_start; size_t data_end; size_t data_lines; @@ -250,6 +252,7 @@ struct EdCommand { /*{{{*/ char type; }; #define IOV_COUNT 1024 /* Don't really want IOV_MAX since it can be arbitrarily large */ +#endif /*}}}*/ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/ FileFd &out_file, Hashes *hash) const { diff --git a/methods/rsh.h b/methods/rsh.h index b4c76479a..c81396b5f 100644 --- a/methods/rsh.h +++ b/methods/rsh.h @@ -34,7 +34,7 @@ class RSHConn // Raw connection IO bool WriteMsg(string &Text,bool Sync,const char *Fmt,...); bool Connect(string Host, string User); - bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; + bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; // Connection control bool Open(); |