--------------------- PatchSet 6030 Date: 2007/10/29 08:36:30 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Code cleanup. - Make Time engine/component responsible for the time globals. - Make Time users include SquidTime.h properly to access them. Members: src/SquidTime.h:1.2.8.2->1.2.8.3 src/debug.cc:1.13.8.4->1.13.8.5 src/event.cc:1.5.8.6->1.5.8.7 src/globals.h:1.17.2.13->1.17.2.14 src/icmp.cc:1.8.8.17->1.8.8.18 src/peer_select.cc:1.9.4.14->1.9.4.15 src/stat.cc:1.24.4.16->1.24.4.17 src/store_log.cc:1.5.8.6->1.5.8.7 src/time.cc:1.3.8.2->1.3.8.3 src/auth/digest/auth_digest.cc:1.18.4.16->1.18.4.17 src/auth/negotiate/auth_negotiate.cc:1.10.2.15->1.10.2.16 src/auth/ntlm/auth_ntlm.cc:1.19.4.14->1.19.4.15 Index: squid3/src/SquidTime.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SquidTime.h,v retrieving revision 1.2.8.2 retrieving revision 1.2.8.3 diff -u -r1.2.8.2 -r1.2.8.3 --- squid3/src/SquidTime.h 5 Jan 2007 16:58:56 -0000 1.2.8.2 +++ squid3/src/SquidTime.h 29 Oct 2007 08:36:30 -0000 1.2.8.3 @@ -1,6 +1,5 @@ - /* - * $Id: SquidTime.h,v 1.2.8.2 2007/01/05 16:58:56 hno Exp $ + * $Id: SquidTime.h,v 1.2.8.3 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 21 Time Functions * AUTHOR: Harvest Derived @@ -38,6 +37,10 @@ #include "squid.h" +/* globals for accessing time */ +extern struct timeval current_time; +extern double current_dtime; + extern time_t squid_curtime; /* 0 */ time_t getCurrentTime(void); Index: squid3/src/debug.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/debug.cc,v retrieving revision 1.13.8.4 retrieving revision 1.13.8.5 diff -u -r1.13.8.4 -r1.13.8.5 --- squid3/src/debug.cc 2 Aug 2007 10:51:46 -0000 1.13.8.4 +++ squid3/src/debug.cc 29 Oct 2007 08:36:30 -0000 1.13.8.5 @@ -1,6 +1,5 @@ - /* - * $Id: debug.cc,v 1.13.8.4 2007/08/02 10:51:46 amosjeffries Exp $ + * $Id: debug.cc,v 1.13.8.5 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived Index: squid3/src/event.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/event.cc,v retrieving revision 1.5.8.6 retrieving revision 1.5.8.7 diff -u -r1.5.8.6 -r1.5.8.7 --- squid3/src/event.cc 10 Aug 2007 10:41:09 -0000 1.5.8.6 +++ squid3/src/event.cc 29 Oct 2007 08:36:30 -0000 1.5.8.7 @@ -1,6 +1,5 @@ - /* - * $Id: event.cc,v 1.5.8.6 2007/08/10 10:41:09 amosjeffries Exp $ + * $Id: event.cc,v 1.5.8.7 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 41 Event Processing * AUTHOR: Henrik Nordstrom @@ -36,6 +35,7 @@ #include "event.h" #include "CacheManager.h" #include "Store.h" +#include "SquidTime.h" /* The list of event processes */ Index: squid3/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/globals.h,v retrieving revision 1.17.2.13 retrieving revision 1.17.2.14 diff -u -r1.17.2.13 -r1.17.2.14 --- squid3/src/globals.h 27 Oct 2007 06:03:44 -0000 1.17.2.13 +++ squid3/src/globals.h 29 Oct 2007 08:36:30 -0000 1.17.2.14 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.17.2.13 2007/10/27 06:03:44 amosjeffries Exp $ + * $Id: globals.h,v 1.17.2.14 2007/10/29 08:36:30 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -115,8 +115,6 @@ extern IPAddress theOutSNMPAddr; - extern struct timeval current_time; - extern struct timeval squid_start; extern int shutting_down; /* 0 */ extern int reconfiguring; /* 0 */ @@ -128,7 +126,6 @@ extern char *swap_log_op_str[]; extern char *lookup_t_str[]; extern double request_failure_ratio; /* 0.0 */ - extern double current_dtime; extern int store_hash_buckets; /* 0 */ extern hash_table *store_table; /* NULL */ extern dlink_list ClientActiveRequests; Index: squid3/src/icmp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/icmp.cc,v retrieving revision 1.8.8.17 retrieving revision 1.8.8.18 diff -u -r1.8.8.17 -r1.8.8.18 --- squid3/src/icmp.cc 16 Oct 2007 13:35:09 -0000 1.8.8.17 +++ squid3/src/icmp.cc 29 Oct 2007 08:36:30 -0000 1.8.8.18 @@ -1,5 +1,5 @@ /* - * $Id: icmp.cc,v 1.8.8.17 2007/10/16 13:35:09 amosjeffries Exp $ + * $Id: icmp.cc,v 1.8.8.18 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels, Amos Jeffries @@ -33,7 +33,8 @@ */ #include "squid.h" #include "ICMP.h" - +#include "SquidTime.h" +#include "Debug.h" ICMP::ICMP() { Index: squid3/src/peer_select.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/peer_select.cc,v retrieving revision 1.9.4.14 retrieving revision 1.9.4.15 diff -u -r1.9.4.14 -r1.9.4.15 --- squid3/src/peer_select.cc 24 Oct 2007 02:34:39 -0000 1.9.4.14 +++ squid3/src/peer_select.cc 29 Oct 2007 08:36:30 -0000 1.9.4.15 @@ -1,6 +1,5 @@ - /* - * $Id: peer_select.cc,v 1.9.4.14 2007/10/24 02:34:39 amosjeffries Exp $ + * $Id: peer_select.cc,v 1.9.4.15 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 44 Peer Selection Algorithm * AUTHOR: Duane Wessels @@ -42,6 +41,7 @@ #include "ACLChecklist.h" #include "htcp.h" #include "forward.h" +#include "SquidTime.h" const char *hier_strings[] = { Index: squid3/src/stat.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/stat.cc,v retrieving revision 1.24.4.16 retrieving revision 1.24.4.17 diff -u -r1.24.4.16 -r1.24.4.17 --- squid3/src/stat.cc 21 Sep 2007 12:34:15 -0000 1.24.4.16 +++ squid3/src/stat.cc 29 Oct 2007 08:36:30 -0000 1.24.4.17 @@ -1,5 +1,5 @@ /* - * $Id: stat.cc,v 1.24.4.16 2007/09/21 12:34:15 amosjeffries Exp $ + * $Id: stat.cc,v 1.24.4.17 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -48,6 +48,7 @@ #include "client_side_request.h" #include "client_side.h" #include "MemBuf.h" +#include "SquidTime.h" /* these are included because they expose stats calls */ /* TODO: provide a self registration mechanism for those classes Index: squid3/src/store_log.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_log.cc,v retrieving revision 1.5.8.6 retrieving revision 1.5.8.7 diff -u -r1.5.8.6 -r1.5.8.7 --- squid3/src/store_log.cc 14 Aug 2007 02:06:53 -0000 1.5.8.6 +++ squid3/src/store_log.cc 29 Oct 2007 08:36:30 -0000 1.5.8.7 @@ -1,6 +1,5 @@ - /* - * $Id: store_log.cc,v 1.5.8.6 2007/08/14 02:06:53 amosjeffries Exp $ + * $Id: store_log.cc,v 1.5.8.7 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 20 Storage Manager Logging Functions * AUTHOR: Duane Wessels @@ -38,6 +37,7 @@ #include "MemObject.h" #include "HttpReply.h" #include "CacheManager.h" +#include "SquidTime.h" static const char *storeLogTags[] = { Index: squid3/src/time.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/time.cc,v retrieving revision 1.3.8.2 retrieving revision 1.3.8.3 diff -u -r1.3.8.2 -r1.3.8.3 --- squid3/src/time.cc 5 Jan 2007 16:59:40 -0000 1.3.8.2 +++ squid3/src/time.cc 29 Oct 2007 08:36:30 -0000 1.3.8.3 @@ -1,6 +1,5 @@ - /* - * $Id: time.cc,v 1.3.8.2 2007/01/05 16:59:40 hno Exp $ + * $Id: time.cc,v 1.3.8.3 2007/10/29 08:36:30 amosjeffries Exp $ * * DEBUG: section 21 Time Functions * AUTHOR: Harvest Derived @@ -35,6 +34,9 @@ #include "SquidTime.h" +struct timeval current_time; +double current_dtime; + time_t squid_curtime = 0; time_t Index: squid3/src/auth/digest/auth_digest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/digest/auth_digest.cc,v retrieving revision 1.18.4.16 retrieving revision 1.18.4.17 diff -u -r1.18.4.16 -r1.18.4.17 --- squid3/src/auth/digest/auth_digest.cc 28 Aug 2007 01:35:10 -0000 1.18.4.16 +++ squid3/src/auth/digest/auth_digest.cc 29 Oct 2007 08:36:31 -0000 1.18.4.17 @@ -1,6 +1,5 @@ - /* - * $Id: auth_digest.cc,v 1.18.4.16 2007/08/28 01:35:10 amosjeffries Exp $ + * $Id: auth_digest.cc,v 1.18.4.17 2007/10/29 08:36:31 amosjeffries Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -48,6 +47,7 @@ #include "HttpRequest.h" #include "HttpReply.h" #include "wordlist.h" +#include "SquidTime.h" /* TODO don't include this */ #include "digestScheme.h" Index: squid3/src/auth/negotiate/auth_negotiate.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/negotiate/auth_negotiate.cc,v retrieving revision 1.10.2.15 retrieving revision 1.10.2.16 diff -u -r1.10.2.15 -r1.10.2.16 --- squid3/src/auth/negotiate/auth_negotiate.cc 1 Sep 2007 09:55:00 -0000 1.10.2.15 +++ squid3/src/auth/negotiate/auth_negotiate.cc 29 Oct 2007 08:36:31 -0000 1.10.2.16 @@ -1,6 +1,5 @@ - /* - * $Id: auth_negotiate.cc,v 1.10.2.15 2007/09/01 09:55:00 amosjeffries Exp $ + * $Id: auth_negotiate.cc,v 1.10.2.16 2007/10/29 08:36:31 amosjeffries Exp $ * * DEBUG: section 29 Negotiate Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -46,6 +45,7 @@ #include "client_side.h" #include "HttpReply.h" #include "HttpRequest.h" +#include "SquidTime.h" /* TODO remove this include */ #include "negotiateScheme.h" #include "wordlist.h" Index: squid3/src/auth/ntlm/auth_ntlm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/ntlm/auth_ntlm.cc,v retrieving revision 1.19.4.14 retrieving revision 1.19.4.15 diff -u -r1.19.4.14 -r1.19.4.15 --- squid3/src/auth/ntlm/auth_ntlm.cc 1 Sep 2007 09:55:00 -0000 1.19.4.14 +++ squid3/src/auth/ntlm/auth_ntlm.cc 29 Oct 2007 08:36:31 -0000 1.19.4.15 @@ -1,6 +1,5 @@ - /* - * $Id: auth_ntlm.cc,v 1.19.4.14 2007/09/01 09:55:00 amosjeffries Exp $ + * $Id: auth_ntlm.cc,v 1.19.4.15 2007/10/29 08:36:31 amosjeffries Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -49,6 +48,7 @@ /* TODO remove this include */ #include "ntlmScheme.h" #include "wordlist.h" +#include "SquidTime.h" static void authenticateNTLMReleaseServer(AuthUserRequest * auth_user_request);