From: Alex Rousskov Date: Mon, 17 Mar 2014 23:44:19 +0000 (-0600) Subject: Undo trunk r13269: "Vector refactor: move almost all clients to std::vector" X-Git-Tag: SQUID_3_5_0_1~170^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b84330d1e93deb467f60ee2d2efc26361b2e2d5d;p=thirdparty%2Fsquid.git Undo trunk r13269: "Vector refactor: move almost all clients to std::vector" to avoid stability issues related to std::vector migration. --- diff --git a/src/ClientDelayConfig.h b/src/ClientDelayConfig.h index 30cd5abcf9..d9e3c69707 100644 --- a/src/ClientDelayConfig.h +++ b/src/ClientDelayConfig.h @@ -2,8 +2,7 @@ #define SQUID_CLIENTDELAYCONFIG_H #include "acl/forward.h" - -#include +#include "base/Vector.h" class StoreEntry; class ConfigParser; @@ -22,7 +21,7 @@ public: int64_t highwatermark; }; -typedef std::vector ClientDelayPools; +typedef Vector ClientDelayPools; /* represents configuration of client write limiting delay pools */ class ClientDelayConfig diff --git a/src/ConfigOption.cc b/src/ConfigOption.cc index 93f691a4a0..2b771479ee 100644 --- a/src/ConfigOption.cc +++ b/src/ConfigOption.cc @@ -44,7 +44,7 @@ ConfigOptionVector::~ConfigOptionVector() bool ConfigOptionVector::parse(char const *option, const char *value, int isaReconfig) { - std::vector::iterator i = options.begin(); + Vector::iterator i = options.begin(); while (i != options.end()) { if ((*i)->parse(option,value, isaReconfig)) @@ -59,7 +59,7 @@ ConfigOptionVector::parse(char const *option, const char *value, int isaReconfig void ConfigOptionVector::dump(StoreEntry * e) const { - for (std::vector::const_iterator i = options.begin(); + for (Vector::const_iterator i = options.begin(); i != options.end(); ++i) (*i)->dump(e); } diff --git a/src/ConfigOption.h b/src/ConfigOption.h index 9ca1c00f7b..2016eb6b7f 100644 --- a/src/ConfigOption.h +++ b/src/ConfigOption.h @@ -30,7 +30,7 @@ #ifndef SQUID_CONFIGOPTION_H #define SQUID_CONFIGOPTION_H -#include +#include "base/Vector.h" class StoreEntry; @@ -53,7 +53,7 @@ public: virtual ~ConfigOptionVector(); virtual bool parse(char const *option, const char *value, int reconfiguring); virtual void dump(StoreEntry * e) const; - std::vectoroptions; + Vectoroptions; }; template diff --git a/src/CpuAffinityMap.cc b/src/CpuAffinityMap.cc index d4132f0365..2d616263e8 100644 --- a/src/CpuAffinityMap.cc +++ b/src/CpuAffinityMap.cc @@ -10,7 +10,7 @@ #include "Debug.h" bool -CpuAffinityMap::add(const std::vector &aProcesses, const std::vector &aCores) +CpuAffinityMap::add(const Vector &aProcesses, const Vector &aCores) { if (aProcesses.size() != aCores.size()) return false; diff --git a/src/CpuAffinityMap.h b/src/CpuAffinityMap.h index e2038cfcb7..d322573f3d 100644 --- a/src/CpuAffinityMap.h +++ b/src/CpuAffinityMap.h @@ -4,7 +4,7 @@ #ifndef SQUID_CPU_AFFINITY_MAP_H #define SQUID_CPU_AFFINITY_MAP_H -#include +#include "base/Vector.h" class CpuAffinitySet; @@ -13,20 +13,20 @@ class CpuAffinityMap { public: /// append cpu_affinity_map option - bool add(const std::vector &aProcesses, const std::vector &aCores); + bool add(const Vector &aProcesses, const Vector &aCores); /// calculate CPU set for this process CpuAffinitySet *calculateSet(const int targetProcess) const; /// returns list of process numbers - const std::vector &processes() const { return theProcesses; } + const Vector &processes() const { return theProcesses; } /// returns list of cores - const std::vector &cores() const { return theCores; } + const Vector &cores() const { return theCores; } private: - std::vector theProcesses; ///< list of process numbers - std::vector theCores; ///< list of cores + Vector theProcesses; ///< list of process numbers + Vector theCores; ///< list of cores }; #endif // SQUID_CPU_AFFINITY_MAP_H diff --git a/src/DelayPools.h b/src/DelayPools.h index 182df498a8..f7748e262a 100644 --- a/src/DelayPools.h +++ b/src/DelayPools.h @@ -32,7 +32,7 @@ #ifndef SQUID_DELAYPOOLS_H #define SQUID_DELAYPOOLS_H -#include +#include "base/Vector.h" class DelayPool; class Updateable; @@ -75,7 +75,7 @@ private: static time_t LastUpdate; static unsigned short pools_; static void FreeDelayData (); - static std::vector toUpdate; + static Vector toUpdate; static void RegisterWithCacheManager(void); }; diff --git a/src/DelayTagged.h b/src/DelayTagged.h index f0c15d6a69..61b6e4c620 100644 --- a/src/DelayTagged.h +++ b/src/DelayTagged.h @@ -37,6 +37,7 @@ #if USE_DELAY_POOLS #include "auth/Gadgets.h" +#include "base/Vector.h" #include "CompositePoolNode.h" #include "DelayBucket.h" #include "DelayIdComposite.h" diff --git a/src/DelayVector.h b/src/DelayVector.h index 33bc2c5834..f0cb9a72d6 100644 --- a/src/DelayVector.h +++ b/src/DelayVector.h @@ -72,16 +72,16 @@ private: private: RefCount theVector; - std::vector ids; - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + Vector ids; + typedef Vector::iterator iterator; + typedef Vector::const_iterator const_iterator; }; friend class Id; - std::vector pools; - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + Vector pools; + typedef Vector::iterator iterator; + typedef Vector::const_iterator const_iterator; }; #endif /* USE_DELAY_POOLS */ diff --git a/src/DiskIO/DiskIOModule.cc b/src/DiskIO/DiskIOModule.cc index 8d151b20b7..2992f2237d 100644 --- a/src/DiskIO/DiskIOModule.cc +++ b/src/DiskIO/DiskIOModule.cc @@ -35,7 +35,7 @@ #include "squid.h" #include "DiskIOModule.h" -std::vector *DiskIOModule::_Modules = NULL; +Vector *DiskIOModule::_Modules = NULL; //DiskIOModule() : initialised (false) {} @@ -70,17 +70,17 @@ DiskIOModule::ModuleAdd(DiskIOModule &instance) GetModules().push_back (&instance); } -std::vector const & +Vector const & DiskIOModule::Modules() { return GetModules(); } -std::vector & +Vector & DiskIOModule::GetModules() { if (!_Modules) - _Modules = new std::vector; + _Modules = new Vector; return *_Modules; } diff --git a/src/DiskIO/DiskIOModule.h b/src/DiskIO/DiskIOModule.h index a7696d5557..ad05153c94 100644 --- a/src/DiskIO/DiskIOModule.h +++ b/src/DiskIO/DiskIOModule.h @@ -32,7 +32,7 @@ #ifndef SQUID_DISKIOMODULE_H #define SQUID_DISKIOMODULE_H -#include +#include "base/Vector.h" /* forward decls */ @@ -57,9 +57,9 @@ public: * available module for this system. */ static DiskIOModule *FindDefault(); - static std::vector const &Modules(); - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + static Vector const &Modules(); + typedef Vector::iterator iterator; + typedef Vector::const_iterator const_iterator; DiskIOModule(); virtual ~DiskIOModule() {} @@ -78,8 +78,8 @@ protected: static void RegisterAllModulesWithCacheManager(void); private: - static std::vector &GetModules(); - static std::vector *_Modules; + static Vector &GetModules(); + static Vector *_Modules; }; #endif /* SQUID_DISKIOMODULE_H */ diff --git a/src/EventLoop.h b/src/EventLoop.h index a2778f618e..3070051053 100644 --- a/src/EventLoop.h +++ b/src/EventLoop.h @@ -31,7 +31,7 @@ #ifndef SQUID_EVENTLOOP_H #define SQUID_EVENTLOOP_H -#include +#include "base/Vector.h" #define EVENT_LOOP_TIMEOUT 1000 /* 1s timeout */ @@ -104,7 +104,7 @@ private: bool dispatchCalls(); bool last_loop; - typedef std::vector engine_vector; + typedef Vector engine_vector; engine_vector engines; TimeEngine * timeService; AsyncEngine * primaryEngine; diff --git a/src/FadingCounter.h b/src/FadingCounter.h index ee65f92e4d..9430ef14f6 100644 --- a/src/FadingCounter.h +++ b/src/FadingCounter.h @@ -1,7 +1,7 @@ #ifndef SQUID_FADING_COUNTER_H #define SQUID_FADING_COUNTER_H -#include +#include "base/Vector.h" /// Counts events, forgetting old ones. Usefull for "3 errors/minute" limits. class FadingCounter @@ -25,7 +25,7 @@ private: double delta; ///< sub-interval duration = horizon/precision double lastTime; ///< time of the last update - std::vector counters; ///< events per delta (possibly stale) + Vector counters; ///< events per delta (possibly stale) int total; ///< number of remembered events (possibly stale) }; diff --git a/src/FwdState.cc b/src/FwdState.cc index 3a8d11e82b..881cb94dad 100644 --- a/src/FwdState.cc +++ b/src/FwdState.cc @@ -472,7 +472,7 @@ FwdState::complete() entry->reset(); // drop the last path off the selection list. try the next one. - serverDestinations.erase(serverDestinations.begin()); + serverDestinations.shift(); startConnectionOrFail(); } else { @@ -611,7 +611,7 @@ FwdState::retryOrBail() if (pconnRace == raceHappened) debugs(17, 4, HERE << "retrying the same destination"); else - serverDestinations.erase(serverDestinations.begin()); // last one failed. try another. + serverDestinations.shift(); // last one failed. try another. startConnectionOrFail(); return; } diff --git a/src/FwdState.h b/src/FwdState.h index 88b5775088..5472b5164b 100644 --- a/src/FwdState.h +++ b/src/FwdState.h @@ -2,6 +2,7 @@ #define SQUID_FORWARD_H #include "base/RefCount.h" +#include "base/Vector.h" #include "comm.h" #include "comm/Connection.h" #include "err_type.h" diff --git a/src/HttpHdrRange.cc b/src/HttpHdrRange.cc index 541a23e1de..32d71f1fcf 100644 --- a/src/HttpHdrRange.cc +++ b/src/HttpHdrRange.cc @@ -342,7 +342,7 @@ HttpHdrRange::packInto(Packer * packer) const } void -HttpHdrRange::merge (std::vector &basis) +HttpHdrRange::merge (Vector &basis) { /* reset old array */ specs.clear(); @@ -368,7 +368,7 @@ HttpHdrRange::merge (std::vector &basis) } void -HttpHdrRange::getCanonizedSpecs(std::vector ©) +HttpHdrRange::getCanonizedSpecs (Vector ©) { /* canonize each entry and destroy bad ones if any */ @@ -379,7 +379,8 @@ HttpHdrRange::getCanonizedSpecs(std::vector ©) delete (*pos); } - debugs(64, 3, "found " << specs.size() - copy.size() << " bad specs"); + debugs(64, 3, "HttpHdrRange::getCanonizedSpecs: found " << + specs.size() - copy.size() << " bad specs"); } #include "HttpHdrContRange.h" @@ -410,7 +411,7 @@ HttpHdrRange::canonize (int64_t newClen) clen = newClen; debugs(64, 3, "HttpHdrRange::canonize: started with " << specs.size() << " specs, clen: " << clen); - std::vector goods; + Vector goods; getCanonizedSpecs(goods); merge (goods); debugs(64, 3, "HttpHdrRange::canonize: finished with " << specs.size() << @@ -578,7 +579,7 @@ HttpHdrRange::contains(HttpHdrRangeSpec& r) const const HttpHdrRangeSpec * HttpHdrRangeIter::currentSpec() const { - if (pos != end) + if (pos.incrementable()) return *pos; return NULL; @@ -590,7 +591,7 @@ HttpHdrRangeIter::updateSpec() assert (debt_size == 0); assert (valid); - if (pos != end) { + if (pos.incrementable()) { debt(currentSpec()->length); } } diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 26677530c6..f0f3e454ea 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -50,8 +50,6 @@ #include "StrList.h" #include "TimeOrTag.h" -#include - /* * On naming conventions: * @@ -889,10 +887,7 @@ HttpHeader::delAt(HttpHeaderPos pos, int &headers_deleted) void HttpHeader::compact() { - // TODO: optimize removal, or possibly make it so that's not needed. - std::vector::iterator newend; - newend = std::remove(entries.begin(), entries.end(), static_cast(NULL)); - entries.resize(newend-entries.begin()); + entries.prune(NULL); } /* @@ -948,7 +943,7 @@ HttpHeader::insertEntry(HttpHeaderEntry * e) else CBIT_SET(mask, e->id); - entries.insert(entries.begin(),e); + entries.insert(e); /* increment header length, allow for ": " and crlf */ len += e->name.size() + 2 + e->value.size() + 2; diff --git a/src/HttpHeader.h b/src/HttpHeader.h index 7f08ee8a01..8681d1aaca 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -36,8 +36,6 @@ #include "MemPool.h" #include "SquidString.h" -#include - /* class forward declarations */ class HttpHdrCc; class HttpHdrContRange; @@ -285,7 +283,7 @@ public: inline bool chunked() const; ///< whether message uses chunked Transfer-Encoding /* protected, do not use these, use interface functions instead */ - std::vector entries; /**< parsed fields in raw format */ + Vector entries; /**< parsed fields in raw format */ HttpHeaderMask mask; /**< bit set <=> entry present */ http_hdr_owner_type owner; /**< request or reply */ int len; /**< length when packed, not counting terminating null-byte */ diff --git a/src/HttpHeaderRange.h b/src/HttpHeaderRange.h index 2c20633e7c..0a66b83d06 100644 --- a/src/HttpHeaderRange.h +++ b/src/HttpHeaderRange.h @@ -1,3 +1,4 @@ + /* * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -31,13 +32,12 @@ #ifndef SQUID_HTTPHEADERRANGE_H #define SQUID_HTTPHEADERRANGE_H +#include "base/Vector.h" #include "MemPool.h" #include "Packer.h" #include "Range.h" #include "SquidString.h" -#include - class HttpReply; /* http byte-range-spec */ @@ -83,8 +83,8 @@ public: ~HttpHdrRange(); HttpHdrRange &operator= (HttpHdrRange const &); - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + typedef Vector::iterator iterator; + typedef Vector::const_iterator const_iterator; iterator begin(); const_iterator begin () const; iterator end(); @@ -103,11 +103,11 @@ public: int64_t lowestOffset(int64_t) const; bool offsetLimitExceeded(const int64_t limit) const; bool contains(HttpHdrRangeSpec& r) const; - std::vector specs; + Vector specs; private: - void getCanonizedSpecs (std::vector ©); - void merge (std::vector &basis); + void getCanonizedSpecs (Vector ©); + void merge (Vector &basis); int64_t clen; }; @@ -121,7 +121,6 @@ class HttpHdrRangeIter public: HttpHdrRange::iterator pos; - HttpHdrRange::iterator end; const HttpHdrRangeSpec *currentSpec() const; void updateSpec(); int64_t debt() const; diff --git a/src/Notes.cc b/src/Notes.cc index 3a93ee3e5c..b35029c6b9 100644 --- a/src/Notes.cc +++ b/src/Notes.cc @@ -162,7 +162,7 @@ NotePairs::find(const char *noteKey) const { static String value; value.clean(); - for (std::vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { + for (Vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { if ((*i)->name.cmp(noteKey) == 0) { if (value.size()) value.append(", "); @@ -177,7 +177,7 @@ NotePairs::toString(const char *sep) const { static String value; value.clean(); - for (std::vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { + for (Vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { value.append((*i)->name); value.append(": "); value.append(ConfigParser::QuoteString((*i)->value)); @@ -189,7 +189,7 @@ NotePairs::toString(const char *sep) const const char * NotePairs::findFirst(const char *noteKey) const { - for (std::vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { + for (Vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { if ((*i)->name.cmp(noteKey) == 0) return (*i)->value.termedBuf(); } @@ -219,7 +219,7 @@ NotePairs::addStrList(const char *key, const char *values) bool NotePairs::hasPair(const char *key, const char *value) const { - for (std::vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { + for (Vector::const_iterator i = entries.begin(); i != entries.end(); ++i) { if ((*i)->name.cmp(key) == 0 && (*i)->value.cmp(value) == 0) return true; } @@ -229,7 +229,7 @@ NotePairs::hasPair(const char *key, const char *value) const void NotePairs::append(const NotePairs *src) { - for (std::vector::const_iterator i = src->entries.begin(); i != src->entries.end(); ++i) { + for (Vector::const_iterator i = src->entries.begin(); i != src->entries.end(); ++i) { entries.push_back(new NotePairs::Entry((*i)->name.termedBuf(), (*i)->value.termedBuf())); } } @@ -237,7 +237,7 @@ NotePairs::append(const NotePairs *src) void NotePairs::appendNewOnly(const NotePairs *src) { - for (std::vector::const_iterator i = src->entries.begin(); i != src->entries.end(); ++i) { + for (Vector::const_iterator i = src->entries.begin(); i != src->entries.end(); ++i) { if (!hasPair((*i)->name.termedBuf(), (*i)->value.termedBuf())) entries.push_back(new NotePairs::Entry((*i)->name.termedBuf(), (*i)->value.termedBuf())); } diff --git a/src/Notes.h b/src/Notes.h index 274d3bb145..6490f5d24e 100644 --- a/src/Notes.h +++ b/src/Notes.h @@ -3,6 +3,7 @@ #include "acl/forward.h" #include "base/RefCount.h" +#include "base/Vector.h" #include "CbDataList.h" #include "format/Format.h" #include "MemPool.h" @@ -10,7 +11,6 @@ #include "typedefs.h" #include -#include class HttpRequest; class HttpReply; @@ -38,7 +38,7 @@ public: explicit Value(const String &aVal) : value(aVal), aclList(NULL), valueFormat(NULL) {} ~Value(); }; - typedef std::vector Values; + typedef Vector Values; explicit Note(const String &aKey): key(aKey) {} @@ -68,7 +68,7 @@ class ConfigParser; class Notes { public: - typedef std::vector NotesList; + typedef Vector NotesList; typedef NotesList::iterator iterator; ///< iterates over the notes list typedef NotesList::const_iterator const_iterator; ///< iterates over the notes list @@ -182,7 +182,7 @@ public: */ bool empty() const {return entries.empty();} - std::vector entries; ///< The key/value pair entries + Vector entries; ///< The key/value pair entries private: NotePairs &operator = (NotePairs const &); // Not implemented diff --git a/src/PeerSelectState.h b/src/PeerSelectState.h index 3bd6bd196b..f58885edec 100644 --- a/src/PeerSelectState.h +++ b/src/PeerSelectState.h @@ -35,6 +35,7 @@ #include "AccessLogEntry.h" #include "acl/Checklist.h" +#include "base/Vector.h" #include "cbdata.h" #include "comm/forward.h" #include "hier_code.h" diff --git a/src/StoreFileSystem.cc b/src/StoreFileSystem.cc index fb73ae921c..293c37f4e2 100644 --- a/src/StoreFileSystem.cc +++ b/src/StoreFileSystem.cc @@ -35,7 +35,7 @@ #include "squid.h" #include "StoreFileSystem.h" -std::vector *StoreFileSystem::_FileSystems = NULL; +Vector *StoreFileSystem::_FileSystems = NULL; void StoreFileSystem::RegisterAllFsWithCacheManager(void) @@ -65,17 +65,17 @@ StoreFileSystem::FsAdd(StoreFileSystem &instance) GetFileSystems().push_back (&instance); } -std::vector const & +Vector const & StoreFileSystem::FileSystems() { return GetFileSystems(); } -std::vector & +Vector & StoreFileSystem::GetFileSystems() { if (!_FileSystems) - _FileSystems = new std::vector; + _FileSystems = new Vector; return *_FileSystems; } diff --git a/src/StoreFileSystem.h b/src/StoreFileSystem.h index a5410b3c54..81dd906bb6 100644 --- a/src/StoreFileSystem.h +++ b/src/StoreFileSystem.h @@ -31,7 +31,7 @@ #ifndef SQUID_STOREFILESYSTEM_H #define SQUID_STOREFILESYSTEM_H -#include +#include "base/Vector.h" /* ****** DOCUMENTATION ***** */ @@ -116,9 +116,9 @@ public: static void SetupAllFs(); static void FsAdd(StoreFileSystem &); static void FreeAllFs(); - static std::vector const &FileSystems(); - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + static Vector const &FileSystems(); + typedef Vector::iterator iterator; + typedef Vector::const_iterator const_iterator; StoreFileSystem() : initialised(false) {} virtual ~StoreFileSystem() {} @@ -136,8 +136,8 @@ protected: virtual void registerWithCacheManager(void); private: - static std::vector &GetFileSystems(); - static std::vector *_FileSystems; + static Vector &GetFileSystems(); + static Vector *_FileSystems; static void RegisterAllFsWithCacheManager(void); }; diff --git a/src/StoreHashIndex.h b/src/StoreHashIndex.h index 22460566c7..5a33860f48 100644 --- a/src/StoreHashIndex.h +++ b/src/StoreHashIndex.h @@ -117,7 +117,7 @@ private: void *cbdata; bool _done; int bucket; - std::vector entries; + Vector entries; // keep this last. it plays with private/public CBDATA_CLASS2(StoreSearchHashIndex); diff --git a/src/acl/Acl.cc b/src/acl/Acl.cc index 574d66a9ed..1e925e7542 100644 --- a/src/acl/Acl.cc +++ b/src/acl/Acl.cc @@ -41,8 +41,6 @@ #include "profiler/Profiler.h" #include "SquidConfig.h" -#include - const ACLFlag ACLFlags::NoFlags[1] = {ACL_F_END}; const char *AclMatchedName = NULL; @@ -407,7 +405,7 @@ ACL::Prototype::Prototype (ACL const *aPrototype, char const *aType) : prototype registerMe (); } -std::vector * ACL::Prototype::Registry; +Vector * ACL::Prototype::Registry; void *ACL::Prototype::Initialized; bool @@ -431,7 +429,7 @@ ACL::Prototype::registerMe () if (!Registry || (Initialized != ((char *)Registry - 5)) ) { /* TODO: extract this */ /* Not initialised */ - Registry = new std::vector; + Registry = new Vector ; Initialized = (char *)Registry - 5; } diff --git a/src/acl/Acl.h b/src/acl/Acl.h index cbefd6423e..1fb45dbe7d 100644 --- a/src/acl/Acl.h +++ b/src/acl/Acl.h @@ -34,6 +34,7 @@ #define SQUID_ACL_H #include "acl/forward.h" +#include "base/Vector.h" #include "cbdata.h" #include "defines.h" #include "dlink.h" @@ -41,7 +42,6 @@ #include #include -#include class ConfigParser; @@ -153,10 +153,10 @@ public: char const *typeString; private: - static std::vector * Registry; + static Vector * Registry; static void *Initialized; - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + typedef Vector::iterator iterator; + typedef Vector::const_iterator const_iterator; void registerMe(); }; diff --git a/src/acl/NoteData.cc b/src/acl/NoteData.cc index cb8b032207..ab4e4cfb67 100644 --- a/src/acl/NoteData.cc +++ b/src/acl/NoteData.cc @@ -29,7 +29,7 @@ ACLNoteData::matchNotes(NotePairs *note) if (values->empty()) return (note->findFirst(name.termedBuf()) != NULL); - for (std::vector::iterator i = note->entries.begin(); i!= note->entries.end(); ++i) { + for (Vector::iterator i = note->entries.begin(); i!= note->entries.end(); ++i) { if ((*i)->name.cmp(name.termedBuf()) == 0) { if (values->match((*i)->value.termedBuf())) return true; diff --git a/src/adaptation/AccessCheck.cc b/src/adaptation/AccessCheck.cc index deb36118f9..19ee86346b 100644 --- a/src/adaptation/AccessCheck.cc +++ b/src/adaptation/AccessCheck.cc @@ -131,7 +131,7 @@ Adaptation::AccessCheck::checkCandidates() return; } - candidates.erase(candidates.begin()); // the rule apparently went away (reconfigure) + candidates.shift(); // the rule apparently went away (reconfigure) } debugs(93, 4, HERE << "NO candidates left"); @@ -176,7 +176,7 @@ Adaptation::AccessCheck::noteAnswer(allow_t answer) } // no match or the group disappeared during reconfiguration - candidates.erase(candidates.begin()); + candidates.shift(); checkCandidates(); } diff --git a/src/adaptation/AccessCheck.h b/src/adaptation/AccessCheck.h index ba3add39e4..3a931a8324 100644 --- a/src/adaptation/AccessCheck.h +++ b/src/adaptation/AccessCheck.h @@ -39,7 +39,7 @@ private: ACLFilledChecklist *acl_checklist; typedef int Candidate; - typedef std::vector Candidates; + typedef Vector Candidates; Candidates candidates; Candidate topCandidate() const { return *candidates.begin(); } ServiceGroupPointer topGroup() const; // may return nil diff --git a/src/adaptation/AccessRule.h b/src/adaptation/AccessRule.h index a8a2d1a7d6..9fae4ded79 100644 --- a/src/adaptation/AccessRule.h +++ b/src/adaptation/AccessRule.h @@ -5,8 +5,6 @@ #include "adaptation/forward.h" #include "SquidString.h" -#include - class ConfigParser; namespace Adaptation @@ -36,7 +34,7 @@ private: static Id LastId; }; -typedef std::vector AccessRules; +typedef Vector AccessRules; AccessRules &AllRules(); AccessRule *FindRule(const AccessRule::Id &id); AccessRule *FindRuleByGroupId(const String &groupId); diff --git a/src/adaptation/Config.cc b/src/adaptation/Config.cc index 62f68c3ee5..d133c493e6 100644 --- a/src/adaptation/Config.cc +++ b/src/adaptation/Config.cc @@ -36,14 +36,13 @@ #include "adaptation/History.h" #include "adaptation/Service.h" #include "adaptation/ServiceGroups.h" +#include "base/Vector.h" #include "ConfigParser.h" #include "globals.h" #include "HttpReply.h" #include "HttpRequest.h" #include "Store.h" -#include - bool Adaptation::Config::Enabled = false; char *Adaptation::Config::masterx_shared_name = NULL; int Adaptation::Config::service_iteration_limit = 16; @@ -88,19 +87,15 @@ Adaptation::Config::removeService(const String& service) for (SGSI it = services.begin(); it != services.end(); ++it) { if (*it == service) { group->removedServices.push_back(service); - ServiceGroup::Store::iterator newend; - newend = std::remove(group->services.begin(), group->services.end(), service); - group->services.resize(newend-group->services.begin()); - debugs(93, 5, "adaptation service " << service << + group->services.prune(service); + debugs(93, 5, HERE << "adaptation service " << service << " removed from group " << group->id); break; } } if (services.empty()) { removeRule(group->id); - Groups::iterator newend; - newend = std::remove(AllGroups().begin(), AllGroups().end(), group); - AllGroups().resize(newend-AllGroups().begin()); + AllGroups().prune(group); } else { ++i; } @@ -127,10 +122,8 @@ Adaptation::Config::removeRule(const String& id) for (ARI it = rules.begin(); it != rules.end(); ++it) { AccessRule* rule = *it; if (rule->groupId == id) { - debugs(93, 5, "removing access rules for:" << id); - AccessRules::iterator newend; - newend = std::remove(AllRules().begin(), AllRules().end(), rule); - AllRules().resize(newend-AllRules().begin()); + debugs(93, 5, HERE << "removing access rules for:" << id); + AllRules().prune(rule); delete (rule); break; } diff --git a/src/adaptation/Config.h b/src/adaptation/Config.h index f744ad27f6..5da85bebb7 100644 --- a/src/adaptation/Config.h +++ b/src/adaptation/Config.h @@ -51,7 +51,7 @@ public: static bool needHistory; ///< HttpRequest adaptation history should recorded - typedef std::vector ServiceConfigs; + typedef Vector ServiceConfigs; ServiceConfigs serviceConfigs; Config(); diff --git a/src/adaptation/DynamicGroupCfg.h b/src/adaptation/DynamicGroupCfg.h index efd1523fa2..8f70ee4bf4 100644 --- a/src/adaptation/DynamicGroupCfg.h +++ b/src/adaptation/DynamicGroupCfg.h @@ -1,10 +1,9 @@ #ifndef SQUID_ADAPTATION__DYNAMIC_GROUP_CFG_H #define SQUID_ADAPTATION__DYNAMIC_GROUP_CFG_H +#include "base/Vector.h" #include "SquidString.h" -#include - namespace Adaptation { @@ -12,7 +11,7 @@ namespace Adaptation class DynamicGroupCfg { public: - typedef std::vector Store; + typedef Vector Store; typedef String Id; Id id; ///< group id diff --git a/src/adaptation/History.h b/src/adaptation/History.h index 614a875c92..b502838b89 100644 --- a/src/adaptation/History.h +++ b/src/adaptation/History.h @@ -3,6 +3,7 @@ #include "adaptation/DynamicGroupCfg.h" #include "base/RefCount.h" +#include "base/Vector.h" #include "HttpHeader.h" #include "Notes.h" #include "SBuf.h" @@ -56,7 +57,7 @@ public: /// AccessLogEntry::notes when ALE becomes available NotePairs::Pointer metaHeaders; - typedef std::vector AdaptationServices; + typedef Vector AdaptationServices; AdaptationServices theAdaptationServices; ///< The service groups used /// sets future services for the Adaptation::AccessCheck to notice @@ -86,7 +87,7 @@ private: bool retried; ///< whether the xaction was replaced by another }; - typedef std::vector Entries; + typedef Vector Entries; Entries theEntries; ///< historical record, in the order of xact starts // theXx* will become a map, but we only support one record diff --git a/src/adaptation/Service.h b/src/adaptation/Service.h index 7a020ff4d9..f149ce1f2f 100644 --- a/src/adaptation/Service.h +++ b/src/adaptation/Service.h @@ -61,7 +61,7 @@ private: typedef Service::Pointer ServicePointer; -typedef std::vector Services; +typedef Vector Services; Services &AllServices(); ServicePointer FindService(const Service::Id &key); diff --git a/src/adaptation/ServiceGroups.h b/src/adaptation/ServiceGroups.h index 33d56024e1..ab7bc6f711 100644 --- a/src/adaptation/ServiceGroups.h +++ b/src/adaptation/ServiceGroups.h @@ -4,10 +4,9 @@ #include "adaptation/Elements.h" #include "adaptation/forward.h" #include "base/RefCount.h" +#include "base/Vector.h" #include "SquidString.h" -#include - namespace Adaptation { @@ -18,9 +17,9 @@ class ServiceGroup: public RefCountable public: typedef RefCount Pointer; - typedef std::vector Store; + typedef Vector Store; typedef String Id; - typedef unsigned int Pos; // vector<>::position_type + typedef unsigned int Pos; // Vector<>::poistion_type friend class ServicePlan; public: @@ -114,7 +113,7 @@ public: class ServicePlan { public: - typedef unsigned int Pos; // vector<>::position_type + typedef unsigned int Pos; // Vector<>::poistion_type public: ServicePlan(); @@ -142,7 +141,7 @@ std::ostream &operator <<(std::ostream &os, const ServicePlan &p) return p.print(os); } -typedef std::vector Groups; +typedef Vector Groups; Groups &AllGroups(); ServiceGroupPointer FindGroup(const ServiceGroup::Id &id); diff --git a/src/adaptation/icap/Config.cc b/src/adaptation/icap/Config.cc index 74506632e0..d66c3f67c9 100644 --- a/src/adaptation/icap/Config.cc +++ b/src/adaptation/icap/Config.cc @@ -33,6 +33,7 @@ #include "squid.h" #include "adaptation/icap/Config.h" #include "adaptation/icap/ServiceRep.h" +#include "base/Vector.h" #include "ConfigParser.h" #include "HttpReply.h" #include "HttpRequest.h" diff --git a/src/adaptation/icap/Options.h b/src/adaptation/icap/Options.h index 0d7e96c4f3..0a0f772cb3 100644 --- a/src/adaptation/icap/Options.h +++ b/src/adaptation/icap/Options.h @@ -71,7 +71,7 @@ public: const char *error; // human-readable information; set iff !valid() // ICAP server MUST supply this info - std::vector methods; + Vector methods; String istag; // ICAP server MAY supply this info. If not, Squid supplies defaults. diff --git a/src/adaptation/icap/ServiceRep.cc b/src/adaptation/icap/ServiceRep.cc index 4c4136c04c..ac295a767e 100644 --- a/src/adaptation/icap/ServiceRep.cc +++ b/src/adaptation/icap/ServiceRep.cc @@ -470,7 +470,7 @@ void Adaptation::Icap::ServiceRep::checkOptions() if (!theOptions->methods.empty()) { bool method_found = false; String method_list; - std::vector ::iterator iter = theOptions->methods.begin(); + Vector ::iterator iter = theOptions->methods.begin(); while (iter != theOptions->methods.end()) { diff --git a/src/adaptation/icap/ServiceRep.h b/src/adaptation/icap/ServiceRep.h index 2843bff6bd..fad4d76eac 100644 --- a/src/adaptation/icap/ServiceRep.h +++ b/src/adaptation/icap/ServiceRep.h @@ -140,7 +140,7 @@ private: AsyncCall::Pointer callback; }; - typedef std::vector Clients; + typedef Vector Clients; // TODO: rename to theUpWaiters Clients theClients; // all clients waiting for a call back diff --git a/src/auth/Config.h b/src/auth/Config.h index ad4da18ab9..aa731adfa3 100644 --- a/src/auth/Config.h +++ b/src/auth/Config.h @@ -150,7 +150,7 @@ public: Format::Format *keyExtras; ///< The compiled request format }; -typedef std::vector ConfigVector; +typedef Vector ConfigVector; extern ConfigVector TheConfig; diff --git a/src/auth/Scheme.cc b/src/auth/Scheme.cc index 996f1908d1..bce72370c4 100644 --- a/src/auth/Scheme.cc +++ b/src/auth/Scheme.cc @@ -37,7 +37,7 @@ #include "auth/Scheme.h" #include "globals.h" -std::vector *Auth::Scheme::_Schemes = NULL; +Vector *Auth::Scheme::_Schemes = NULL; void Auth::Scheme::AddScheme(Auth::Scheme::Pointer instance) @@ -63,11 +63,11 @@ Auth::Scheme::Find(const char *typestr) return Auth::Scheme::Pointer(NULL); } -std::vector & +Vector & Auth::Scheme::GetSchemes() { if (!_Schemes) - _Schemes = new std::vector; + _Schemes = new Vector; return *_Schemes; } diff --git a/src/auth/Scheme.h b/src/auth/Scheme.h index 19d592a375..f5d22fa01f 100644 --- a/src/auth/Scheme.h +++ b/src/auth/Scheme.h @@ -34,8 +34,7 @@ #if USE_AUTH #include "base/RefCount.h" - -#include +#include "base/Vector.h" /** \defgroup AuthSchemeAPI Authentication Scheme API @@ -61,8 +60,8 @@ class Scheme : public RefCountable { public: typedef RefCount Pointer; - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + typedef Vector::iterator iterator; + typedef Vector::const_iterator const_iterator; public: Scheme() : initialised (false) {}; @@ -94,13 +93,13 @@ public: Scheme(Scheme const &); Scheme &operator=(Scheme const&); - static std::vector &GetSchemes(); + static Vector &GetSchemes(); protected: bool initialised; private: - static std::vector *_Schemes; + static Vector *_Schemes; }; } // namespace Auth diff --git a/src/cache_cf.cc b/src/cache_cf.cc index caf65c1ad4..7e24e9206d 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -246,7 +246,7 @@ static void free_sslproxy_ssl_bump(acl_access **ssl_bump); static void parse_b_size_t(size_t * var); static void parse_b_int64_t(int64_t * var); -static bool parseNamedIntList(const char *data, const String &name, std::vector &list); +static bool parseNamedIntList(const char *data, const String &name, Vector &list); static void parse_CpuAffinityMap(CpuAffinityMap **const cpuAffinityMap); static void dump_CpuAffinityMap(StoreEntry *const entry, const char *const name, const CpuAffinityMap *const cpuAffinityMap); @@ -486,7 +486,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth) config_lineno = 0; - std::vector if_states; + Vector if_states; while (fgets(config_input_line, BUFSIZ, fp)) { ++config_lineno; @@ -4272,7 +4272,7 @@ free_access_log(CustomLog ** definitions) /// parses list of integers form name=N1,N2,N3,... static bool -parseNamedIntList(const char *data, const String &name, std::vector &list) +parseNamedIntList(const char *data, const String &name, Vector &list) { if (data && (strncmp(data, name.rawBuf(), name.size()) == 0)) { data += name.size(); @@ -4305,7 +4305,7 @@ parse_CpuAffinityMap(CpuAffinityMap **const cpuAffinityMap) const char *const pToken = ConfigParser::NextToken(); const char *const cToken = ConfigParser::NextToken(); - std::vector processes, cores; + Vector processes, cores; if (!parseNamedIntList(pToken, "process_numbers", processes)) { debugs(3, DBG_CRITICAL, "FATAL: bad 'process_numbers' parameter " << "in 'cpu_affinity_map'"); diff --git a/src/client_side.cc b/src/client_side.cc index a0f95eed00..df1fdb8eed 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1705,7 +1705,7 @@ ClientSocketContext::canPackMoreRanges() const if (!http->range_iter.debt()) { debugs(33, 5, HERE << "At end of current range spec for " << clientConnection); - if (http->range_iter.pos != http->range_iter.end) + if (http->range_iter.pos.incrementable()) ++http->range_iter.pos; http->range_iter.updateSpec(); diff --git a/src/client_side_request.cc b/src/client_side_request.cc index b2f2beb8f2..3125b1e2ca 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1140,7 +1140,6 @@ clientInterpretRequestHeaders(ClientHttpRequest * http) */ node->readBuffer.offset = request->range->lowestOffset(0); http->range_iter.pos = request->range->begin(); - http->range_iter.end = request->range->end(); http->range_iter.valid = true; } } diff --git a/src/comm/AcceptLimiter.cc b/src/comm/AcceptLimiter.cc index 6e144f9308..7af4beaaf8 100644 --- a/src/comm/AcceptLimiter.cc +++ b/src/comm/AcceptLimiter.cc @@ -47,8 +47,7 @@ Comm::AcceptLimiter::kick() debugs(5, 5, "size=" << deferred_.size()); while (deferred_.size() > 0 && fdNFree() >= RESERVED_FD) { /* NP: shift() is equivalent to pop_front(). Giving us a FIFO queue. */ - TcpAcceptor::Pointer temp = deferred_.front(); - deferred_.erase(deferred_.begin()); + TcpAcceptor::Pointer temp = deferred_.shift(); if (temp.valid()) { debugs(5, 5, "doing one."); -- temp->isLimited; diff --git a/src/comm/AcceptLimiter.h b/src/comm/AcceptLimiter.h index d6c28f3cb6..50689efaed 100644 --- a/src/comm/AcceptLimiter.h +++ b/src/comm/AcceptLimiter.h @@ -1,10 +1,9 @@ #ifndef _SQUID_SRC_COMM_ACCEPT_LIMITER_H #define _SQUID_SRC_COMM_ACCEPT_LIMITER_H +#include "base/Vector.h" #include "comm/TcpAcceptor.h" -#include - namespace Comm { @@ -25,7 +24,7 @@ namespace Comm * or to NULL an entry while scanning the list for empty spaces. * Side effect: TcpAcceptor->kick() becomes allowed to pull off multiple accept()'s in bunches * - * 2) re-implement as a std::queue instead of std::vector + * 2) re-implement as a list instead of vector? * storing head/tail pointers for fast push/pop and avoiding the whole shift() overhead */ class AcceptLimiter @@ -48,7 +47,7 @@ private: static AcceptLimiter Instance_; /** FIFO queue */ - std::vector deferred_; + Vector deferred_; }; }; // namepace Comm diff --git a/src/comm/forward.h b/src/comm/forward.h index caa4e2c6b8..711c546814 100644 --- a/src/comm/forward.h +++ b/src/comm/forward.h @@ -2,8 +2,7 @@ #define _SQUID_COMM_FORWARD_H #include "base/RefCount.h" - -#include +#include "base/Vector.h" namespace Comm { @@ -12,7 +11,7 @@ class Connection; typedef RefCount ConnectionPointer; -typedef std::vector ConnectionList; +typedef Vector ConnectionList; bool IsConnOpen(const Comm::ConnectionPointer &conn); diff --git a/src/delay_pools.cc b/src/delay_pools.cc index 78b7628946..96489686eb 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -42,6 +42,7 @@ #include "squid.h" #if USE_DELAY_POOLS +#include "base/Vector.h" #include "client_side_request.h" #include "comm/Connection.h" #include "CommonPool.h" @@ -591,7 +592,7 @@ DelayPools::Update(void *unused) LastUpdate = squid_curtime; - std::vector::iterator pos = toUpdate.begin(); + Vector::iterator pos = toUpdate.begin(); while (pos != toUpdate.end()) { (*pos)->update(incr); @@ -609,7 +610,7 @@ DelayPools::registerForUpdates(Updateable *anObject) void DelayPools::deregisterForUpdates (Updateable *anObject) { - std::vector::iterator pos = toUpdate.begin(); + Vector::iterator pos = toUpdate.begin(); while (pos != toUpdate.end() && *pos != anObject) { ++pos; @@ -617,7 +618,7 @@ DelayPools::deregisterForUpdates (Updateable *anObject) if (pos != toUpdate.end()) { /* move all objects down one */ - std::vector::iterator temp = pos; + Vector::iterator temp = pos; ++pos; while (pos != toUpdate.end()) { @@ -630,7 +631,7 @@ DelayPools::deregisterForUpdates (Updateable *anObject) } } -std::vector DelayPools::toUpdate; +Vector DelayPools::toUpdate; void DelayPools::Stats(StoreEntry * sentry) diff --git a/src/errorpage.cc b/src/errorpage.cc index c93ffd9d0d..942588e91c 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -119,7 +119,7 @@ error_hard_text[] = { }; /// \ingroup ErrorPageInternal -static std::vector ErrorDynamicPages; +static Vector ErrorDynamicPages; /* local prototypes */ diff --git a/src/esi/CustomParser.cc b/src/esi/CustomParser.cc index 90143b6781..986406240c 100644 --- a/src/esi/CustomParser.cc +++ b/src/esi/CustomParser.cc @@ -32,14 +32,12 @@ */ #include "squid.h" +#include "base/Vector.h" #include "Debug.h" #include "esi/CustomParser.h" -#include "fatal.h" #include "libTrie/Trie.h" #include "libTrie/TrieCharTransform.h" -#include - Trie *ESICustomParser::SearchTrie=NULL; EsiParserDefinition(ESICustomParser); @@ -149,7 +147,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool *tagEnd = '\0'; - std::vectorattributes; + Vectorattributes; char *attribute = const_cast(endofName + 1); diff --git a/src/esi/VarState.h b/src/esi/VarState.h index 87b4b53ef6..7a00daf244 100644 --- a/src/esi/VarState.h +++ b/src/esi/VarState.h @@ -32,12 +32,11 @@ #ifndef SQUID_ESIVARSTATE_H #define SQUID_ESIVARSTATE_H +#include "base/Vector.h" #include "esi/Segment.h" #include "HttpHeader.h" #include "libTrie/Trie.h" -#include - class HttpReply; /* esi variable replacement logic */ @@ -118,7 +117,7 @@ private: void doIt (); void setupUserAgent(); Trie variables; - std::vector variablesForCleanup; + Vector variablesForCleanup; Variable *defaultVariable; }; diff --git a/src/event.h b/src/event.h index b6d61aea22..41b7895891 100644 --- a/src/event.h +++ b/src/event.h @@ -33,6 +33,7 @@ #define SQUID_EVENT_H #include "AsyncEngine.h" +#include "base/Vector.h" #include "MemPool.h" class StoreEntry; diff --git a/src/fs/rock/RockSwapDir.h b/src/fs/rock/RockSwapDir.h index a8c61cf25d..dc90fd001c 100644 --- a/src/fs/rock/RockSwapDir.h +++ b/src/fs/rock/RockSwapDir.h @@ -146,8 +146,8 @@ protected: virtual void create(); private: - std::vector mapOwners; - std::vector< Ipc::Mem::Owner *> freeSlotsOwners; + Vector mapOwners; + Vector< Ipc::Mem::Owner *> freeSlotsOwners; }; } // namespace Rock diff --git a/src/ipc/Coordinator.h b/src/ipc/Coordinator.h index 507fe90b21..69631380a6 100644 --- a/src/ipc/Coordinator.h +++ b/src/ipc/Coordinator.h @@ -6,6 +6,7 @@ #ifndef SQUID_IPC_COORDINATOR_H #define SQUID_IPC_COORDINATOR_H +#include "base/Vector.h" #include "ipc/Messages.h" #include "ipc/Port.h" #include "ipc/SharedListen.h" diff --git a/src/ipc/Kids.h b/src/ipc/Kids.h index 052ae64686..2263189b60 100644 --- a/src/ipc/Kids.h +++ b/src/ipc/Kids.h @@ -4,10 +4,9 @@ #ifndef SQUID_IPC_KIDS_H #define SQUID_IPC_KIDS_H +#include "base/Vector.h" #include "ipc/Kid.h" -#include - /// a collection of kids class Kids { @@ -47,7 +46,7 @@ public: size_t count() const; private: - std::vector storage; + Vector storage; }; extern Kids TheKids; ///< All kids being maintained diff --git a/src/ipc/Queue.h b/src/ipc/Queue.h index 79a7654788..eca2ca477c 100644 --- a/src/ipc/Queue.h +++ b/src/ipc/Queue.h @@ -5,6 +5,7 @@ #define SQUID_IPC_QUEUE_H #include "base/InstanceId.h" +#include "base/Vector.h" #include "Debug.h" #include "ipc/AtomicWord.h" #include "ipc/mem/FlexibleArray.h" diff --git a/src/tests/stub_DiskIOModule.cc b/src/tests/stub_DiskIOModule.cc index c3136e0bab..457726bc7b 100644 --- a/src/tests/stub_DiskIOModule.cc +++ b/src/tests/stub_DiskIOModule.cc @@ -4,13 +4,10 @@ #include "tests/STUB.h" #include "DiskIO/DiskIOModule.h" - -#include - void DiskIOModule::SetupAllModules() STUB void DiskIOModule::ModuleAdd(DiskIOModule &) STUB void DiskIOModule::FreeAllModules() STUB void DiskIOModule::PokeAllModules() STUB DiskIOModule *DiskIOModule::Find(char const *) STUB_RETVAL(NULL) DiskIOModule *DiskIOModule::FindDefault() STUB_RETVAL(NULL) -std::vector const &DiskIOModule::Modules() STUB_RETSTATREF(std::vector) +Vector const &DiskIOModule::Modules() STUB_RETSTATREF(Vector) diff --git a/src/tests/stub_libauth.cc b/src/tests/stub_libauth.cc index accf8e90dc..a14c3151b7 100644 --- a/src/tests/stub_libauth.cc +++ b/src/tests/stub_libauth.cc @@ -21,11 +21,10 @@ AuthUserHashPointer::AuthUserHashPointer(Auth::User::Pointer anAuth_user) STUB Auth::User::Pointer AuthUserHashPointer::user() const STUB_RETVAL(NULL) #include "auth/Scheme.h" -#include -std::vector *Auth::Scheme::_Schemes = NULL; +Vector *Auth::Scheme::_Schemes = NULL; void Auth::Scheme::AddScheme(Auth::Scheme::Pointer) STUB Auth::Scheme::Pointer Auth::Scheme::Find(const char *) STUB_RETVAL(NULL) -std::vector & Auth::Scheme::GetSchemes() STUB_RETVAL(*_Schemes); +Vector & Auth::Scheme::GetSchemes() STUB_RETVAL(*_Schemes); void Auth::Scheme::FreeAll() STUB #include "auth/User.h" diff --git a/src/tunnel.cc b/src/tunnel.cc index 6f9aecd3b4..98fe5a433d 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -33,6 +33,7 @@ #include "squid.h" #include "acl/FilledChecklist.h" +#include "base/Vector.h" #include "CachePeer.h" #include "client_side.h" #include "client_side_request.h" @@ -774,7 +775,7 @@ tunnelConnectDone(const Comm::ConnectionPointer &conn, comm_err_t status, int xe /* At this point only the TCP handshake has failed. no data has been passed. * we are allowed to re-try the TCP-level connection to alternate IPs for CONNECT. */ - tunnelState->serverDestinations.erase(tunnelState->serverDestinations.begin()); + tunnelState->serverDestinations.shift(); if (status != COMM_TIMEOUT && tunnelState->serverDestinations.size() > 0) { /* Try another IP of this destination host */