--------------------- PatchSet 6810 Date: 2008/02/12 02:15:19 Author: amosjeffries Branch: cleanup Tag: (none) Log: typedefs.h cleanup pt 1 - moves some typedefs to .h files where they are better provided - removes some unused typedefs entirely - removes class pre-definitions from file unless required by it - migrate code from auth_user_t typedef to AuthUser class - migrate some auth_use_hash_pointer typedefs to AuthUserHashPointer - updates code documentation where encountered - (includes some string fixes already in HEAD for compiling purposes) Members: NOTES-cleanup:1.1->1.1.2.1 doc/Programming-Guide/prog-guide.sgml:1.10->1.10.38.1 src/ACL.h:1.19->1.19.10.1 src/AuthUser.cc:1.10->1.10.4.1 src/AuthUser.h:1.6->1.6.4.1 src/AuthUserRequest.cc:1.20->1.20.4.1 src/AuthUserRequest.h:1.9->1.9.4.1 src/SquidString.h:1.15->1.15.2.1 src/Store.h:1.41->1.41.4.1 src/StoreFileSystem.h:1.2->1.2.38.1 src/String.cci:1.11->1.11.4.1 src/acl_noncore.cc:1.6->1.6.10.1 src/authenticate.cc:1.21->1.21.26.1 src/authenticate.h:1.14->1.14.38.1 src/globals.h:1.33->1.33.4.1 src/protos.h:1.95->1.95.2.1 src/structs.h:1.127->1.127.2.1 src/typedefs.h:1.47->1.47.4.1 src/auth/basic/auth_basic.cc:1.28->1.28.10.1 src/auth/digest/auth_digest.cc:1.41->1.41.4.1 src/auth/digest/auth_digest.h:1.15->1.15.4.1 src/auth/negotiate/auth_negotiate.cc:1.26->1.26.4.1 src/auth/ntlm/auth_ntlm.cc:1.48->1.48.4.1 --- /dev/null Wed Feb 13 01:23:14 2008 +++ squid3/NOTES-cleanup Wed Feb 13 01:23:14 2008 @@ -0,0 +1,38 @@ + +TODO List for the cleanup branch operations. + + +* Fix Broken Unit-test for COSS + + stub time| COSS block-size = 512 bytes + stub time| COSS largest file offset = -1 KB + stub time| COSS cache_dir size = 102400 KB + stub time| Fatal: COSS cache_dir size exceeds largest offset + .FAIL: tests/testCoss + ================================================= + 1 of 16 tests failed + + +* Obsolete typedefs.h + - remove all unneeded typedefs + - move all needed typedefs to their appropriate headers + - fix all resulting compile errors + +* Add automatic testing for header dependency + - script to perform universal include unit-test for .h files + - link to automatic unit-testing in each directory + - fix all resulting compile errors! + +* Obsolete protos.h + - move all protos to their appropriate header files + - add includes for headers where needed. + +* Obsolete structs.h + - move all structs to their appropriate header files + - move modular configuration in to *Config.h files + (discussion on exactly what the modules are) + +* Auto-doc the API for modules decided above + +* Move files into appropriate sub-dirs based on modules + Index: squid3/doc/Programming-Guide/prog-guide.sgml =================================================================== RCS file: /cvsroot/squid-sf//squid3/doc/Programming-Guide/prog-guide.sgml,v retrieving revision 1.10 retrieving revision 1.10.38.1 diff -u -r1.10 -r1.10.38.1 --- squid3/doc/Programming-Guide/prog-guide.sgml 20 May 2006 13:36:41 -0000 1.10 +++ squid3/doc/Programming-Guide/prog-guide.sgml 12 Feb 2008 02:15:19 -0000 1.10.38.1 @@ -2,7 +2,7 @@
Squid Programmers Guide Squid Developers -$Id: prog-guide.sgml,v 1.10 2006/05/20 13:36:41 squidadm Exp $ +$Id: prog-guide.sgml,v 1.10.38.1 2008/02/12 02:15:19 amosjeffries Exp $ Squid is a WWW Cache application developed by the National Laboratory @@ -2442,7 +2442,7 @@ the scheme_data pointer to NULL. Failure to unlink the scheme data will result in squid dying. - Squid does not make assumptions about where the username is stored. This function must return a pointer to a NULL @@ -2516,10 +2516,10 @@ match the request, the authentication credentials in the request are ignored - and all auth modules are called. - These functions are responsible for freeing scheme specific data from - the passed auth_user_t structure. This should only be called by squid + the passed AuthUser class. This should only be called by squid when there are no outstanding requests linked to the auth user. This includes removing the user from any scheme specific memory caches. @@ -2563,7 +2563,7 @@ /* first two items must be same as hash_link */ char *key; auth_user_hash_pointer *next; - auth_user_t *auth_user; + AuthUser *auth_user; dlink_node link; /* other hash entries that point to the same auth_user */ }; Index: squid3/src/ACL.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ACL.h,v retrieving revision 1.19 retrieving revision 1.19.10.1 diff -u -r1.19 -r1.19.10.1 --- squid3/src/ACL.h 1 Sep 2007 06:51:11 -0000 1.19 +++ squid3/src/ACL.h 12 Feb 2008 02:15:19 -0000 1.19.10.1 @@ -1,6 +1,6 @@ /* - * $Id: ACL.h,v 1.19 2007/09/01 06:51:11 squidadm Exp $ + * $Id: ACL.h,v 1.19.10.1 2008/02/12 02:15:19 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -54,9 +54,9 @@ SQUIDCEXTERN int aclIsProxyAuth(const char *name); SQUIDCEXTERN err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_allowed); -SQUIDCEXTERN void aclParseDenyInfoLine(struct _acl_deny_info_list **); +SQUIDCEXTERN void aclParseDenyInfoLine(struct acl_deny_info_list **); -SQUIDCEXTERN void aclDestroyDenyInfoList(struct _acl_deny_info_list **); +SQUIDCEXTERN void aclDestroyDenyInfoList(struct acl_deny_info_list **); SQUIDCEXTERN wordlist *aclDumpGeneric(const ACL *); SQUIDCEXTERN void aclCacheMatchFlush(dlink_list * cache); extern void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head); Index: squid3/src/AuthUser.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AuthUser.cc,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -u -r1.10 -r1.10.4.1 --- squid3/src/AuthUser.cc 14 Dec 2007 23:50:57 -0000 1.10 +++ squid3/src/AuthUser.cc 12 Feb 2008 02:15:20 -0000 1.10.4.1 @@ -1,6 +1,6 @@ /* - * $Id: AuthUser.cc,v 1.10 2007/12/14 23:50:57 squidadm Exp $ + * $Id: AuthUser.cc,v 1.10.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -157,7 +157,7 @@ * This must complete all at once, because we are ensuring correctness. */ AuthUserHashPointer *usernamehash; - auth_user_t *auth_user; + AuthUser *auth_user; char const *username = NULL; debugs(29, 3, "AuthUser::CachedACLsReset: Flushing the ACL caches for all users."); hash_first(proxy_auth_username_cache); @@ -182,7 +182,7 @@ * entries at a time. Lets see how it flys first. */ AuthUserHashPointer *usernamehash; - auth_user_t *auth_user; + AuthUser *auth_user; char const *username = NULL; debugs(29, 3, "AuthUser::cacheCleanup: Cleaning the user cache now"); debugs(29, 3, "AuthUser::cacheCleanup: Current time: " << current_time.tv_sec); Index: squid3/src/AuthUser.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AuthUser.h,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -u -r1.6 -r1.6.4.1 --- squid3/src/AuthUser.h 14 Dec 2007 23:50:57 -0000 1.6 +++ squid3/src/AuthUser.h 12 Feb 2008 02:15:20 -0000 1.6.4.1 @@ -1,6 +1,5 @@ - /* - * $Id: AuthUser.h,v 1.6 2007/12/14 23:50:57 squidadm Exp $ + * $Id: AuthUser.h,v 1.6.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -64,11 +63,11 @@ * but how many requests will a single username have in parallel? */ dlink_list requests; - static void cacheInit (); + static void cacheInit(); static void CachedACLsReset(); - void absorb(auth_user_t *from); - virtual ~AuthUser (); + void absorb(AuthUser *from); + virtual ~AuthUser(); _SQUID_INLINE_ char const *username() const; _SQUID_INLINE_ void username(char const *); void clearIp(); @@ -76,9 +75,7 @@ void addIp(IPAddress); _SQUID_INLINE_ void addRequest(AuthUserRequest *); - void lock() - - ; + void lock(); void unlock(); void addToNameCache(); Index: squid3/src/AuthUserRequest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AuthUserRequest.cc,v retrieving revision 1.20 retrieving revision 1.20.4.1 diff -u -r1.20 -r1.20.4.1 --- squid3/src/AuthUserRequest.cc 14 Dec 2007 23:50:57 -0000 1.20 +++ squid3/src/AuthUserRequest.cc 12 Feb 2008 02:15:20 -0000 1.20.4.1 @@ -1,6 +1,6 @@ /* - * $Id: AuthUserRequest.cc,v 1.20 2007/12/14 23:50:57 squidadm Exp $ + * $Id: AuthUserRequest.cc,v 1.20.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DO NOT MODIFY NEXT 2 LINES: * arch-tag: 6803fde1-d5a2-4c29-9034-1c0c9f650eb4 @@ -202,7 +202,7 @@ static void authenticateAuthUserRequestSetIp(AuthUserRequest * auth_user_request, IPAddress &ipaddr) { - auth_user_t *auth_user = auth_user_request->user(); + AuthUser *auth_user = auth_user_request->user(); if (!auth_user) return; @@ -213,7 +213,7 @@ void authenticateAuthUserRequestRemoveIp(AuthUserRequest * auth_user_request, IPAddress const &ipaddr) { - auth_user_t *auth_user = auth_user_request->user(); + AuthUser *auth_user = auth_user_request->user(); if (!auth_user) return; @@ -328,7 +328,6 @@ * Caller is responsible for locking and unlocking their *auth_user_request! */ auth_acl_t - AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, IPAddress &src_addr) { const char *proxy_auth; Index: squid3/src/AuthUserRequest.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AuthUserRequest.h,v retrieving revision 1.9 retrieving revision 1.9.4.1 diff -u -r1.9 -r1.9.4.1 --- squid3/src/AuthUserRequest.h 14 Dec 2007 23:50:57 -0000 1.9 +++ squid3/src/AuthUserRequest.h 12 Feb 2008 02:15:20 -0000 1.9.4.1 @@ -1,6 +1,6 @@ /* - * $Id: AuthUserRequest.h,v 1.9 2007/12/14 23:50:57 squidadm Exp $ + * $Id: AuthUserRequest.h,v 1.9.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DO NOT MODIFY NEXT 2 LINES: * arch-tag: 674533af-8b21-4641-b71a-74c4639072a0 @@ -60,7 +60,7 @@ /* this is the object passed around by client_side and acl functions */ /* it has request specific data, and links to user specific data */ /* the user */ - auth_user_t *_auth_user; + AuthUser *_auth_user; int direction(); virtual int authenticated() const = 0; @@ -76,7 +76,7 @@ virtual const AuthUser *user() const {return _auth_user;} - virtual void user (AuthUser *aUser) {_auth_user=aUser;} + virtual void user(AuthUser *aUser) {_auth_user=aUser;} static auth_acl_t tryToAuthenticateAndSetAuthUser(AuthUserRequest **, http_hdr_type, HttpRequest *, ConnStateData::Pointer, IPAddress &); static void addReplyAuthHeader(HttpReply * rep, AuthUserRequest * auth_user_request, HttpRequest * request, int accelerated, int internal); @@ -84,18 +84,18 @@ AuthUserRequest(); virtual ~AuthUserRequest(); - void *operator new (size_t byteCount); - void operator delete (void *address); + void *operator new(size_t byteCount); + void operator delete(void *address); - void start ( RH * handler, void *data); - char const * denyMessage (char const * const default_message = NULL); + void start( RH * handler, void *data); + char const * denyMessage(char const * const default_message = NULL); /* these two are possibly overrideable in future */ - void setDenyMessage (char const *); - char const * getDenyMessage (); + void setDenyMessage(char const *); + char const * getDenyMessage(); size_t refCount() const; - void _lock (); // please use AUTHUSERREQUESTLOCK() - void _unlock (); // please use AUTHUSERREQUESTUNLOCK() + void _lock(); // please use AUTHUSERREQUESTLOCK() + void _unlock(); // please use AUTHUSERREQUESTUNLOCK() char const *username() const; Index: squid3/src/SquidString.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SquidString.h,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -r1.15 -r1.15.2.1 --- squid3/src/SquidString.h 23 Jan 2008 23:50:30 -0000 1.15 +++ squid3/src/SquidString.h 12 Feb 2008 02:15:20 -0000 1.15.2.1 @@ -1,5 +1,5 @@ /* - * $Id: SquidString.h,v 1.15 2008/01/23 23:50:30 squidadm Exp $ + * $Id: SquidString.h,v 1.15.2.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DEBUG: section 67 String * AUTHOR: Duane Wessels @@ -35,6 +35,7 @@ #ifndef SQUID_STRING_H #define SQUID_STRING_H +#include "config.h" /* forward decls */ Index: squid3/src/Store.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Store.h,v retrieving revision 1.41 retrieving revision 1.41.4.1 diff -u -r1.41 -r1.41.4.1 --- squid3/src/Store.h 20 Jan 2008 09:50:56 -0000 1.41 +++ squid3/src/Store.h 12 Feb 2008 02:15:20 -0000 1.41.4.1 @@ -1,6 +1,6 @@ /* - * $Id: Store.h,v 1.41 2008/01/20 09:50:56 squidadm Exp $ + * $Id: Store.h,v 1.41.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -36,6 +36,7 @@ #include "squid.h" +/// \todo configure checks to wrap this properly ?? #include #include "StoreIOBuffer.h" @@ -57,6 +58,8 @@ class StoreSearch; +typedef unsigned int ping_status_t; + class StoreEntry : public hash_link { @@ -321,6 +324,7 @@ #endif SQUIDCEXTERN void storeAppendVPrintf(StoreEntry *, const char *, va_list ap); SQUIDCEXTERN int storeTooManyDiskFilesOpen(void); +class SwapDir; SQUIDCEXTERN void storeHeapPositionUpdate(StoreEntry *, SwapDir *); SQUIDCEXTERN void storeSwapFileNumberSet(StoreEntry * e, sfileno filn); SQUIDCEXTERN void storeFsInit(void); Index: squid3/src/StoreFileSystem.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/StoreFileSystem.h,v retrieving revision 1.2 retrieving revision 1.2.38.1 diff -u -r1.2 -r1.2.38.1 --- squid3/src/StoreFileSystem.h 29 May 2006 00:50:18 -0000 1.2 +++ squid3/src/StoreFileSystem.h 12 Feb 2008 02:15:20 -0000 1.2.38.1 @@ -1,6 +1,6 @@ /* - * $Id: StoreFileSystem.h,v 1.2 2006/05/29 00:50:18 squidadm Exp $ + * $Id: StoreFileSystem.h,v 1.2.38.1 2008/02/12 02:15:20 amosjeffries Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -41,6 +41,8 @@ class CacheManager; +class SwapDir; + class StoreFileSystem { @@ -52,7 +54,7 @@ static Vector const &FileSystems(); typedef Vector::iterator iterator; typedef Vector::const_iterator const_iterator; - StoreFileSystem() : initialised (false) {} + StoreFileSystem() : initialised(false) {} virtual ~StoreFileSystem(){} Index: squid3/src/String.cci =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/String.cci,v retrieving revision 1.11 retrieving revision 1.11.4.1 diff -u -r1.11 -r1.11.4.1 --- squid3/src/String.cci 19 Jan 2008 10:50:37 -0000 1.11 +++ squid3/src/String.cci 12 Feb 2008 02:15:20 -0000 1.11.4.1 @@ -1,5 +1,5 @@ /* - * $Id: String.cci,v 1.11 2008/01/19 10:50:37 squidadm Exp $ + * $Id: String.cci,v 1.11.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DEBUG: section 67 String * AUTHOR: Duane Wessels @@ -32,6 +32,8 @@ * */ +#include "assert.h" + String::String() : size_(0), len_(0), buf_ (NULL) { #if DEBUGSTRINGS @@ -157,6 +159,10 @@ if(newLength < 0 || newLength > len_) return; len_ = newLength; + + // buf_ may be NULL on zero-length strings. + if(len_ == 0 && buf_ == NULL) return; + buf_[newLength] = '\0'; } Index: squid3/src/acl_noncore.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/acl_noncore.cc,v retrieving revision 1.6 retrieving revision 1.6.10.1 diff -u -r1.6 -r1.6.10.1 --- squid3/src/acl_noncore.cc 1 Sep 2007 06:51:11 -0000 1.6 +++ squid3/src/acl_noncore.cc 12 Feb 2008 02:15:20 -0000 1.6.10.1 @@ -1,5 +1,5 @@ /* - * $Id: acl_noncore.cc,v 1.6 2007/09/01 06:51:11 squidadm Exp $ + * $Id: acl_noncore.cc,v 1.6.10.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -285,7 +285,7 @@ } /* maex@space.net (06.09.1996) - * destroy an _acl_deny_info_list */ + * destroy an acl_deny_info_list */ void aclDestroyDenyInfoList(acl_deny_info_list ** list) Index: squid3/src/authenticate.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/authenticate.cc,v retrieving revision 1.21 retrieving revision 1.21.26.1 diff -u -r1.21 -r1.21.26.1 --- squid3/src/authenticate.cc 28 Apr 2007 22:51:48 -0000 1.21 +++ squid3/src/authenticate.cc 12 Feb 2008 02:15:20 -0000 1.21.26.1 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.cc,v 1.21 2007/04/28 22:51:48 squidadm Exp $ + * $Id: authenticate.cc,v 1.21.26.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -113,69 +113,67 @@ } } +/** + \retval 0 not in use + \retval ? in use + */ int -authenticateAuthUserInuse(auth_user_t * auth_user) -/* returns 0 for not in use */ +authenticateAuthUserInuse(AuthUser * auth_user) { assert(auth_user != NULL); return auth_user->references; } void -authenticateAuthUserMerge(auth_user_t * from, auth_user_t * to) +authenticateAuthUserMerge(AuthUser * from, AuthUser * to) { to->absorb (from); } -/* - * authenticateUserCacheRestart() cleans all config-dependent data from the - * auth_user cache. It DOES NOT Flush the user cache. +/** + * Cleans all config-dependent data from the auth_user cache. + \note It DOES NOT Flush the user cache. */ - void authenticateUserCacheRestart(void) { AuthUserHashPointer *usernamehash; - auth_user_t *auth_user; - debugs(29, 3, "authenticateUserCacheRestart: Clearing config dependent cache data."); + AuthUser *auth_user; + debugs(29, 3, HERE << "Clearing config dependent cache data."); hash_first(proxy_auth_username_cache); while ((usernamehash = ((AuthUserHashPointer *) hash_next(proxy_auth_username_cache)))) { auth_user = usernamehash->user(); debugs(29, 5, "authenticateUserCacheRestat: Clearing cache ACL results for user: " << auth_user->username()); } - } -/* _auth_user_hash_pointe */ void AuthUserHashPointer::removeFromCache(void *usernamehash_p) { AuthUserHashPointer *usernamehash = static_cast(usernamehash_p); - auth_user_t *auth_user = usernamehash->auth_user; + AuthUser *auth_user = usernamehash->auth_user; if ((authenticateAuthUserInuse(auth_user) - 1)) debugs(29, 1, "AuthUserHashPointer::removeFromCache: entry in use - not freeing"); auth_user->unlock(); - /* TODO: change behaviour - we remove from the auth user list here, and then unlock, and the + /** \todo change behaviour - we remove from the auth user list here, and then unlock, and the * delete ourselves. */ } -AuthUserHashPointer::AuthUserHashPointer (auth_user_t * anAuth_user): - auth_user (anAuth_user) +AuthUserHashPointer::AuthUserHashPointer(AuthUser * anAuth_user): + auth_user(anAuth_user) { key = (void *)anAuth_user->username(); next = NULL; hash_join(proxy_auth_username_cache, (hash_link *) this); - /* lock for presence in the cache */ - auth_user->lock() - - ; + /** lock for presence in the cache */ + auth_user->lock(); } AuthUser * @@ -183,5 +181,3 @@ { return auth_user; } - - Index: squid3/src/authenticate.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/authenticate.h,v retrieving revision 1.14 retrieving revision 1.14.38.1 diff -u -r1.14 -r1.14.38.1 --- squid3/src/authenticate.h 29 May 2006 00:50:18 -0000 1.14 +++ squid3/src/authenticate.h 12 Feb 2008 02:15:20 -0000 1.14.38.1 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.h,v 1.14 2006/05/29 00:50:18 squidadm Exp $ + * $Id: authenticate.h,v 1.14.38.1 2008/02/12 02:15:20 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -46,7 +46,7 @@ static void removeFromCache (void *anAuthUserHashPointer); MEMPROXY_CLASS(AuthUserHashPointer); - AuthUserHashPointer (AuthUser *); + AuthUserHashPointer(AuthUser *); AuthUser *user() const; @@ -54,7 +54,7 @@ AuthUser *auth_user; }; -MEMPROXY_CLASS_INLINE(AuthUserHashPointer) +MEMPROXY_CLASS_INLINE(AuthUserHashPointer); class ConnStateData; @@ -65,12 +65,12 @@ typedef void AUTHSSTATS(StoreEntry *); /* subsumed by the C++ interface */ -extern void authenticateAuthUserMerge(auth_user_t *, auth_user_t *); +extern void authenticateAuthUserMerge(AuthUser *, AuthUser *); extern void authenticateInit(authConfig *); extern void authenticateRegisterWithCacheManager(authConfig * config, CacheManager & manager); extern void authenticateShutdown(void); -extern int authenticateAuthUserInuse(auth_user_t * auth_user); +extern int authenticateAuthUserInuse(AuthUser * auth_user); extern void authenticateFreeProxyAuthUserACLResults(void *data); extern int authenticateActiveSchemeCount(void); Index: squid3/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/globals.h,v retrieving revision 1.33 retrieving revision 1.33.4.1 diff -u -r1.33 -r1.33.4.1 --- squid3/src/globals.h 14 Dec 2007 23:51:01 -0000 1.33 +++ squid3/src/globals.h 12 Feb 2008 02:15:20 -0000 1.33.4.1 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.33 2007/12/14 23:51:01 squidadm Exp $ + * $Id: globals.h,v 1.33.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -67,6 +67,7 @@ extern const char *pingStatusStr[]; extern const char *storeStatusStr[]; extern const char *swapStatusStr[]; + class fde; extern fde *fd_table; /* NULL */ extern int Biggest_FD; /* -1 */ extern int Number_FD; /* 0 */ @@ -79,7 +80,7 @@ extern int config_lineno; /* 0 */ extern int do_mallinfo; /* 0 */ extern int opt_reuseaddr; /* 1 */ - extern int icmp_sock; /* -1 */ +//DEAD extern int icmp_sock; /* -1 */ extern int neighbors_do_private_keys; /* 1 */ extern int opt_catch_signals; /* 1 */ extern int opt_debug_stderr; /* -1 */ @@ -109,7 +110,7 @@ extern int n_disk_objects; /* 0 */ extern iostats IOStats; - extern struct _acl_deny_info_list *DenyInfoList; /* NULL */ + extern struct acl_deny_info_list *DenyInfoList; /* NULL */ extern IPAddress theOutICPAddr; Index: squid3/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/protos.h,v retrieving revision 1.95 retrieving revision 1.95.2.1 diff -u -r1.95 -r1.95.2.1 --- squid3/src/protos.h 7 Feb 2008 03:51:23 -0000 1.95 +++ squid3/src/protos.h 12 Feb 2008 02:15:20 -0000 1.95.2.1 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.95 2008/02/07 03:51:23 squidadm Exp $ + * $Id: protos.h,v 1.95.2.1 2008/02/12 02:15:20 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -180,6 +180,7 @@ class FwdState; SQUIDCEXTERN void ftpStart(FwdState *); +class HttpRequest; SQUIDCEXTERN const char *ftpUrlWith2f(HttpRequest *); SQUIDCEXTERN void gopherStart(FwdState *); @@ -557,6 +558,7 @@ /* * store_swapin.c */ +class store_client; SQUIDCEXTERN void storeSwapInStart(store_client *); /* Index: squid3/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/structs.h,v retrieving revision 1.127 retrieving revision 1.127.2.1 diff -u -r1.127 -r1.127.2.1 --- squid3/src/structs.h 8 Feb 2008 02:50:40 -0000 1.127 +++ squid3/src/structs.h 12 Feb 2008 02:15:20 -0000 1.127.2.1 @@ -1,6 +1,5 @@ - /* - * $Id: structs.h,v 1.127 2008/02/08 02:50:40 squidadm Exp $ + * $Id: structs.h,v 1.127.2.1 2008/02/12 02:15:20 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -42,13 +41,13 @@ /* needed for the global config */ #include "HttpHeader.h" -struct _acl_name_list +struct acl_name_list { char name[ACL_NAME_SZ]; acl_name_list *next; }; -struct _acl_deny_info_list +struct acl_deny_info_list { err_type err_page_id; char *err_page_name; @@ -65,6 +64,8 @@ char *replacement; }; +class ACLChecklist; + #if SQUID_SNMP struct _snmp_request_t @@ -87,8 +88,9 @@ #endif +class ACLList; -struct _acl_address +struct acl_address { acl_address *next; ACLList *aclList; @@ -96,34 +98,34 @@ IPAddress addr; }; -struct _acl_tos +struct acl_tos { acl_tos *next; ACLList *aclList; int tos; }; -struct _acl_size_t +struct acl_size_t { acl_size_t *next; ACLList *aclList; int64_t size; }; -struct _ushortlist +struct ushortlist { u_short i; ushortlist *next; }; -struct _relist +struct relist { char *pattern; regex_t regex; relist *next; }; -struct _http_port_list +struct http_port_list { http_port_list *next; @@ -966,6 +968,8 @@ #endif +class PeerDigest; + struct _peer { u_int index; Index: squid3/src/typedefs.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/typedefs.h,v retrieving revision 1.47 retrieving revision 1.47.4.1 diff -u -r1.47 -r1.47.4.1 --- squid3/src/typedefs.h 7 Jan 2008 17:50:51 -0000 1.47 +++ squid3/src/typedefs.h 12 Feb 2008 02:15:20 -0000 1.47.4.1 @@ -1,7 +1,5 @@ - /* - * $Id: typedefs.h,v 1.47 2008/01/07 17:50:51 squidadm Exp $ - * + * $Id: typedefs.h,v 1.47.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -37,7 +35,7 @@ #define SQUID_TYPEDEFS_H typedef unsigned int store_status_t; -typedef unsigned int ping_status_t; +//MOVED src/Store.h (only use) typedef unsigned int ping_status_t; typedef unsigned int swap_status_t; typedef signed int sfileno; typedef signed int sdirno; @@ -47,16 +45,12 @@ size_t bytes; size_t kb; } - kb_t; -typedef struct _acl_time_data acl_time_data; - -typedef struct _acl_name_list acl_name_list; - -typedef struct _acl_deny_info_list acl_deny_info_list; - -typedef class AuthUser auth_user_t; +//UNUSED typedef struct _acl_time_data acl_time_data; +//UNUSED typedef struct _acl_name_list acl_name_list; +//UNUSED typedef struct _acl_deny_info_list acl_deny_info_list; +//UNUSED typedef class AuthUser auth_user_t; typedef struct AuthUserHashPointer auth_user_hash_pointer; @@ -68,23 +62,15 @@ class AuthConfig; typedef Vector authConfig; -typedef struct _acl_snmp_comm acl_snmp_comm; - -typedef class ACLList acl_list; - -typedef struct _acl_address acl_address; - -typedef struct _acl_tos acl_tos; - -typedef struct _acl_size_t acl_size_t; - -class ACLChecklist; - -typedef struct _ushortlist ushortlist; - -typedef struct _relist relist; - -typedef struct _http_port_list http_port_list; +//UNUSED typedef struct _acl_snmp_comm acl_snmp_comm; +//UNUSED typedef class ACLList acl_list; +//UNUSED typedef struct _acl_address acl_address; +//UNUSED typedef struct _acl_tos acl_tos; +//UNUSED typedef struct _acl_size_t acl_size_t; +//UNUSED class ACLChecklist; +//UNUSED typedef struct _ushortlist ushortlist; +//UNUSED typedef struct _relist relist; +//UNUSED typedef struct _http_port_list http_port_list; typedef struct _https_port_list https_port_list; @@ -100,27 +86,25 @@ typedef struct _ETag ETag; -class fde; +//UNUSED class fde; typedef struct _fileMap fileMap; typedef struct _HttpHeaderFieldAttrs HttpHeaderFieldAttrs; -class HttpHeaderFieldInfo; - -class HttpHeader; - -class HttpHdrCc; +//UNUSED class HttpHeaderFieldInfo; +//UNUSED class HttpHeader; +//UNUSED class HttpHdrCc; typedef struct _TimeOrTag TimeOrTag; -class HttpHeaderFieldStat; +//UNUSED class HttpHeaderFieldStat; typedef struct _HttpHeaderStat HttpHeaderStat; typedef struct _HttpBody HttpBody; -class HttpReply; +//UNUSED class HttpReply; typedef struct _ConnCloseHelperData ConnCloseHelperData; @@ -134,7 +118,7 @@ typedef struct _DigestFetchState DigestFetchState; -class PeerDigest; +//UNUSED class PeerDigest; typedef struct _peer peer; @@ -150,13 +134,11 @@ typedef struct _iostats iostats; -class MemBuf; - -class store_client; +//UNUSED class MemBuf; -class StoreEntry; +//UNUSED class store_client; -class SwapDir; +//UNUSED class SwapDir; typedef struct _http_state_flags http_state_flags; @@ -164,7 +146,7 @@ typedef struct _body_size body_size; -class HttpRequest; +//UNUSED class HttpRequest; typedef struct _cachemgr_passwd cachemgr_passwd; @@ -234,6 +216,7 @@ typedef int QS(const void *, const void *); /* qsort */ typedef void STABH(void *); typedef void ERCB(int fd, void *, size_t); +class StoreEntry; typedef void OBJH(StoreEntry *); typedef void SIGHDLR(int sig); typedef void STVLDCB(void *, int, int); Index: squid3/src/auth/basic/auth_basic.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/basic/auth_basic.cc,v retrieving revision 1.28 retrieving revision 1.28.10.1 diff -u -r1.28 -r1.28.10.1 --- squid3/src/auth/basic/auth_basic.cc 3 Aug 2007 02:51:05 -0000 1.28 +++ squid3/src/auth/basic/auth_basic.cc 12 Feb 2008 02:15:20 -0000 1.28.10.1 @@ -1,5 +1,5 @@ /* - * $Id: auth_basic.cc,v 1.28 2007/08/03 02:51:05 squidadm Exp $ + * $Id: auth_basic.cc,v 1.28.10.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -360,11 +360,11 @@ CBDATA_TYPE(AuthenticateStateData); -static auth_user_t * +static AuthUser * authBasicAuthUserFindUsername(const char *username) { AuthUserHashPointer *usernamehash; - debugs(29, 9, "authBasicAuthUserFindUsername: Looking for user '" << username << "'"); + debugs(29, 9, HERE << "Looking for user '" << username << "'"); if (username && (usernamehash = static_cast(hash_lookup(proxy_auth_username_cache, username)))) { while (usernamehash) { @@ -570,7 +570,7 @@ /* now lookup and see if we have a matching auth_user structure in * memory. */ - auth_user_t *auth_user; + AuthUser *auth_user; if ((auth_user = authBasicAuthUserFindUsername(local_basic.username())) == NULL) { auth_user = local_basic.makeCachedFrom(); Index: squid3/src/auth/digest/auth_digest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/digest/auth_digest.cc,v retrieving revision 1.41 retrieving revision 1.41.4.1 diff -u -r1.41 -r1.41.4.1 --- squid3/src/auth/digest/auth_digest.cc 20 Jan 2008 09:50:58 -0000 1.41 +++ squid3/src/auth/digest/auth_digest.cc 12 Feb 2008 02:15:20 -0000 1.41.4.1 @@ -1,5 +1,5 @@ /* - * $Id: auth_digest.cc,v 1.41 2008/01/20 09:50:58 squidadm Exp $ + * $Id: auth_digest.cc,v 1.41.4.1 2008/02/12 02:15:20 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -456,12 +456,12 @@ } /* USER related functions */ -static auth_user_t * +static AuthUser * authDigestUserFindUsername(const char *username) { - auth_user_hash_pointer *usernamehash; - auth_user_t *auth_user; - debugs(29, 9, "authDigestUserFindUsername: Looking for user '" << username << "'"); + AuthUserHashPointer *usernamehash; + AuthUser *auth_user; + debugs(29, 9, HERE << "Looking for user '" << username << "'"); if (username && (usernamehash = static_cast < auth_user_hash_pointer * >(hash_lookup(proxy_auth_username_cache, username)))) { while ((usernamehash->user()->auth_type != AUTH_DIGEST) && @@ -483,11 +483,9 @@ static void authDigestUserShutdown(void) { - /* - * Future work: the auth framework could flush it's cache - */ - auth_user_hash_pointer *usernamehash; - auth_user_t *auth_user; + /** \todo Future work: the auth framework could flush it's cache */ + AuthUserHashPointer *usernamehash; + AuthUser *auth_user; hash_first(proxy_auth_username_cache); while ((usernamehash = ((auth_user_hash_pointer *) hash_next(proxy_auth_username_cache)))) { @@ -498,11 +496,11 @@ } } -/* delete the digest request structure. Does NOT delete related structures */ +/** delete the digest request structure. Does NOT delete related structures */ void digestScheme::done() { - /* TODO: this should be a Config call. */ + /** \todo this should be a Config call. */ if (digestauthenticators) helperShutdown(digestauthenticators); @@ -570,12 +568,12 @@ return 0; } -/* log a digest user in +/** log a digest user in */ void AuthDigestUserRequest::authenticate(HttpRequest * request, ConnStateData::Pointer conn, http_hdr_type type) { - auth_user_t *auth_user; + AuthUser *auth_user; AuthDigestUserRequest *digest_request; digest_user_h *digest_user; @@ -1301,7 +1299,7 @@ /* find the user */ digest_user_h *digest_user; - auth_user_t *auth_user; + AuthUser *auth_user; if ((auth_user = authDigestUserFindUsername(username)) == NULL) { /* the user doesn't exist in the username cache yet */ @@ -1380,28 +1378,24 @@ DigestUser::DigestUser (AuthConfig *config) : AuthUser (config), HA1created (0) {} -auth_user_t * +AuthUser * AuthDigestUserRequest::authUser() const { return const_cast(user()); } void -AuthDigestUserRequest::authUser(auth_user_t *aUser) +AuthDigestUserRequest::authUser(AuthUser *aUser) { - assert (!authUser()); + assert(!authUser()); user(aUser); - - user()->lock() - - ; + user()->lock(); } AuthDigestUserRequest::CredentialsState AuthDigestUserRequest::credentials() const { return credentials_ok; - } void @@ -1417,7 +1411,7 @@ credentials_ok (Unchecked) {} -/* delete the digest request structure. Does NOT delete related structures */ +/** delete the digest request structure. Does NOT delete related structures */ AuthDigestUserRequest::~AuthDigestUserRequest() { safe_free (nonceb64); Index: squid3/src/auth/digest/auth_digest.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/digest/auth_digest.h,v retrieving revision 1.15 retrieving revision 1.15.4.1 diff -u -r1.15 -r1.15.4.1 --- squid3/src/auth/digest/auth_digest.h 30 Dec 2007 04:50:43 -0000 1.15 +++ squid3/src/auth/digest/auth_digest.h 12 Feb 2008 02:15:22 -0000 1.15.4.1 @@ -44,7 +44,7 @@ }; -MEMPROXY_CLASS_INLINE(DigestUser) +MEMPROXY_CLASS_INLINE(DigestUser); typedef class DigestUser digest_user_h; @@ -74,13 +74,13 @@ virtual const AuthUser *user() const {return _theUser;} - virtual void user (AuthUser *aUser) {_theUser=dynamic_cast(aUser);} + virtual void user(AuthUser *aUser) {_theUser=dynamic_cast(aUser);} CredentialsState credentials() const; void credentials(CredentialsState); - void authUser(auth_user_t *); - auth_user_t *authUser() const; + void authUser(AuthUser *); + AuthUser *authUser() const; char *nonceb64; /* "dcd98b7102dd2f0e8b11d0f600bfb0c093" */ char *cnonce; /* "0a4f113b" */ Index: squid3/src/auth/negotiate/auth_negotiate.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/negotiate/auth_negotiate.cc,v retrieving revision 1.26 retrieving revision 1.26.4.1 diff -u -r1.26 -r1.26.4.1 --- squid3/src/auth/negotiate/auth_negotiate.cc 14 Dec 2007 23:51:09 -0000 1.26 +++ squid3/src/auth/negotiate/auth_negotiate.cc 12 Feb 2008 02:15:22 -0000 1.26.4.1 @@ -1,5 +1,5 @@ /* - * $Id: auth_negotiate.cc,v 1.26 2007/12/14 23:51:09 squidadm Exp $ + * $Id: auth_negotiate.cc,v 1.26.4.1 2008/02/12 02:15:22 amosjeffries Exp $ * * DEBUG: section 29 Negotiate Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -465,8 +465,8 @@ debugs(29, 4, "AuthNegotiateUserRequest::authenticate: authenticated user " << negotiate_user->username()); /* see if this is an existing user with a different proxy_auth * string */ - auth_user_hash_pointer *usernamehash = static_cast(hash_lookup(proxy_auth_username_cache, negotiate_user->username())); - auth_user_t *local_auth_user = negotiate_request->user(); + AuthUserHashPointer *usernamehash = static_cast(hash_lookup(proxy_auth_username_cache, negotiate_user->username())); + AuthUser *local_auth_user = negotiate_request->user(); while (usernamehash && (usernamehash->user()->auth_type != AUTH_NEGOTIATE || strcmp(usernamehash->user()->username(), negotiate_user->username()) != 0)) usernamehash = static_cast(usernamehash->next); if (usernamehash) { @@ -542,14 +542,14 @@ } -/* send the initial data to a stateful negotiate authenticator module */ +/** send the initial data to a stateful negotiate authenticator module */ void AuthNegotiateUserRequest::module_start(RH * handler, void *data) { authenticateStateData *r = NULL; static char buf[8192]; negotiate_user_t *negotiate_user; - auth_user_t *auth_user = user(); + AuthUser *auth_user = user(); assert(data); assert(handler); @@ -664,8 +664,8 @@ { const char *proxy_auth, *blob; - /* TODO: rename this!! */ - auth_user_t *local_auth_user; + /** \todo rename this!! */ + AuthUser *local_auth_user; negotiate_user_t *negotiate_user; local_auth_user = user(); @@ -674,7 +674,7 @@ negotiate_user = dynamic_cast(local_auth_user); assert (this); - /* Check that we are in the client side, where we can generate + /** Check that we are in the client side, where we can generate * auth challenges */ if (conn.getRaw() == NULL) { Index: squid3/src/auth/ntlm/auth_ntlm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/ntlm/auth_ntlm.cc,v retrieving revision 1.48 retrieving revision 1.48.4.1 diff -u -r1.48 -r1.48.4.1 --- squid3/src/auth/ntlm/auth_ntlm.cc 14 Dec 2007 23:51:09 -0000 1.48 +++ squid3/src/auth/ntlm/auth_ntlm.cc 12 Feb 2008 02:15:23 -0000 1.48.4.1 @@ -1,5 +1,5 @@ /* - * $Id: auth_ntlm.cc,v 1.48 2007/12/14 23:51:09 squidadm Exp $ + * $Id: auth_ntlm.cc,v 1.48.4.1 2008/02/12 02:15:23 amosjeffries Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -414,7 +414,7 @@ /* see if this is an existing user with a different proxy_auth * string */ auth_user_hash_pointer *usernamehash = static_cast(hash_lookup(proxy_auth_username_cache, ntlm_user->username())); - auth_user_t *local_auth_user = ntlm_request->user(); + AuthUser *local_auth_user = ntlm_request->user(); while (usernamehash && (usernamehash->user()->auth_type != AUTH_NTLM || strcmp(usernamehash->user()->username(), ntlm_user->username()) != 0)) usernamehash = static_cast(usernamehash->next); if (usernamehash) { @@ -485,7 +485,7 @@ authenticateStateData *r = NULL; static char buf[8192]; ntlm_user_t *ntlm_user; - auth_user_t *auth_user = user(); + AuthUser *auth_user = user(); assert(data); assert(handler); @@ -601,7 +601,7 @@ const char *proxy_auth, *blob; /* TODO: rename this!! */ - auth_user_t *local_auth_user; + AuthUser *local_auth_user; ntlm_user_t *ntlm_user; local_auth_user = user();