--------------------- PatchSet 4444 Date: 2007/05/03 13:37:04 Author: amosjeffries Branch: ayjwork Tag: (none) Log: All that can be done with ./configure and then some Members: src/AuthUser.cc:1.3.4.1->1.3.4.2 src/CommonPool.h:1.3.22.2->1.3.22.3 src/DelayTagged.cc:1.3.24.1->1.3.24.2 src/HttpHeader.cc:1.40.4.5->1.40.4.6 src/HttpReply.cc:1.38.4.3->1.38.4.4 src/SquidString.h:1.8.8.1->1.8.8.2 src/String.cc:1.12->1.12.4.1(DEAD) src/String.cci:1.6->1.6.6.1(DEAD) src/cache_cf.cc:1.79.2.4->1.79.2.5 src/client_db.cc:1.10.8.1->1.10.8.2 src/client_side_request.cc:1.66.4.4->1.66.4.5 src/dns_internal.cc:1.38.2.1->1.38.2.2 src/external_acl.cc:1.52.4.4->1.52.4.5 src/fqdncache.cc:1.18.8.1->1.18.8.2 src/ftp.cc:1.62.4.6->1.62.4.7 src/ident.cc:1.15.4.1->1.15.4.2 src/ipcache.cc:1.19.8.1->1.19.8.2 src/pconn.cc:1.14.2.1->1.14.2.2 src/DiskIO/AIO/AIODiskFile.h:1.2->1.2.8.1 src/ICAP/ICAPConfig.cc:1.12.4.1->1.12.4.2 src/ICAP/ICAPConfig.h:1.9->1.9.4.1 src/ICAP/ICAPModXact.cc:1.19.4.2->1.19.4.3 src/ICAP/ICAPOptions.cc:1.9->1.9.4.1 src/ICAP/ICAPOptions.h:1.8->1.8.4.1 src/ICAP/ICAPServiceRep.cc:1.7.4.2->1.7.4.3 src/ICAP/ICAPServiceRep.h:1.6->1.6.4.1 src/auth/digest/auth_digest.cc:1.29.4.3->1.29.4.4 src/auth/negotiate/auth_negotiate.cc:1.11.4.1->1.11.4.2 src/auth/ntlm/auth_ntlm.cc:1.33.4.1->1.33.4.2 src/fs/coss/store_dir_coss.cc:1.30.4.2->1.30.4.3 src/tests/TestSwapDir.cc:1.3->1.3.8.1 src/tests/TestSwapDir.h:1.4->1.4.8.1 src/tests/testHttpRequest.cc:1.1->1.1.18.1 src/tests/testHttpRequestMethod.cc:1.2->1.2.8.1 src/tests/testStore.cc:1.4->1.4.8.1 src/tests/testStore.h:1.2->1.2.8.1 src/tests/testStoreController.cc:1.4.8.1->1.4.8.2 src/tests/testStoreEntryStream.cc:1.2->1.2.12.1 src/tests/testStoreHashIndex.cc:1.3.8.1->1.3.8.2 src/tests/testString.cc:1.2->1.2.12.1 src/tests/testURLScheme.cc:1.2->1.2.8.1 src/tests/test_http_range.cc:1.1->1.1.16.1 Index: squid3/src/AuthUser.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AuthUser.cc,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -u -r1.3.4.1 -r1.3.4.2 --- squid3/src/AuthUser.cc 1 May 2007 12:50:23 -0000 1.3.4.1 +++ squid3/src/AuthUser.cc 3 May 2007 13:37:04 -0000 1.3.4.2 @@ -1,6 +1,6 @@ /* - * $Id: AuthUser.cc,v 1.3.4.1 2007/05/01 12:50:23 amosjeffries Exp $ + * $Id: AuthUser.cc,v 1.3.4.2 2007/05/03 13:37:04 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -143,7 +143,7 @@ if (!proxy_auth_username_cache) { /* First time around, 7921 should be big enough */ proxy_auth_username_cache = - hash_create((HASHCMP *) strcmp, 7921, hash_string); + hash_create((HASHCMP *) std::strcmp, 7921, hash_string); assert(proxy_auth_username_cache); eventAdd("User Cache Maintenance", cacheCleanup, NULL, Config.authenticateGCInterval, 1); } Index: squid3/src/CommonPool.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/CommonPool.h,v retrieving revision 1.3.22.2 retrieving revision 1.3.22.3 diff -u -r1.3.22.2 -r1.3.22.3 --- squid3/src/CommonPool.h 3 May 2007 10:05:07 -0000 1.3.22.2 +++ squid3/src/CommonPool.h 3 May 2007 13:37:05 -0000 1.3.22.3 @@ -1,6 +1,6 @@ /* - * $Id: CommonPool.h,v 1.3.22.2 2007/05/03 10:05:07 amosjeffries Exp $ + * $Id: CommonPool.h,v 1.3.22.3 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -58,11 +58,11 @@ void *operator new(size_t); void operator delete (void *); static CommonPool *Factory (unsigned char _class, CompositePoolNode::Pointer&); - char const* theClassTypeLabel() const {return typeLabel.buf();} + char const* theClassTypeLabel() const { return typeLabel.c_str(); } protected: CommonPool(); - String typeLabel; + string typeLabel; }; #endif Index: squid3/src/DelayTagged.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/DelayTagged.cc,v retrieving revision 1.3.24.1 retrieving revision 1.3.24.2 diff -u -r1.3.24.1 -r1.3.24.2 --- squid3/src/DelayTagged.cc 1 May 2007 12:50:23 -0000 1.3.24.1 +++ squid3/src/DelayTagged.cc 3 May 2007 13:37:05 -0000 1.3.24.2 @@ -1,6 +1,6 @@ /* - * $Id: DelayTagged.cc,v 1.3.24.1 2007/05/01 12:50:23 amosjeffries Exp $ + * $Id: DelayTagged.cc,v 1.3.24.2 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -77,7 +77,7 @@ DelayTaggedCmp(DelayTaggedBucket::Pointer const &left, DelayTaggedBucket::Pointer const &right) { /* for rate limiting, case insensitive */ - return left->tag.caseCmp(right->tag.buf()); + return left->tag.caseCmp(right->tag.c_str()); } void @@ -183,7 +183,7 @@ ::operator delete (address); } -DelayTaggedBucket::DelayTaggedBucket(String &aTag) : tag (aTag) +DelayTaggedBucket::DelayTaggedBucket(string &aTag) : tag (aTag) { debugs(77, 3, "DelayTaggedBucket::DelayTaggedBucket"); } @@ -196,11 +196,11 @@ void DelayTaggedBucket::stats (StoreEntry *entry) const { - storeAppendPrintf(entry, " %s:", tag.buf()); + storeAppendPrintf(entry, " %s:", tag.c_str()); theBucket.stats (entry); } -DelayTagged::Id::Id(DelayTagged::Pointer aDelayTagged, String &aTag) : theTagged(aDelayTagged) +DelayTagged::Id::Id(DelayTagged::Pointer aDelayTagged, string &aTag) : theTagged(aDelayTagged) { theBucket = new DelayTaggedBucket(aTag); DelayTaggedBucket::Pointer const *existing = theTagged->buckets.find(theBucket, DelayTaggedCmp); Index: squid3/src/HttpHeader.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHeader.cc,v retrieving revision 1.40.4.5 retrieving revision 1.40.4.6 diff -u -r1.40.4.5 -r1.40.4.6 --- squid3/src/HttpHeader.cc 3 May 2007 10:05:10 -0000 1.40.4.5 +++ squid3/src/HttpHeader.cc 3 May 2007 13:37:05 -0000 1.40.4.6 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.cc,v 1.40.4.5 2007/05/03 10:05:10 amosjeffries Exp $ + * $Id: HttpHeader.cc,v 1.40.4.6 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -1607,7 +1607,7 @@ int i; for (i = 0; i < end; ++i) { - if (name_len >= 0 && name_len != info[i].name.size()) + if (name_len >= 0 && name_len != (unsigned int)info[i].name.size()) continue; if (!strncasecmp(name, info[i].name, Index: squid3/src/HttpReply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpReply.cc,v retrieving revision 1.38.4.3 retrieving revision 1.38.4.4 diff -u -r1.38.4.3 -r1.38.4.4 --- squid3/src/HttpReply.cc 3 May 2007 10:05:11 -0000 1.38.4.3 +++ squid3/src/HttpReply.cc 3 May 2007 13:37:05 -0000 1.38.4.4 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.38.4.3 2007/05/03 10:05:11 amosjeffries Exp $ + * $Id: HttpReply.cc,v 1.38.4.4 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -433,7 +433,7 @@ bool HttpReply::sanityCheckStartLine(MemBuf *buf, http_status *error) { - if ((unsigned int)buf->contentSize() >= protoPrefix.size() && strncmp(protoPrefix, buf->content(), protoPrefix.size()) != 0) { + if (buf->contentSize() >= protoPrefix.size() && strncmp(protoPrefix, buf->content(), protoPrefix.size()) != 0) { debugs(58, 3, "HttpReply::sanityCheckStartLine: missing protocol prefix (" << protoPrefix << ") in '" << buf->content() << "'"); *error = HTTP_INVALID_HEADER; return false; Index: squid3/src/SquidString.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SquidString.h,v retrieving revision 1.8.8.1 retrieving revision 1.8.8.2 diff -u -r1.8.8.1 -r1.8.8.2 --- squid3/src/SquidString.h 3 May 2007 10:05:11 -0000 1.8.8.1 +++ squid3/src/SquidString.h 3 May 2007 13:37:05 -0000 1.8.8.2 @@ -1,6 +1,6 @@ /* - * $Id: SquidString.h,v 1.8.8.1 2007/05/03 10:05:11 amosjeffries Exp $ + * $Id: SquidString.h,v 1.8.8.2 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 67 String * AUTHOR: Duane Wessels @@ -76,13 +76,21 @@ /* Overload standard functions using the basic string API */ -inline int strncasecmp(const string &lhs, const char *rhs, int len) { return strncasecmp(lhs.c_str(), rhs, len); } -inline int strncasecmp(const string &lhs, const string &rhs, int len) { return strncasecmp(lhs.c_str(), rhs.c_str(), len); } +inline int strncasecmp(const string &lhs, const char *rhs, size_t len) { return strncasecmp(lhs.c_str(), rhs, len); } +inline int strncasecmp(const string &lhs, const string &rhs, size_t len) { return strncasecmp(lhs.c_str(), rhs.c_str(), len); } + inline int strcasecmp(const string &lhs, const char *rhs) { return strcasecmp(lhs.c_str(), rhs); } inline int strcasecmp(const string &lhs, const string &rhs) { return strcasecmp(lhs.c_str(), rhs.c_str()); } + +inline int strncmp(const string &lhs, const char *rhs, size_t len) { return strncmp(lhs.c_str(), rhs, len); } +inline int strncmp(const string &lhs, const string &rhs, size_t len) { return strncmp(lhs.c_str(), rhs.c_str(), len); } + inline int strcmp(const string &lhs, const char *rhs) { return strcmp(lhs.c_str(), rhs); } inline int strcmp(const string &lhs, const string &rhs) { return strcmp(lhs.c_str(), rhs.c_str()); } -inline int strpbrk(const string &lhs, ???? &rhs) { return strpbrk(lhs.c_str(), rhs); } -inline ostream& operator <<(const string &s, ostream &os) { os << s.c_str(); return os; } + +inline const char * strpbrk(const string &lhs, const char *rhs) { return strpbrk(lhs.c_str(), rhs); } +inline const char * strpbrk(const string &lhs, const string &rhs) { return strpbrk(lhs.c_str(), rhs); } + +inline std::ostream& operator <<(std::ostream &os, const string &s) { os << s.c_str(); return os; } #endif /* SQUID_STRING_H */ --- squid3/src/String.cc Fri May 4 00:18:42 2007 +++ /dev/null Fri May 4 00:18:42 2007 @@ -1,413 +0,0 @@ - -/* - * $Id: String.cc,v 1.12 2007/04/06 12:54:13 squidadm Exp $ - * - * DEBUG: section 67 String - * AUTHOR: Duane Wessels - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "squid.h" -#include "Store.h" - -void -String::initBuf(size_t sz) -{ - PROF_start(StringInitBuf); - buf((char *)memAllocString(sz, &sz)); - assert(sz < 65536); - size_ = sz; - PROF_stop(StringInitBuf); -} - -void -String::init(char const *str) -{ - assert(this); - - PROF_start(StringInit); - if (str) - limitInit(str, strlen(str)); - else - clean(); - PROF_stop(StringInit); -} - -String::String (char const *aString) : size_(0), len_(0), buf_(NULL) -{ - init (aString); -#if DEBUGSTRINGS - - StringRegistry::Instance().add(this); -#endif -} - -String & -String::operator =(char const *aString) -{ - clean(); - init (aString); - return *this; -} - -String & -String::operator = (String const &old) -{ - clean (); - - if (old.len_) - limitInit (old.buf(), old.len_); - - return *this; -} - -bool -String::operator == (String const &that) const -{ - if (0 == this->cmp(that)) - return true; - - return false; -} - -bool -String::operator != (String const &that) const -{ - if (0 == this->cmp(that)) - return false; - - return true; -} - -void -String::limitInit(const char *str, int len) -{ - PROF_start(StringLimitInit); - assert(this && str); - initBuf(len + 1); - len_ = len; - xmemcpy(buf_, str, len); - buf_[len] = '\0'; - PROF_stop(StringLimitInit); -} - -String::String (String const &old) : size_(0), len_(0), buf_(NULL) -{ - init (old.buf()); -#if DEBUGSTRINGS - - StringRegistry::Instance().add(this); -#endif -} - -void -String::clean() -{ - PROF_start(StringClean); - assert(this); - - if (buf()) - memFreeString(size_, buf_); - - len_ = 0; - - size_ = 0; - - buf_ = NULL; - PROF_stop(StringClean); -} - -String::~String() -{ - clean(); -#if DEBUGSTRINGS - - StringRegistry::Instance().remove(this); -#endif -} - -void -String::reset(const char *str) -{ - PROF_start(StringReset); - clean(); - init(str); - PROF_stop(StringReset); -} - -void -String::append(const char *str, int len) -{ - assert(this); - assert(str && len >= 0); - - PROF_start(StringAppend); - if (len_ + len < size_) { - strncat(buf_, str, len); - len_ += len; - } else { - String snew; - snew.len_ = len_ + len; - snew.initBuf(snew.len_ + 1); - - if (buf_) - xmemcpy(snew.buf_, buf(), len_); - - if (len) - xmemcpy(snew.buf_ + len_, str, len); - - snew.buf_[snew.len_] = '\0'; - - absorb(snew); - } - PROF_stop(StringAppend); -} - -void -String::append(char const *str) -{ - assert (str); - append (str, strlen(str)); -} - -void -String::append (char chr) -{ - char myString[2]; - myString[0]=chr; - myString[1]='\0'; - append (myString, 1); -} - -void -String::append(String const &old) -{ - append (old.buf(), old.len_); -} - -void -String::absorb(String &old) -{ - clean(); - size_ = old.size_; - buf (old.buf_); - len_ = old.len_; - old.size_ = 0; - old.buf_ = NULL; - old.len_ = 0; -} - -void -String::buf(char *newBuf) -{ - assert (buf_ == NULL); - buf_ = newBuf; -} - -#if DEBUGSTRINGS -void -String::stat(StoreEntry *entry) const -{ - storeAppendPrintf(entry, "%p : %d/%d \"%s\"\n",this,len_, size_, buf()); -} - -StringRegistry & -StringRegistry::Instance() -{ - return Instance_; -} - -template -int -ptrcmp(C const &lhs, C const &rhs) -{ - return lhs - rhs; -} - -void -StringRegistry::registerWithCacheManager(CacheManager & manager) -{ - manager.registerAction("strings", - "Strings in use in squid", Stat, 0, 1); -} - -void - -StringRegistry::add - (String const *entry) -{ - entries.insert(entry, ptrcmp); -} - -void - -StringRegistry::remove - (String const *entry) -{ - entries.remove(entry, ptrcmp); -} - -StringRegistry StringRegistry::Instance_; - -extern size_t memStringCount(); - -void -StringRegistry::Stat(StoreEntry *entry) -{ - storeAppendPrintf(entry, "%lu entries, %lu reported from MemPool\n", (unsigned long) Instance().entries.elements, (unsigned long) memStringCount()); - Instance().entries.head->walk(Stater, entry); -} - -void -StringRegistry::Stater(String const * const & nodedata, void *state) -{ - StoreEntry *entry = (StoreEntry *) state; - nodedata->stat(entry); -} - -#endif - -/* TODO: move onto String */ -int -stringHasWhitespace(const char *s) -{ - return strpbrk(s, w_space) != NULL; -} - -/* TODO: move onto String */ -int -stringHasCntl(const char *s) -{ - unsigned char c; - - while ((c = (unsigned char) *s++) != '\0') { - if (c <= 0x1f) - return 1; - - if (c >= 0x7f && c <= 0x9f) - return 1; - } - - return 0; -} - -/* - * Similar to strtok, but has some rudimentary knowledge - * of quoting - */ -char * -strwordtok(char *buf, char **t) -{ - unsigned char *word = NULL; - unsigned char *p = (unsigned char *) buf; - unsigned char *d; - unsigned char ch; - int quoted = 0; - - if (!p) - p = (unsigned char *) *t; - - if (!p) - goto error; - - while (*p && xisspace(*p)) - p++; - - if (!*p) - goto error; - - word = d = p; - - while ((ch = *p)) { - switch (ch) { - - case '\\': - p++; - - switch (*p) { - - case 'n': - ch = '\n'; - - break; - - case 'r': - ch = '\r'; - - break; - - default: - ch = *p; - - break; - - } - - *d++ = ch; - - if (ch) - p++; - - break; - - case '"': - quoted = !quoted; - - p++; - - break; - - default: - if (!quoted && xisspace(*p)) { - p++; - goto done; - } - - *d++ = *p++; - break; - } - } - -done: - *d++ = '\0'; - -error: - *t = (char *) p; - return (char *) word; -} - -const char * -checkNullString(const char *p) -{ - return p ? p : "(NULL)"; -} - -#ifndef _USE_INLINE_ -#include "String.cci" -#endif --- squid3/src/String.cci Fri May 4 00:18:42 2007 +++ /dev/null Fri May 4 00:18:42 2007 @@ -1,169 +0,0 @@ - -/* - * $Id: String.cci,v 1.6 2006/09/01 23:50:33 squidadm Exp $ - * - * DEBUG: section 67 String - * AUTHOR: Duane Wessels - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -String::String() : size_(0), len_(0), buf_ (NULL) -{ -#if DEBUGSTRINGS - StringRegistry::Instance().add(this); -#endif -} - -int -String::size() const -{ - return len_; -} - -char const * -String::buf() const -{ - return buf_; -} - -const char * -String::pos(char const *aString) const -{ - return strstr(buf(), aString); -} - -const char * -String::pos(char const ch) const -{ - return strchr(buf(), ch); -} - -const char * -String::rpos(char const ch) const -{ - return strrchr(buf(), (ch)); -} - -int -String::cmp (char const *aString) const -{ - /* strcmp fails on NULLS */ - - if (size() == 0 && (aString == NULL || aString[0] == '\0')) - return 0; - - if (size() == 0) - return -1; - - if (aString == NULL || aString[0] == '\0') - return 1; - - return strcmp(buf(), aString); -} - -int -String::cmp (char const *aString, size_t count) const -{ - /* always the same at length 0 */ - - if (count == 0) - return 0; - - if (size() == 0 && (aString == NULL || aString[0] == '\0')) - return 0; - - if (size() == 0) - return -1; - - if (aString == NULL || aString[0] == '\0') - return 1; - - return strncmp(buf(), aString, count); -} - -int -String::cmp (String const &aString) const -{ - /* strcmp fails on NULLS */ - - if (size() == 0 && aString.size() == 0) - return 0; - - if (size() == 0) - return -1; - - if (aString.size() == 0) - return 1; - - return strcmp(buf(), aString.buf()); -} - -int -String::caseCmp (char const *aString) const -{ - return strcasecmp(buf(), aString); -} - -int -String::caseCmp (char const *aString, size_t count) const -{ - return strncasecmp(buf(), aString, count); -} - -/* FIXME: this is can perform buffer overflows and underflows! */ -void -String::set (char const *loc, char const ch) -{ - buf_[loc-buf_] = ch; -} - -/* FIXME: this is can perform buffer overflows and underflows! */ -void -String::cut (size_t newLength) -{ - len_ = newLength; - buf_[newLength] = '\0'; -} - -/* FIXME: this is can perform buffer overflows and underflows! */ -void -String::cutPointer (char const *loc) -{ - len_ = loc-buf_; - buf_[len_] = '\0'; -} - -std::ostream & -operator<<(std::ostream& os, String const &aString) -{ - os << aString.buf(); - return os; -} - - Index: squid3/src/cache_cf.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/cache_cf.cc,v retrieving revision 1.79.2.4 retrieving revision 1.79.2.5 diff -u -r1.79.2.4 -r1.79.2.5 --- squid3/src/cache_cf.cc 3 May 2007 10:05:11 -0000 1.79.2.4 +++ squid3/src/cache_cf.cc 3 May 2007 13:37:05 -0000 1.79.2.5 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.79.2.4 2007/05/03 10:05:11 amosjeffries Exp $ + * $Id: cache_cf.cc,v 1.79.2.5 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2201,14 +2201,14 @@ } void -ConfigParser::ParseString(string *var) +ConfigParser::ParseString(string &var) { char *token = strtok(NULL, w_space); if (token == NULL) self_destruct(); - var->reset(token); + var.reset(token); } static void Index: squid3/src/client_db.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_db.cc,v retrieving revision 1.10.8.1 retrieving revision 1.10.8.2 diff -u -r1.10.8.1 -r1.10.8.2 --- squid3/src/client_db.cc 1 May 2007 12:50:25 -0000 1.10.8.1 +++ squid3/src/client_db.cc 3 May 2007 13:37:05 -0000 1.10.8.2 @@ -1,6 +1,6 @@ /* - * $Id: client_db.cc,v 1.10.8.1 2007/05/01 12:50:25 amosjeffries Exp $ + * $Id: client_db.cc,v 1.10.8.2 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels @@ -80,7 +80,7 @@ if (client_table) return; - client_table = hash_create((HASHCMP *) strcmp, CLIENT_DB_HASH_SIZE, hash_string); + client_table = hash_create((HASHCMP *) std::strcmp, CLIENT_DB_HASH_SIZE, hash_string); } void Index: squid3/src/client_side_request.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side_request.cc,v retrieving revision 1.66.4.4 retrieving revision 1.66.4.5 diff -u -r1.66.4.4 -r1.66.4.5 --- squid3/src/client_side_request.cc 3 May 2007 10:05:12 -0000 1.66.4.4 +++ squid3/src/client_side_request.cc 3 May 2007 13:37:05 -0000 1.66.4.5 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.cc,v 1.66.4.4 2007/05/03 10:05:12 amosjeffries Exp $ + * $Id: client_side_request.cc,v 1.66.4.5 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -747,8 +747,8 @@ #if FORW_VIA_DB if (req_hdr->has(HDR_X_FORWARDED_FOR)) { - String s = req_hdr->getList(HDR_X_FORWARDED_FOR); - fvdbCountForw(s.buf()); + string s = req_hdr->getList(HDR_X_FORWARDED_FOR); + fvdbCountForw(s.c_str()); s.clear(); } Index: squid3/src/dns_internal.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/dns_internal.cc,v retrieving revision 1.38.2.1 retrieving revision 1.38.2.2 diff -u -r1.38.2.1 -r1.38.2.2 --- squid3/src/dns_internal.cc 1 May 2007 12:50:27 -0000 1.38.2.1 +++ squid3/src/dns_internal.cc 3 May 2007 13:37:05 -0000 1.38.2.2 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.38.2.1 2007/05/01 12:50:27 amosjeffries Exp $ + * $Id: dns_internal.cc,v 1.38.2.2 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -1238,7 +1238,7 @@ if (!init) { memDataInit(MEM_IDNS_QUERY, "idns_query", sizeof(idns_query), 0); memset(RcodeMatrix, '\0', sizeof(RcodeMatrix)); - idns_lookup_hash = hash_create((HASHCMP *) strcmp, 103, hash_string); + idns_lookup_hash = hash_create((HASHCMP *) std::strcmp, 103, hash_string); init++; } } Index: squid3/src/external_acl.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/external_acl.cc,v retrieving revision 1.52.4.4 retrieving revision 1.52.4.5 diff -u -r1.52.4.4 -r1.52.4.5 --- squid3/src/external_acl.cc 3 May 2007 10:05:12 -0000 1.52.4.4 +++ squid3/src/external_acl.cc 3 May 2007 13:37:05 -0000 1.52.4.5 @@ -1,6 +1,6 @@ /* - * $Id: external_acl.cc,v 1.52.4.4 2007/05/03 10:05:12 amosjeffries Exp $ + * $Id: external_acl.cc,v 1.52.4.5 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -1270,7 +1270,7 @@ for (p = Config.externalAclHelperList; p; p = p->next) { if (!p->cache) - p->cache = hash_create((HASHCMP *) strcmp, hashPrime(1024), hash4); + p->cache = hash_create((HASHCMP *) std::strcmp, hashPrime(1024), hash4); if (!p->theHelper) p->theHelper = helperCreate(p->name); Index: squid3/src/fqdncache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fqdncache.cc,v retrieving revision 1.18.8.1 retrieving revision 1.18.8.2 diff -u -r1.18.8.1 -r1.18.8.2 --- squid3/src/fqdncache.cc 1 May 2007 12:50:27 -0000 1.18.8.1 +++ squid3/src/fqdncache.cc 3 May 2007 13:37:05 -0000 1.18.8.2 @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.18.8.1 2007/05/01 12:50:27 amosjeffries Exp $ + * $Id: fqdncache.cc,v 1.18.8.2 2007/05/03 13:37:05 amosjeffries Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -527,7 +527,7 @@ n = hashPrime(fqdncache_high / 4); - fqdn_table = hash_create((HASHCMP *) strcmp, n, hash4); + fqdn_table = hash_create((HASHCMP *) std::strcmp, n, hash4); memDataInit(MEM_FQDNCACHE_ENTRY, "fqdncache_entry", sizeof(fqdncache_entry), 0); Index: squid3/src/ftp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ftp.cc,v retrieving revision 1.62.4.6 retrieving revision 1.62.4.7 diff -u -r1.62.4.6 -r1.62.4.7 --- squid3/src/ftp.cc 3 May 2007 10:05:12 -0000 1.62.4.6 +++ squid3/src/ftp.cc 3 May 2007 13:37:06 -0000 1.62.4.7 @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.62.4.6 2007/05/03 10:05:12 amosjeffries Exp $ + * $Id: ftp.cc,v 1.62.4.7 2007/05/03 13:37:06 amosjeffries Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1422,6 +1422,7 @@ FtpStateData::checkUrlpath() { int l; + const char *t; if ((t = request->urlpath.rpos(';')) != NULL) { if (strncasecmp(t + 1, "type=", 5) == 0) { Index: squid3/src/ident.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ident.cc,v retrieving revision 1.15.4.1 retrieving revision 1.15.4.2 diff -u -r1.15.4.1 -r1.15.4.2 --- squid3/src/ident.cc 1 May 2007 12:50:27 -0000 1.15.4.1 +++ squid3/src/ident.cc 3 May 2007 13:37:06 -0000 1.15.4.2 @@ -1,6 +1,6 @@ /* - * $Id: ident.cc,v 1.15.4.1 2007/05/01 12:50:27 amosjeffries Exp $ + * $Id: ident.cc,v 1.15.4.2 2007/05/03 13:37:06 amosjeffries Exp $ * * DEBUG: section 30 Ident (RFC 931) * AUTHOR: Duane Wessels @@ -270,7 +270,7 @@ void identInit(void) { - ident_hash = hash_create((HASHCMP *) strcmp, + ident_hash = hash_create((HASHCMP *) std::strcmp, hashPrime(Squid_MaxFD / 8), hash4); } Index: squid3/src/ipcache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipcache.cc,v retrieving revision 1.19.8.1 retrieving revision 1.19.8.2 diff -u -r1.19.8.1 -r1.19.8.2 --- squid3/src/ipcache.cc 1 May 2007 12:50:27 -0000 1.19.8.1 +++ squid3/src/ipcache.cc 3 May 2007 13:37:06 -0000 1.19.8.2 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.19.8.1 2007/05/01 12:50:27 amosjeffries Exp $ + * $Id: ipcache.cc,v 1.19.8.2 2007/05/03 13:37:06 amosjeffries Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -586,7 +586,7 @@ ipcache_low = (long) (((float) Config.ipcache.size * (float) Config.ipcache.low) / (float) 100); n = hashPrime(ipcache_high / 4); - ip_table = hash_create((HASHCMP *) strcmp, n, hash4); + ip_table = hash_create((HASHCMP *) std::strcmp, n, hash4); memDataInit(MEM_IPCACHE_ENTRY, "ipcache_entry", sizeof(ipcache_entry), 0); } Index: squid3/src/pconn.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/pconn.cc,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -u -r1.14.2.1 -r1.14.2.2 --- squid3/src/pconn.cc 1 May 2007 12:50:29 -0000 1.14.2.1 +++ squid3/src/pconn.cc 3 May 2007 13:37:06 -0000 1.14.2.2 @@ -1,6 +1,6 @@ /* - * $Id: pconn.cc,v 1.14.2.1 2007/05/01 12:50:29 amosjeffries Exp $ + * $Id: pconn.cc,v 1.14.2.2 2007/05/03 13:37:06 amosjeffries Exp $ * * DEBUG: section 48 Persistent Connections * AUTHOR: Duane Wessels @@ -217,7 +217,7 @@ PconnPool::PconnPool(const char *aDescr) : table(NULL), descr(aDescr) { int i; - table = hash_create((HASHCMP *) strcmp, 229, hash_string); + table = hash_create((HASHCMP *) std::strcmp, 229, hash_string); for (i = 0; i < PCONN_HIST_SZ; i++) hist[i] = 0; Index: squid3/src/DiskIO/AIO/AIODiskFile.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/DiskIO/AIO/AIODiskFile.h,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -u -r1.2 -r1.2.8.1 --- squid3/src/DiskIO/AIO/AIODiskFile.h 21 Aug 2006 01:51:50 -0000 1.2 +++ squid3/src/DiskIO/AIO/AIODiskFile.h 3 May 2007 13:37:07 -0000 1.2.8.1 @@ -1,6 +1,6 @@ /* - * $Id: AIODiskFile.h,v 1.2 2006/08/21 01:51:50 squidadm Exp $ + * $Id: AIODiskFile.h,v 1.2.8.1 2007/05/03 13:37:07 amosjeffries Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -70,7 +70,7 @@ CBDATA_CLASS(AIODiskFile); void error(bool const &); int fd; - String path; + string path; AIODiskIOStrategy *strategy; RefCount ioRequestor; bool closed; Index: squid3/src/ICAP/ICAPConfig.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPConfig.cc,v retrieving revision 1.12.4.1 retrieving revision 1.12.4.2 diff -u -r1.12.4.1 -r1.12.4.2 --- squid3/src/ICAP/ICAPConfig.cc 1 May 2007 12:50:31 -0000 1.12.4.1 +++ squid3/src/ICAP/ICAPConfig.cc 3 May 2007 13:37:07 -0000 1.12.4.2 @@ -1,6 +1,6 @@ /* - * $Id: ICAPConfig.cc,v 1.12.4.1 2007/05/01 12:50:31 amosjeffries Exp $ + * $Id: ICAPConfig.cc,v 1.12.4.2 2007/05/03 13:37:07 amosjeffries Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -48,7 +48,7 @@ ICAPConfig TheICAPConfig; ICAPServiceRep::Pointer -ICAPConfig::findService(const String& key) +ICAPConfig::findService(const string& key) { Vector::iterator iter = services.begin(); @@ -63,7 +63,7 @@ } ICAPClass * -ICAPConfig::findClass(const String& key) +ICAPConfig::findClass(const string& key) { if (!key.size()) return NULL; @@ -388,13 +388,13 @@ void ICAPConfig::parseICAPAccess(ConfigParser &parser) { - String aKey; + string aKey; ConfigParser::ParseString(&aKey); ICAPClass *theClass = TheICAPConfig.findClass(aKey); if (theClass == NULL) fatalf("Did not find ICAP class '%s' referenced on line %d\n", - aKey.buf(), config_lineno); + aKey.c_str(), config_lineno); aclParseAccessLine(parser, &theClass->accessList); }; Index: squid3/src/ICAP/ICAPConfig.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPConfig.h,v retrieving revision 1.9 retrieving revision 1.9.4.1 diff -u -r1.9 -r1.9.4.1 --- squid3/src/ICAP/ICAPConfig.h 6 Apr 2007 05:52:42 -0000 1.9 +++ squid3/src/ICAP/ICAPConfig.h 3 May 2007 13:37:07 -0000 1.9.4.1 @@ -1,6 +1,6 @@ /* - * $Id: ICAPConfig.h,v 1.9 2007/04/06 05:52:42 squidadm Exp $ + * $Id: ICAPConfig.h,v 1.9.4.1 2007/05/03 13:37:07 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -47,7 +47,7 @@ { public: - String key; + string key; acl_access *accessList; Vector services; @@ -73,8 +73,8 @@ ICAPAccessCheckCallback *callback; void *callback_data; ACLChecklist *acl_checklist; - Vector candidateClasses; - String matchedClass; + Vector candidateClasses; + string matchedClass; void do_callback(); ICAPServiceRep::Pointer findBestService(ICAPClass *c, bool preferUp); @@ -115,8 +115,8 @@ void parseICAPService(void); void freeICAPService(void); void dumpICAPService(StoreEntry *, const char *); - ICAPServiceRep::Pointer findService(const String&); - ICAPClass * findClass(const String& key); + ICAPServiceRep::Pointer findService(const string&); + ICAPClass * findClass(const string& key); void parseICAPClass(void); void freeICAPClass(void); Index: squid3/src/ICAP/ICAPModXact.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.cc,v retrieving revision 1.19.4.2 retrieving revision 1.19.4.3 diff -u -r1.19.4.2 -r1.19.4.3 --- squid3/src/ICAP/ICAPModXact.cc 1 May 2007 12:50:31 -0000 1.19.4.2 +++ squid3/src/ICAP/ICAPModXact.cc 3 May 2007 13:37:07 -0000 1.19.4.3 @@ -1011,7 +1011,7 @@ // to simplify, we could assume that request is always available - String urlPath; + string urlPath; if (request) { urlPath = request->urlpath; if (ICAP::methodRespmod == m) @@ -1097,7 +1097,7 @@ } // decides whether to offer a preview and calculates its size -bool ICAPModXact::shouldPreview(const String &urlPath) +bool ICAPModXact::shouldPreview(const string &urlPath) { if (!TheICAPConfig.preview_enable) { debugs(93, 5, HERE << "preview disabled by squid.conf"); Index: squid3/src/ICAP/ICAPOptions.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPOptions.cc,v retrieving revision 1.9 retrieving revision 1.9.4.1 diff -u -r1.9 -r1.9.4.1 --- squid3/src/ICAP/ICAPOptions.cc 6 Apr 2007 05:52:43 -0000 1.9 +++ squid3/src/ICAP/ICAPOptions.cc 3 May 2007 13:37:07 -0000 1.9.4.1 @@ -31,7 +31,7 @@ // future optimization note: this method is called by ICAP ACL code at least // twice for each HTTP message to see if the message should be ignored. For any // non-ignored HTTP message, ICAP calls to check whether a preview is needed. -ICAPOptions::TransferKind ICAPOptions::transferKind(const String &urlPath) const +ICAPOptions::TransferKind ICAPOptions::transferKind(const string &urlPath) const { if (theTransfers.preview.matches(urlPath)) return xferPreview; @@ -122,10 +122,10 @@ // TODO: HttpHeader should provide a general method for this type of conversion void ICAPOptions::cfgIntHeader(const HttpHeader *h, const char *fname, int &value) { - const String s = h->getByName(fname); + const string s = h->getByName(fname); - if (s.size() && xisdigit(*s.buf())) - value = atoi(s.buf()); + if (s.size() && xisdigit(*s.c_str())) + value = atoi(s.c_str()); else value = -1; @@ -134,7 +134,7 @@ void ICAPOptions::cfgTransferList(const HttpHeader *h, TransferList &list) { - const String buf = h->getByName(list.name); + const string buf = h->getByName(list.name); bool foundStar = false; list.parse(buf, foundStar); @@ -162,7 +162,7 @@ wordlistAdd(&extensions, extension); }; -bool ICAPOptions::TransferList::matches(const String &urlPath) const { +bool ICAPOptions::TransferList::matches(const string &urlPath) const { const int urlLen = urlPath.size(); for (wordlist *e = extensions; e; e = e->next) { // optimize: store extension lengths @@ -172,8 +172,8 @@ if (eLen < urlLen) { const int eOff = urlLen - eLen; // RFC 3507 examples imply that extensions come without leading '.' - if (urlPath.buf()[eOff-1] == '.' && - strcmp(urlPath.buf() + eOff, e->key) == 0) { + if (urlPath.c_str()[eOff-1] == '.' && + strcmp(urlPath.c_str() + eOff, e->key) == 0) { debugs(93,7, "ICAPOptions url " << urlPath << " matches " << name << " extension " << e->key); return true; @@ -184,7 +184,7 @@ return false; } -void ICAPOptions::TransferList::parse(const String &buf, bool &foundStar) { +void ICAPOptions::TransferList::parse(const string &buf, bool &foundStar) { foundStar = false; const char *item; Index: squid3/src/ICAP/ICAPOptions.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPOptions.h,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -u -r1.8 -r1.8.4.1 --- squid3/src/ICAP/ICAPOptions.h 6 Apr 2007 05:52:43 -0000 1.8 +++ squid3/src/ICAP/ICAPOptions.h 3 May 2007 13:37:07 -0000 1.8.4.1 @@ -1,6 +1,6 @@ /* - * $Id: ICAPOptions.h,v 1.8 2007/04/06 05:52:43 squidadm Exp $ + * $Id: ICAPOptions.h,v 1.8.4.1 2007/05/03 13:37:07 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -62,18 +62,18 @@ time_t timestamp() const { return theTimestamp; }; typedef enum { xferNone, xferPreview, xferIgnore, xferComplete } TransferKind; - TransferKind transferKind(const String &urlPath) const; + TransferKind transferKind(const string &urlPath) const; public: const char *error; // human-readable information; set iff !valid() // ICAP server MUST supply this info Vector methods; - String istag; + string istag; // ICAP server MAY supply this info. If not, Squid supplies defaults. - String service; - String serviceId; + string service; + string serviceId; int max_connections; bool allow204; int preview; @@ -86,9 +86,9 @@ TransferList(); ~TransferList(); - bool matches(const String &urlPath) const; + bool matches(const string &urlPath) const; - void parse(const String &buf, bool &foundStar); + void parse(const string &buf, bool &foundStar); void add(const char *extension); void report(int level, const char *prefix) const; Index: squid3/src/ICAP/ICAPServiceRep.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPServiceRep.cc,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -u -r1.7.4.2 -r1.7.4.3 --- squid3/src/ICAP/ICAPServiceRep.cc 1 May 2007 12:50:31 -0000 1.7.4.2 +++ squid3/src/ICAP/ICAPServiceRep.cc 3 May 2007 13:37:08 -0000 1.7.4.3 @@ -84,19 +84,19 @@ ConfigParser::ParseBool(&bypass); ConfigParser::ParseString(&uri); - debugs(3, 5, "ICAPService::parseConfigLine (line " << config_lineno << "): " << key.buf() << " " << service_type << " " << bypass); + debugs(3, 5, "ICAPService::parseConfigLine (line " << config_lineno << "): " << key << " " << service_type << " " << bypass); method = parseMethod(service_type); point = parseVectPoint(service_type); debugs(3, 5, "ICAPService::parseConfigLine (line " << config_lineno << "): service is " << methodStr() << "_" << vectPointStr()); - if (uri.cmp("icap://", 7) != 0) { - debugs(3, 0, "ICAPService::parseConfigLine (line " << config_lineno << "): wrong uri: " << uri.buf()); + if (uri.compare("icap://", 7) != 0) { + debugs(3, 0, "ICAPService::parseConfigLine (line " << config_lineno << "): wrong uri: " << uri); return false; } - const char *s = uri.buf() + 7; + const char *s = uri.c_str() + 7; const char *e; @@ -216,13 +216,13 @@ return probed() && !up(); } -bool ICAPServiceRep::wantsUrl(const String &urlPath) const +bool ICAPServiceRep::wantsUrl(const string &urlPath) const { Must(hasOptions()); return theOptions->transferKind(urlPath) != ICAPOptions::xferIgnore; } -bool ICAPServiceRep::wantsPreview(const String &urlPath, size_t &wantedSize) const +bool ICAPServiceRep::wantsPreview(const string &urlPath, size_t &wantedSize) const { Must(hasOptions()); @@ -360,7 +360,7 @@ if (!theOptions->methods.empty()) { bool method_found = false; - String method_list; + string method_list; Vector ::iterator iter = theOptions->methods.begin(); while (iter != theOptions->methods.end()) { @@ -378,8 +378,8 @@ if (!method_found) { debugs(93,1, "WARNING: Squid is configured to use ICAP method " << ICAP::methodStr(method) << - " for service " << uri.buf() << - " but OPTIONS response declares the methods are " << method_list.buf()); + " for service " << uri << + " but OPTIONS response declares the methods are " << method_list); } } @@ -392,7 +392,7 @@ // TODO: If skew is negative, the option will be considered down // because of stale options. We should probably change this. debugs(93, 1, "ICAP service's clock is skewed by " << skew << - " seconds: " << uri.buf()); + " seconds: " << uri); } } Index: squid3/src/ICAP/ICAPServiceRep.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPServiceRep.h,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -u -r1.6 -r1.6.4.1 --- squid3/src/ICAP/ICAPServiceRep.h 6 Apr 2007 05:52:44 -0000 1.6 +++ squid3/src/ICAP/ICAPServiceRep.h 3 May 2007 13:37:08 -0000 1.6.4.1 @@ -1,6 +1,6 @@ /* - * $Id: ICAPServiceRep.h,v 1.6 2007/04/06 05:52:44 squidadm Exp $ + * $Id: ICAPServiceRep.h,v 1.6.4.1 2007/05/03 13:37:08 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -91,22 +91,22 @@ void callWhenReady(Callback *cb, void *data); // the methods below can only be called on an up() service - bool wantsUrl(const String &urlPath) const; - bool wantsPreview(const String &urlPath, size_t &wantedSize) const; + bool wantsUrl(const string &urlPath) const; + bool wantsPreview(const string &urlPath, size_t &wantedSize) const; bool allows204() const; void noteFailure(); // called by transactions to report service failure public: - String key; + string key; ICAP::Method method; ICAP::VectPoint point; - String uri; // service URI + string uri; // service URI // URI components - String host; + string host; int port; - String resource; + string resource; // XXX: use it when selecting a service and handling ICAP errors! bool bypass; Index: squid3/src/auth/digest/auth_digest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/digest/auth_digest.cc,v retrieving revision 1.29.4.3 retrieving revision 1.29.4.4 diff -u -r1.29.4.3 -r1.29.4.4 --- squid3/src/auth/digest/auth_digest.cc 3 May 2007 10:05:14 -0000 1.29.4.3 +++ squid3/src/auth/digest/auth_digest.cc 3 May 2007 13:37:08 -0000 1.29.4.4 @@ -1,6 +1,6 @@ /* - * $Id: auth_digest.cc,v 1.29.4.3 2007/05/03 10:05:14 amosjeffries Exp $ + * $Id: auth_digest.cc,v 1.29.4.4 2007/05/03 13:37:08 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -204,7 +204,7 @@ digest_nonce_pool = memPoolCreate("Digest Scheme nonce's", sizeof(digest_nonce_h)); if (!digest_nonce_cache) { - digest_nonce_cache = hash_create((HASHCMP *) strcmp, 7921, hash_string); + digest_nonce_cache = hash_create((HASHCMP *) std::strcmp, 7921, hash_string); assert(digest_nonce_cache); eventAdd("Digest none cache maintenance", authenticateDigestNonceCacheCleanup, NULL, digestConfig.nonceGCInterval, 1); } Index: squid3/src/auth/negotiate/auth_negotiate.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/negotiate/auth_negotiate.cc,v retrieving revision 1.11.4.1 retrieving revision 1.11.4.2 diff -u -r1.11.4.1 -r1.11.4.2 --- squid3/src/auth/negotiate/auth_negotiate.cc 1 May 2007 12:50:31 -0000 1.11.4.1 +++ squid3/src/auth/negotiate/auth_negotiate.cc 3 May 2007 13:37:08 -0000 1.11.4.2 @@ -1,6 +1,6 @@ /* - * $Id: auth_negotiate.cc,v 1.11.4.1 2007/05/01 12:50:31 amosjeffries Exp $ + * $Id: auth_negotiate.cc,v 1.11.4.2 2007/05/03 13:37:08 amosjeffries Exp $ * * DEBUG: section 29 Negotiate Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -179,7 +179,7 @@ negotiateauthenticators = helperStatefulCreate("negotiateauthenticator"); if (!proxy_auth_cache) - proxy_auth_cache = hash_create((HASHCMP *) strcmp, 7921, hash_string); + proxy_auth_cache = hash_create((HASHCMP *) std::strcmp, 7921, hash_string); assert(proxy_auth_cache); Index: squid3/src/auth/ntlm/auth_ntlm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/ntlm/auth_ntlm.cc,v retrieving revision 1.33.4.1 retrieving revision 1.33.4.2 diff -u -r1.33.4.1 -r1.33.4.2 --- squid3/src/auth/ntlm/auth_ntlm.cc 1 May 2007 12:50:31 -0000 1.33.4.1 +++ squid3/src/auth/ntlm/auth_ntlm.cc 3 May 2007 13:37:08 -0000 1.33.4.2 @@ -1,6 +1,6 @@ /* - * $Id: auth_ntlm.cc,v 1.33.4.1 2007/05/01 12:50:31 amosjeffries Exp $ + * $Id: auth_ntlm.cc,v 1.33.4.2 2007/05/03 13:37:08 amosjeffries Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -180,7 +180,7 @@ ntlmauthenticators = helperStatefulCreate("ntlmauthenticator"); if (!proxy_auth_cache) - proxy_auth_cache = hash_create((HASHCMP *) strcmp, 7921, hash_string); + proxy_auth_cache = hash_create((HASHCMP *) std::strcmp, 7921, hash_string); assert(proxy_auth_cache); Index: squid3/src/fs/coss/store_dir_coss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_dir_coss.cc,v retrieving revision 1.30.4.2 retrieving revision 1.30.4.3 diff -u -r1.30.4.2 -r1.30.4.3 --- squid3/src/fs/coss/store_dir_coss.cc 1 May 2007 12:50:32 -0000 1.30.4.2 +++ squid3/src/fs/coss/store_dir_coss.cc 3 May 2007 13:37:08 -0000 1.30.4.3 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.30.4.2 2007/05/01 12:50:32 amosjeffries Exp $ + * $Id: store_dir_coss.cc,v 1.30.4.3 2007/05/03 13:37:08 amosjeffries Exp $ * vim: set et : * * DEBUG: section 47 Store COSS Directory Routines @@ -1170,7 +1170,7 @@ } StoreSearch * -CossSwapDir::search(String const url, HttpRequest *) +CossSwapDir::search(string const url, HttpRequest *) { if (url.size()) fatal ("Cannot search by url yet\n"); @@ -1182,9 +1182,9 @@ CossSwapDir::stripePath() const { if (!stripe_path) { - String result = path; + string result = path; result.append("/stripe"); - const_cast(this)->stripe_path = xstrdup(result.buf()); + const_cast(this)->stripe_path = xstrdup(result.c_str()); } return stripe_path; Index: squid3/src/tests/TestSwapDir.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/TestSwapDir.cc,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -u -r1.3 -r1.3.8.1 --- squid3/src/tests/TestSwapDir.cc 27 May 2006 00:50:33 -0000 1.3 +++ squid3/src/tests/TestSwapDir.cc 3 May 2007 13:37:09 -0000 1.3.8.1 @@ -46,7 +46,7 @@ {} StoreSearch * -TestSwapDir::search(String, HttpRequest *) +TestSwapDir::search(string, HttpRequest *) { return NULL; } Index: squid3/src/tests/TestSwapDir.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/TestSwapDir.h,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -u -r1.4 -r1.4.8.1 --- squid3/src/tests/TestSwapDir.h 27 May 2006 00:50:33 -0000 1.4 +++ squid3/src/tests/TestSwapDir.h 3 May 2007 13:37:09 -0000 1.4.8.1 @@ -21,7 +21,7 @@ virtual StoreIOState::Pointer createStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *); virtual StoreIOState::Pointer openStoreIO(StoreEntry &, StoreIOState::STFNCB *, StoreIOState::STIOCB *, void *); virtual void parse(int, char*); - virtual StoreSearch *search(String, HttpRequest *); + virtual StoreSearch *search(string, HttpRequest *); }; typedef RefCount TestSwapDirPointer; Index: squid3/src/tests/testHttpRequest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testHttpRequest.cc,v retrieving revision 1.1 retrieving revision 1.1.18.1 diff -u -r1.1 -r1.1.18.1 --- squid3/src/tests/testHttpRequest.cc 3 May 2006 14:50:43 -0000 1.1 +++ squid3/src/tests/testHttpRequest.cc 3 May 2007 13:37:09 -0000 1.1.18.1 @@ -38,10 +38,10 @@ HttpRequest *nullRequest = NULL; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); - CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); + CPPUNIT_ASSERT_EQUAL((string)"foo", (string)aRequest->host); + CPPUNIT_ASSERT_EQUAL((string)"/bar", aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); - CPPUNIT_ASSERT_EQUAL(String("http://foo:90/bar"), String(url)); + CPPUNIT_ASSERT_EQUAL((string)"http://foo:90/bar", (string)url); xfree(url); /* vanilla url, different method */ url = xstrdup("http://foo/bar"); @@ -49,10 +49,10 @@ expected_port = 80; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_PUT, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); - CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); + CPPUNIT_ASSERT_EQUAL((string)"foo", (string)aRequest->host); + CPPUNIT_ASSERT_EQUAL((string)"/bar", aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); - CPPUNIT_ASSERT_EQUAL(String("http://foo/bar"), String(url)); + CPPUNIT_ASSERT_EQUAL((string)"http://foo/bar", (string)url); /* a connect url with non-CONNECT data */ url = xstrdup(":foo/bar"); aRequest = HttpRequest::CreateFromUrlAndMethod(url, METHOD_CONNECT); @@ -64,10 +64,10 @@ expected_port = 45; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_CONNECT, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); - CPPUNIT_ASSERT_EQUAL(String(""), aRequest->urlpath); + CPPUNIT_ASSERT_EQUAL((string)"foo", (string)aRequest->host); + CPPUNIT_ASSERT_EQUAL((string)"", aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_NONE, aRequest->protocol); - CPPUNIT_ASSERT_EQUAL(String("foo:45"), String(url)); + CPPUNIT_ASSERT_EQUAL((string)"foo:45", (string)url); xfree(url); } @@ -84,9 +84,9 @@ expected_port = 90; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); - CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->host)); - CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); + CPPUNIT_ASSERT_EQUAL((string)"foo", (string)aRequest->host); + CPPUNIT_ASSERT_EQUAL((string)"/bar", aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); - CPPUNIT_ASSERT_EQUAL(String("http://foo:90/bar"), String(url)); + CPPUNIT_ASSERT_EQUAL((string)"http://foo:90/bar", (string)url); xfree(url); } Index: squid3/src/tests/testHttpRequestMethod.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testHttpRequestMethod.cc,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -u -r1.2 -r1.2.8.1 --- squid3/src/tests/testHttpRequestMethod.cc 2 Sep 2006 04:50:30 -0000 1.2 +++ squid3/src/tests/testHttpRequestMethod.cc 3 May 2007 13:37:09 -0000 1.2.8.1 @@ -79,7 +79,7 @@ void testHttpRequestMethod::testConst_str() { - CPPUNIT_ASSERT_EQUAL(String("POST"), String(HttpRequestMethod("post").const_str())); + CPPUNIT_ASSERT_EQUAL((string)"POST", (string)HttpRequestMethod("post").const_str()); } /* @@ -115,5 +115,5 @@ { std::ostringstream buffer; buffer << HttpRequestMethod("get"); - CPPUNIT_ASSERT_EQUAL(String("GET"), String(buffer.str().c_str())); + CPPUNIT_ASSERT_EQUAL((string)"GET", (string)buffer.str().c_str() ); } Index: squid3/src/tests/testStore.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testStore.cc,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -u -r1.4 -r1.4.8.1 --- squid3/src/tests/testStore.cc 3 May 2006 14:50:43 -0000 1.4 +++ squid3/src/tests/testStore.cc 3 May 2007 13:37:09 -0000 1.4.8.1 @@ -21,7 +21,7 @@ void TestStore::get - (String, void (*)(StoreEntry*, void*), void*) + (string, void (*)(StoreEntry*, void*), void*) {} void @@ -48,7 +48,7 @@ } StoreSearch * -TestStore::search(String const url, HttpRequest *) +TestStore::search(string const url, HttpRequest *) { return NULL; } Index: squid3/src/tests/testStore.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testStore.h,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -u -r1.2 -r1.2.8.1 --- squid3/src/tests/testStore.h 3 May 2006 14:50:43 -0000 1.2 +++ squid3/src/tests/testStore.h 3 May 2007 13:37:09 -0000 1.2.8.1 @@ -49,7 +49,7 @@ (const cache_key*); virtual void get - (String, void (*)(StoreEntry*, void*), void*); + (string, void (*)(StoreEntry*, void*), void*); virtual void init(); @@ -67,7 +67,7 @@ virtual void updateSize(size_t size, int sign) {} - virtual StoreSearch *search(String const url, HttpRequest *); + virtual StoreSearch *search(string const url, HttpRequest *); }; typedef RefCount TestStorePointer; Index: squid3/src/tests/testStoreController.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testStoreController.cc,v retrieving revision 1.4.8.1 retrieving revision 1.4.8.2 diff -u -r1.4.8.1 -r1.4.8.2 --- squid3/src/tests/testStoreController.cc 22 Apr 2007 09:56:57 -0000 1.4.8.1 +++ squid3/src/tests/testStoreController.cc 3 May 2007 13:37:09 -0000 1.4.8.2 @@ -78,10 +78,9 @@ static StoreEntry * addedEntry(StorePointer hashStore, StorePointer aStore, - String name, - String varySpec, - String varyKey - + string name, + string varySpec, + string varyKey ) { StoreEntry *e = new StoreEntry(); @@ -109,7 +108,7 @@ EBIT_CLR(e->flags, KEY_PRIVATE); e->ping_status = PING_NONE; EBIT_CLR(e->flags, ENTRY_VALIDATED); - e->hashInsert((const cache_key *)name.buf()); /* do it after we clear KEY_PRIVATE */ + e->hashInsert((const cache_key *)name.c_str()); /* do it after we clear KEY_PRIVATE */ return e; } Index: squid3/src/tests/testStoreEntryStream.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testStoreEntryStream.cc,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -u -r1.2 -r1.2.12.1 --- squid3/src/tests/testStoreEntryStream.cc 7 Aug 2006 02:51:16 -0000 1.2 +++ squid3/src/tests/testStoreEntryStream.cc 3 May 2007 13:37:09 -0000 1.2.12.1 @@ -39,7 +39,7 @@ stream.flush(); CPPUNIT_ASSERT_EQUAL(1, anEntry->_buffer_calls); CPPUNIT_ASSERT_EQUAL(1, anEntry->_flush_calls); - CPPUNIT_ASSERT_EQUAL(String("some text !"), anEntry->_appended_text); + CPPUNIT_ASSERT_EQUAL((string)"some text !", anEntry->_appended_text); } delete anEntry; Index: squid3/src/tests/testStoreHashIndex.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testStoreHashIndex.cc,v retrieving revision 1.3.8.1 retrieving revision 1.3.8.2 diff -u -r1.3.8.1 -r1.3.8.2 --- squid3/src/tests/testStoreHashIndex.cc 22 Apr 2007 09:56:57 -0000 1.3.8.1 +++ squid3/src/tests/testStoreHashIndex.cc 3 May 2007 13:37:09 -0000 1.3.8.2 @@ -59,9 +59,9 @@ StoreEntry * addedEntry(StorePointer hashStore, StorePointer aStore, - String name, - String varySpec, - String varyKey + string name, + string varySpec, + string varyKey ) { @@ -90,7 +90,7 @@ EBIT_CLR(e->flags, KEY_PRIVATE); e->ping_status = PING_NONE; EBIT_CLR(e->flags, ENTRY_VALIDATED); - e->hashInsert((const cache_key *)name.buf()); /* do it after we clear KEY_PRIVATE */ + e->hashInsert((const cache_key *)name.c_str()); /* do it after we clear KEY_PRIVATE */ return e; } Index: squid3/src/tests/testString.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testString.cc,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -u -r1.2 -r1.2.12.1 --- squid3/src/tests/testString.cc 7 Aug 2006 02:51:16 -0000 1.2 +++ squid3/src/tests/testString.cc 3 May 2007 13:37:09 -0000 1.2.12.1 @@ -23,39 +23,39 @@ void testString::testCmpDefault() { - String left, right; + string left, right; /* two default strings are equal */ - CPPUNIT_ASSERT(!left.cmp(right)); - CPPUNIT_ASSERT(!left.cmp(NULL)); - CPPUNIT_ASSERT(!left.cmp(NULL, 1)); + CPPUNIT_ASSERT(!left.compare(right)); + CPPUNIT_ASSERT(!left.compare(NULL)); + CPPUNIT_ASSERT(!left.compare(NULL, 1)); } void testString::testCmpEmptyString() { - String left(""); - String right; + string left(""); + string right; /* an empty string ("") is equal to a default string */ - CPPUNIT_ASSERT(!left.cmp(right)); - CPPUNIT_ASSERT(!left.cmp(NULL)); - CPPUNIT_ASSERT(!left.cmp(NULL, 1)); + CPPUNIT_ASSERT(!left.compare(right)); + CPPUNIT_ASSERT(!left.compare(NULL)); + CPPUNIT_ASSERT(!left.compare(NULL, 1)); /* reverse the order to catch corners */ - CPPUNIT_ASSERT(!right.cmp(left)); - CPPUNIT_ASSERT(!right.cmp("")); - CPPUNIT_ASSERT(!right.cmp("", 1)); + CPPUNIT_ASSERT(!right.compare(left)); + CPPUNIT_ASSERT(!right.compare("")); + CPPUNIT_ASSERT(!right.compare("", 1)); } void testString::testCmpNotEmptyDefault() { - String left("foo"); - String right; + string left("foo"); + string right; /* empty string sorts before everything */ - CPPUNIT_ASSERT(left.cmp(right) > 0); - CPPUNIT_ASSERT(left.cmp(NULL) > 0); - CPPUNIT_ASSERT(left.cmp(NULL, 1) > 0); + CPPUNIT_ASSERT(left.compare(right) > 0); + CPPUNIT_ASSERT(left.compare(NULL) > 0); + CPPUNIT_ASSERT(left.compare(NULL, 1) > 0); /* reverse for symmetry tests */ - CPPUNIT_ASSERT(right.cmp(left) < 0); - CPPUNIT_ASSERT(right.cmp("foo") < 0); - CPPUNIT_ASSERT(right.cmp("foo", 1) < 0); + CPPUNIT_ASSERT(right.compare(left) < 0); + CPPUNIT_ASSERT(right.compare("foo") < 0); + CPPUNIT_ASSERT(right.compare("foo", 1) < 0); } Index: squid3/src/tests/testURLScheme.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/testURLScheme.cc,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -u -r1.2 -r1.2.8.1 --- squid3/src/tests/testURLScheme.cc 2 Sep 2006 04:50:30 -0000 1.2 +++ squid3/src/tests/testURLScheme.cc 3 May 2007 13:37:09 -0000 1.2.8.1 @@ -104,9 +104,9 @@ void testURLScheme::testConst_str() { - String lhs("wais"); + string lhs("wais"); URLScheme wais(PROTO_WAIS); - String rhs(wais.const_str()); + string rhs(wais.const_str()); CPPUNIT_ASSERT_EQUAL(lhs, rhs); } @@ -143,7 +143,7 @@ { std::ostringstream buffer; buffer << URLScheme(PROTO_HTTP); - String http_str("http"); - String from_buf(buffer.str().c_str()); + string http_str("http"); + string from_buf(buffer.str().c_str()); CPPUNIT_ASSERT_EQUAL(http_str, from_buf); } Index: squid3/src/tests/test_http_range.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/test_http_range.cc,v retrieving revision 1.1 retrieving revision 1.1.16.1 diff -u -r1.1 -r1.1.16.1 --- squid3/src/tests/test_http_range.cc 21 May 2006 14:50:42 -0000 1.1 +++ squid3/src/tests/test_http_range.cc 3 May 2007 13:37:09 -0000 1.1.16.1 @@ -1,6 +1,6 @@ /* - * $Id: test_http_range.cc,v 1.1 2006/05/21 14:50:42 squidadm Exp $ + * $Id: test_http_range.cc,v 1.1.16.1 2007/05/03 13:37:09 amosjeffries Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -56,10 +56,10 @@ return NULL; } -extern String httpHeaderGetList(const HttpHeader * hdr, http_hdr_type id) +extern string httpHeaderGetList(const HttpHeader * hdr, http_hdr_type id) { fatal ("dummy function\n"); - return String(); + return ""; } SQUIDCEXTERN int httpHeaderHas(const HttpHeader * hdr, http_hdr_type type) @@ -76,7 +76,7 @@ void testRangeParser(char const *rangestring) { - String aString (rangestring); + string aString (rangestring); HttpHdrRange *range = HttpHdrRange::ParseCreate (&aString); if (!range) @@ -96,7 +96,7 @@ HttpHdrRange * rangeFromString(char const *rangestring) { - String aString (rangestring); + string aString (rangestring); HttpHdrRange *range = HttpHdrRange::ParseCreate (&aString); if (!range)