Index: mkrelease.sh
===================================================================
RCS file: /cvsroot/squid/squid3/mkrelease.sh,v
retrieving revision 1.10
diff -u -w -p -r1.10 mkrelease.sh
--- mkrelease.sh	19 Oct 2002 21:50:22 -0000	1.10
+++ mkrelease.sh	15 Dec 2002 13:43:33 -0000
@@ -43,7 +43,7 @@ g/${VERSION}-CVS/ s//${VERSION}/
 w
 EOS
 ed -s include/version.h <<EOS
-g/squid_curtime/ s//${RELEASE_TIME}/
+g/currentTimeC()/ s//${RELEASE_TIME}/
 w
 EOS
 
Index: include/memMeter.h
===================================================================
RCS file: /cvsroot/squid/squid3/include/memMeter.h,v
retrieving revision 1.1
diff -u -w -p -r1.1 memMeter.h
--- include/memMeter.h	6 Apr 2002 08:49:24 -0000	1.1
+++ include/memMeter.h	15 Dec 2002 13:43:34 -0000
@@ -11,7 +11,7 @@ struct _MemMeter {
     time_t hwater_stamp;        /* timestamp of last high water mark change */
 };
 
-#define memMeterSyncHWater(m)  { (m).hwater_level = (m).level; (m).hwater_stamp = squid_curtime; }
+#define memMeterSyncHWater(m)  { (m).hwater_level = (m).level; (m).hwater_stamp = currentTimeC(); }
 #define memMeterCheckHWater(m) { if ((m).hwater_level < (m).level) memMeterSyncHWater((m)); }
 #define memMeterInc(m) { (m).level++; memMeterCheckHWater(m); }
 #define memMeterDec(m) { (m).level--; }
Index: include/tempnam.h
===================================================================
RCS file: /cvsroot/squid/squid3/include/tempnam.h,v
retrieving revision 1.11
diff -u -w -p -r1.11 tempnam.h
--- include/tempnam.h	8 Oct 2001 16:18:31 -0000	1.11
+++ include/tempnam.h	15 Dec 2002 13:43:34 -0000
@@ -22,5 +22,5 @@
 
 #ifndef SQUID_TEMPNAM_H
 #define SQUID_TEMPNAM_H
-extern char *tempnam(const char *, const char *);
+SQUIDCEXTERN char *tempnam(const char *, const char *);
 #endif /* SQUID_TEMPNAM_H */
Index: include/util.h
===================================================================
RCS file: /cvsroot/squid/squid3/include/util.h,v
retrieving revision 1.65
diff -u -w -p -r1.65 util.h
--- include/util.h	25 Oct 2002 01:25:26 -0000	1.65
+++ include/util.h	15 Dec 2002 13:43:34 -0000
@@ -61,14 +61,19 @@
 #define _etext etext
 #endif
 
+#ifndef SQUID_UTIL_C
+#define SQUID_UTIL_INLINE SQUIDCEXTERN inline
+#else
+#define SQUID_UTIL_INLINE inline
+#endif
+
 SQUIDCEXTERN const char *getfullhostname(void);
-SQUIDCEXTERN const char *mkhttpdlogtime(const time_t *);
-SQUIDCEXTERN const char *mkrfc1123(time_t);
+SQUIDCEXTERN const char *mkhttpdlogtime(const time_t);
+SQUIDCEXTERN const char *mkrfc1123(const time_t);
 SQUIDCEXTERN char *uudecode(const char *);
 SQUIDCEXTERN char *xstrdup(const char *);
 SQUIDCEXTERN char *xstrndup(const char *, size_t);
 SQUIDCEXTERN const char *xstrerror(void);
-extern const char *xbstrerror(int);
 SQUIDCEXTERN int tvSubMsec(struct timeval, struct timeval);
 SQUIDCEXTERN int tvSubUsec(struct timeval, struct timeval);
 SQUIDCEXTERN double tvSubDsec(struct timeval, struct timeval);
@@ -102,12 +107,12 @@ SQUIDCEXTERN void malloc_statistics(void
 #define xrealloc(ptr,size) (xmalloc_func="xrealloc",xmalloc_line=__LINE__,xmalloc_file=__FILE__,xrealloc(ptr,size))
 #define xcalloc(n,size) (xmalloc_func="xcalloc",xmalloc_line=__LINE__,xmalloc_file=__FILE__,xcalloc(n,size))
 #define xstrdup(ptr) (xmalloc_func="xstrdup",xmalloc_line=__LINE__,xmalloc_file=__FILE__,xstrdup(ptr))
-extern int xmalloc_line;
-extern char *xmalloc_file;
-extern char *xmalloc_func;
-extern int xmalloc_trace;
-extern size_t xmalloc_total;
-extern void xmalloc_find_leaks(void);
+SQUIDCEXTERN int xmalloc_line;
+SQUIDCEXTERN char *xmalloc_file;
+SQUIDCEXTERN char *xmalloc_func;
+SQUIDCEXTERN int xmalloc_trace;
+SQUIDCEXTERN size_t xmalloc_total;
+SQUIDCEXTERN void xmalloc_find_leaks(void);
 #endif
 
 typedef struct in_addr SIA;
@@ -138,14 +143,31 @@ typedef struct {
 #define gb_inc(gb, delta) { if ((gb)->bytes > gb_flush_limit || delta > gb_flush_limit) gb_flush(gb); (gb)->bytes += delta; (gb)->count++; }
 #define gb_incb(gb, delta) { if ((gb)->bytes > gb_flush_limit || delta > gb_flush_limit) gb_flush(gb); (gb)->bytes += delta; }
 #define gb_incc(gb, delta) { if ((gb)->bytes > gb_flush_limit || delta > gb_flush_limit) gb_flush(gb); (gb)->count+= delta; }
-extern double gb_to_double(const gb_t *);
+SQUIDCEXTERN double gb_to_double(const gb_t *);
 SQUIDCEXTERN const char *double_to_str(char *buf, int buf_size, double value);
-extern const char *gb_to_str(const gb_t *);
-extern void gb_flush(gb_t *);  /* internal, do not use this */
+SQUIDCEXTERN const char *gb_to_str(const gb_t *);
+SQUIDCEXTERN void gb_flush(gb_t *);  /* internal, do not use this */
 
 /*
  * Returns the amount of known allocated memory
  */
-int statMemoryAccounted(void);
+SQUIDCEXTERN int statMemoryAccounted(void);
+
+/*
+ * Cached Time functions
+ */
+SQUIDCEXTERN struct timeval util_cache_timeval;
+SQUIDCEXTERN time_t util_cache_time_t;
+SQUIDCEXTERN double util_cache_time_d;
+SQUIDCEXTERN const time_t currentTimeC(void);
+SQUIDCEXTERN const double currentDTime(void);
+SQUIDCEXTERN const struct timeval currentTimeVal(void);
+SQUIDCEXTERN const time_t getCurrentTime(void);
+
+/* XXX Not sure if SQUIDCEXTERN and inline mixes well. If not convert
+ * these to macros */
+SQUID_UTIL_INLINE const time_t currentTimeC(void) {return util_cache_time_t;}
+SQUID_UTIL_INLINE const double currentDTime(void) {return util_cache_time_d;}
+SQUID_UTIL_INLINE const struct timeval currentTimeVal(void) {return util_cache_timeval;}
 
 #endif /* SQUID_UTIL_H */
Index: include/version.h
===================================================================
RCS file: /cvsroot/squid/squid3/include/version.h,v
retrieving revision 1.133
diff -u -w -p -r1.133 version.h
--- include/version.h	31 Aug 2001 11:19:09 -0000	1.133
+++ include/version.h	15 Dec 2002 13:43:34 -0000
@@ -9,5 +9,5 @@
  */
 
 #ifndef SQUID_RELEASE_TIME
-#define SQUID_RELEASE_TIME squid_curtime
+#define SQUID_RELEASE_TIME currentTimeC()
 #endif
Index: lib/MemPool.c
===================================================================
RCS file: /cvsroot/squid/squid3/lib/MemPool.c,v
retrieving revision 1.14
diff -u -w -p -r1.14 MemPool.c
--- lib/MemPool.c	15 Nov 2002 13:07:25 -0000	1.14
+++ lib/MemPool.c	15 Dec 2002 13:43:34 -0000
@@ -92,12 +92,6 @@
 #endif
 #include "MemPool.h"
 
-/*
- * XXX This is a boundary violation between lib and src.. would be good
- * if it could be solved otherwise, but left for now.
- */
-extern time_t squid_curtime;
-
 /* Allocator API */
 extern MemPool *memPoolCreate(const char *label, size_t obj_size);
 extern void *memPoolAlloc(MemPool * pool);
@@ -232,7 +226,7 @@ memPoolChunkNew(MemPool * pool)
     memMeterAdd(pool->meter.idle, pool->chunk_capacity);
     pool->idle += pool->chunk_capacity;
     pool->chunkCount++;
-    chunk->lastref = squid_curtime;
+    chunk->lastref = currentTimeC();
     lastPool = pool;
     pool->allChunks = splay_insert(chunk, pool->allChunks, (SPLAYCMP *) memCompChunks);
     return chunk;
@@ -301,7 +295,7 @@ memPoolGet(MemPool * pool)
     chunk->freeList = *Free;
     *Free = NULL;
     chunk->inuse_count++;
-    chunk->lastref = squid_curtime;
+    chunk->lastref = currentTimeC();
 
     if (chunk->freeList == NULL) {
 	/* last free in this chunk, so remove us from perchunk freelist chain */
@@ -582,7 +576,7 @@ memPoolCleanOne(MemPool * pool, time_t m
 	pool->freeCache = *Free;	/* remove from global cache */
 	*Free = chunk->freeList;	/* stuff into chunks freelist */
 	chunk->freeList = Free;
-	chunk->lastref = squid_curtime;
+	chunk->lastref = currentTimeC();
     }
 
     /* Now we have all chunks in this pool cleared up, all free items returned to their home */
@@ -592,7 +586,7 @@ memPoolCleanOne(MemPool * pool, time_t m
 
     chunk = pool->Chunks;
     while ((freechunk = chunk->next) != NULL) {
-	age = squid_curtime - freechunk->lastref;
+	age = currentTimeC() - freechunk->lastref;
 	freechunk->nextFreeChunk = NULL;
 	if (freechunk->inuse_count == 0)
 	    if (age >= maxage) {
Index: lib/rfc1123.c
===================================================================
RCS file: /cvsroot/squid/squid3/lib/rfc1123.c,v
retrieving revision 1.30
diff -u -w -p -r1.30 rfc1123.c
--- lib/rfc1123.c	6 Oct 2002 02:05:22 -0000	1.30
+++ lib/rfc1123.c	15 Dec 2002 13:43:34 -0000
@@ -280,7 +280,7 @@ parse_rfc1123(const char *str)
 }
 
 const char *
-mkrfc1123(time_t t)
+mkrfc1123(const time_t t)
 {
     static char buf[128];
 
@@ -292,11 +292,11 @@ mkrfc1123(time_t t)
 }
 
 const char *
-mkhttpdlogtime(const time_t * t)
+mkhttpdlogtime(const time_t t)
 {
     static char buf[128];
 
-    struct tm *gmt = gmtime(t);
+    struct tm *gmt = gmtime(&t);
 
 #ifndef USE_GMT
     int gmt_min, gmt_hour, gmt_yday, day_offset;
@@ -309,7 +309,7 @@ mkhttpdlogtime(const time_t * t)
     gmt_hour = gmt->tm_hour;
     gmt_yday = gmt->tm_yday;
 
-    lt = localtime(t);
+    lt = localtime(&t);
 
     day_offset = lt->tm_yday - gmt_yday;
     /* wrap round on end of year */
Index: lib/util.c
===================================================================
RCS file: /cvsroot/squid/squid3/lib/util.c,v
retrieving revision 1.88
diff -u -w -p -r1.88 util.c
--- lib/util.c	18 Oct 2002 22:42:00 -0000	1.88
+++ lib/util.c	15 Dec 2002 13:43:34 -0000
@@ -68,6 +68,8 @@
 #include <assert.h>
 #endif
 
+#define SQUID_UTIL_C
+
 #include "util.h"
 #include "snprintf.h"
 
@@ -818,3 +820,21 @@ gb_to_str(const gb_t * g)
 	snprintf(buf, sizeof(GbBuf), "%.2f TB", value / 1e12);
     return buf;
 }
+
+struct timeval util_cache_timeval;
+double util_cache_time_d;
+time_t util_cache_time_t;
+
+const time_t
+getCurrentTime(void)
+{
+#if GETTIMEOFDAY_NO_TZP
+    gettimeofday(&util_cache_timeval);
+#else
+    gettimeofday(&util_cache_timeval, NULL);
+#endif
+    util_cache_time_d = (double) util_cache_timeval.tv_sec +
+	(double) util_cache_timeval.tv_usec / 1000000.0;
+    return util_cache_time_t = currentTimeVal().tv_sec;
+}
+
Index: src/HttpReply.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/HttpReply.cc,v
retrieving revision 1.50
diff -u -w -p -r1.50 HttpReply.cc
--- src/HttpReply.cc	13 Oct 2002 20:34:57 -0000	1.50
+++ src/HttpReply.cc	15 Dec 2002 13:43:35 -0000
@@ -245,7 +245,7 @@ httpReplySetHeaders(HttpReply * reply, h
     hdr = &reply->header;
     httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
     httpHeaderPutStr(hdr, HDR_MIME_VERSION, "1.0");
-    httpHeaderPutTime(hdr, HDR_DATE, squid_curtime);
+    httpHeaderPutTime(hdr, HDR_DATE, currentTimeC());
     if (ctype) {
 	httpHeaderPutStr(hdr, HDR_CONTENT_TYPE, ctype);
 	stringInit(&reply->content_type, ctype);
@@ -257,7 +257,7 @@ httpReplySetHeaders(HttpReply * reply, h
 	httpHeaderPutTime(hdr, HDR_EXPIRES, expires);
     if (lmt > 0)		/* this used to be lmt != 0 @?@ */
 	httpHeaderPutTime(hdr, HDR_LAST_MODIFIED, lmt);
-    reply->date = squid_curtime;
+    reply->date = currentTimeC();
     reply->content_length = clen;
     reply->expires = expires;
     reply->last_modified = lmt;
@@ -273,10 +273,10 @@ httpRedirectReply(HttpReply * reply, htt
     httpStatusLineSet(&reply->sline, ver, status, httpStatusString(status));
     hdr = &reply->header;
     httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
-    httpHeaderPutTime(hdr, HDR_DATE, squid_curtime);
+    httpHeaderPutTime(hdr, HDR_DATE, currentTimeC());
     httpHeaderPutInt(hdr, HDR_CONTENT_LENGTH, 0);
     httpHeaderPutStr(hdr, HDR_LOCATION, loc);
-    reply->date = squid_curtime;
+    reply->date = currentTimeC();
     reply->content_length = 0;
 }
 
@@ -319,9 +319,9 @@ httpReplyHdrExpirationTime(const HttpRep
 	     * header, but no Date for reference?
 	     */
 	    if (rep->cache_control->s_maxage >= 0)
-		return squid_curtime;
+		return currentTimeC();
 	    if (rep->cache_control->max_age >= 0)
-		return squid_curtime;
+		return currentTimeC();
 	}
     }
     if (Config.onoff.vary_ignore_expire &&
@@ -338,7 +338,7 @@ httpReplyHdrExpirationTime(const HttpRep
 	 * bad or malformed Expires header as equivalent to "expires
 	 * immediately."
 	 */
-	return e < 0 ? squid_curtime : e;
+	return e < 0 ? currentTimeC() : e;
     }
     return -1;
 }
Index: src/access_log.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/access_log.cc,v
retrieving revision 1.78
diff -u -w -p -r1.78 access_log.cc
--- src/access_log.cc	6 Dec 2002 23:19:13 -0000	1.78
+++ src/access_log.cc	15 Dec 2002 13:43:35 -0000
@@ -250,8 +250,8 @@ accessLogSquid(AccessLogEntry * al)
     if (user && !*user)
 	safe_free(user);
     logfilePrintf(logfile, "%9d.%03d %6d %s %s/%03d %ld %s %s %s %s%s/%s %s",
-	(int) current_time.tv_sec,
-	(int) current_time.tv_usec / 1000,
+	(int) currentTimeVal().tv_sec,
+	(int) currentTimeVal().tv_usec / 1000,
 	al->cache.msec,
 	client,
 	log_tags[al->cache.code],
@@ -282,7 +282,7 @@ accessLogCommon(AccessLogEntry * al)
 	client,
 	user2 ? user2 : dash_str,
 	user1 ? user1 : dash_str,
-	mkhttpdlogtime(&squid_curtime),
+	mkhttpdlogtime(currentTimeC()),
 	al->_private.method_str,
 	al->url,
 	al->http.version.major, al->http.version.minor,
Index: src/acl.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/acl.cc,v
retrieving revision 1.294
diff -u -w -p -r1.294 acl.cc
--- src/acl.cc	11 Dec 2002 11:57:38 -0000	1.294
+++ src/acl.cc	15 Dec 2002 13:43:36 -0000
@@ -1659,7 +1659,7 @@ aclMatchAcl(acl * ae, aclCheck_t * check
 	return aclMatchRegex((relist *)ae->data, "none");
 	/* NOTREACHED */
     case ACL_TIME:
-	return aclMatchTime((acl_time_data *)ae->data, squid_curtime);
+	return aclMatchTime((acl_time_data *)ae->data, currentTimeC());
 	/* NOTREACHED */
     case ACL_URLPATH_REGEX:
 	esc_buf = xstrdup(strBuf(r->urlpath));
Index: src/authenticate.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/authenticate.cc,v
retrieving revision 1.46
diff -u -w -p -r1.46 authenticate.cc
--- src/authenticate.cc	15 Oct 2002 09:25:33 -0000	1.46
+++ src/authenticate.cc	15 Dec 2002 13:43:36 -0000
@@ -335,8 +335,8 @@ authenticateAuthUserRequestSetIp(auth_us
 	    /* This ip has alreadu been seen. */
 	    found = 1;
 	    /* update IP ttl */
-	    ipdata->ip_expiretime = squid_curtime;
-	} else if (ipdata->ip_expiretime + Config.authenticateIpTTL < squid_curtime) {
+	    ipdata->ip_expiretime = currentTimeC();
+	} else if (ipdata->ip_expiretime + Config.authenticateIpTTL < currentTimeC()) {
 	    /* This IP has expired - remove from the seen list */
 	    dlinkDelete(&ipdata->node, &auth_user->ip_list);
 	    cbdataFree(ipdata);
@@ -352,7 +352,7 @@ authenticateAuthUserRequestSetIp(auth_us
 
     /* This ip is not in the seen list */
     ipdata = cbdataAlloc(auth_user_ip_t);
-    ipdata->ip_expiretime = squid_curtime;
+    ipdata->ip_expiretime = currentTimeC();
     ipdata->ipaddr = ipaddr;
     dlinkAddTail(ipdata, &ipdata->node, &auth_user->ip_list);
     auth_user->ipcount++;
@@ -996,7 +996,7 @@ AuthUser::cacheCleanup(void *datanotused
     auth_user_t *auth_user;
     char const *username = NULL;
     debug(29, 3) ("AuthUser::cacheCleanup: Cleaning the user cache now\n");
-    debug(29, 3) ("AuthUser::cacheCleanup: Current time: %ld\n", (long int) current_time.tv_sec);
+    debug(29, 3) ("AuthUser::cacheCleanup: Current time: %ld\n", (long int) currentTimeVal().tv_sec);
     hash_first(proxy_auth_username_cache);
     while ((usernamehash = ((AuthUserHashPointer *) hash_next(proxy_auth_username_cache)))) {
 	auth_user = usernamehash->user();
@@ -1005,7 +1005,7 @@ AuthUser::cacheCleanup(void *datanotused
 	/* if we need to have inpedendent expiry clauses, insert a module call
 	 * here */
 	debug(29, 4) ("AuthUser::cacheCleanup: Cache entry:\n\tType: %d\n\tUsername: %s\n\texpires: %ld\n\treferences: %ld\n", auth_user->auth_type, username, (long int) (auth_user->expiretime + Config.authenticateTTL), (long int) auth_user->references);
-	if (auth_user->expiretime + Config.authenticateTTL <= current_time.tv_sec) {
+	if (auth_user->expiretime + Config.authenticateTTL <= currentTimeVal().tv_sec) {
 	    debug(29, 5) ("AuthUser::cacheCleanup: Removing user %s from cache due to timeout.\n", username);
 	    /* the minus 1 accounts for the cache lock */
 	    if ((authenticateAuthUserInuse(auth_user) - 1))
Index: src/cache_manager.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/cache_manager.cc,v
retrieving revision 1.27
diff -u -w -p -r1.27 cache_manager.cc
--- src/cache_manager.cc	13 Oct 2002 20:34:59 -0000	1.27
+++ src/cache_manager.cc	15 Dec 2002 13:43:37 -0000
@@ -203,12 +203,12 @@ cachemgrStart(int fd, request_t * reques
 	err = errorCon(ERR_INVALID_URL, HTTP_NOT_FOUND);
 	err->url = xstrdup(storeUrl(entry));
 	errorAppendEntry(entry, err);
-	entry->expires = squid_curtime;
+	entry->expires = currentTimeC();
 	return;
     }
     mgr->entry = entry;
     storeLockObject(entry);
-    entry->expires = squid_curtime;
+    entry->expires = currentTimeC();
     debug(16, 5) ("CACHEMGR: %s requesting '%s'\n",
 	fd_table[fd].ipaddr, mgr->action);
     /* get additional info from request headers */
@@ -240,7 +240,7 @@ cachemgrStart(int fd, request_t * reques
 	httpReplyAbsorb(entry->mem_obj->reply, rep);
 	/* store the reply */
 	httpReplySwapOut(entry->mem_obj->reply, entry);
-	entry->expires = squid_curtime;
+	entry->expires = currentTimeC();
 	storeComplete(entry);
 	cachemgrStateFree(mgr);
 	return;
@@ -265,8 +265,8 @@ cachemgrStart(int fd, request_t * reques
 	    NULL,
 	    "text/plain",
 	    -1,			/* C-Len */
-	    squid_curtime,	/* LMT */
-	    squid_curtime);
+	    currentTimeC(),	/* LMT */
+	    currentTimeC());
 	httpReplySwapOut(rep, entry);
     }
     a->handler(entry);
Index: src/client_db.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/client_db.cc,v
retrieving revision 1.55
diff -u -w -p -r1.55 client_db.cc
--- src/client_db.cc	13 Oct 2002 20:34:59 -0000	1.55
+++ src/client_db.cc	15 Dec 2002 13:43:37 -0000
@@ -135,7 +135,7 @@ clientdbCutoffDenied(struct in_addr addr
     /*
      * If we are in a cutoff window, we don't send a reply
      */
-    if (squid_curtime - c->cutoff.time < CUTOFF_SECONDS)
+    if (currentTimeC() - c->cutoff.time < CUTOFF_SECONDS)
 	return 1;
     /*
      * Calculate the percent of DENIED replies since the last
@@ -152,7 +152,7 @@ clientdbCutoffDenied(struct in_addr addr
     debug(1, 0) ("WARNING: %d of the last %d ICP replies are DENIED\n", ND, NR);
     debug(1, 0) ("WARNING: No replies will be sent for the next %d seconds\n",
 	CUTOFF_SECONDS);
-    c->cutoff.time = squid_curtime;
+    c->cutoff.time = currentTimeC();
     c->cutoff.n_req = c->Icp.n_requests;
     c->cutoff.n_denied = c->Icp.result_hist[LOG_UDP_DENIED];
     return 1;
Index: src/client_side.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/client_side.cc,v
retrieving revision 1.609
diff -u -w -p -r1.609 client_side.cc
--- src/client_side.cc	6 Dec 2002 23:19:14 -0000	1.609
+++ src/client_side.cc	15 Dec 2002 13:43:37 -0000
@@ -353,7 +353,7 @@ clientUpdateCounters(clientHttpRequest *
     if (http->request->errType != ERR_NONE)
 	statCounter.client_http.errors++;
     clientUpdateStatHistCounters(http->logType,
-	tvSubMsec(http->start, current_time));
+	tvSubMsec(http->start, currentTimeVal()));
     clientUpdateHierCounters(&http->request->hier);
 }
 
@@ -404,7 +404,7 @@ clientLogRequest(clientHttpRequest * htt
 	http->al.cache.caddr = http->conn ? http->conn->log_addr : no_addr;
 	http->al.cache.size = http->out.size;
 	http->al.cache.code = http->logType;
-	http->al.cache.msec = tvSubMsec(http->start, current_time);
+	http->al.cache.msec = tvSubMsec(http->start, currentTimeVal());
 	if (http->request)
 	    clientPrepareLogWithRequestDetails(http->request, &http->al);
 	if (http->conn && http->conn->rfc931[0])
@@ -842,7 +842,7 @@ parseHttpRequestAbort(ConnStateData * co
     StoreIOBuffer tempBuffer = EMPTYIOBUFFER;
     http = cbdataAlloc(clientHttpRequest);
     http->conn = conn;
-    http->start = current_time;
+    http->start = currentTimeVal();
     http->req_sz = conn->in.notYetUsed;
     http->uri = xstrdup(uri);
     setLogUri (http, uri);
@@ -1126,7 +1126,7 @@ parseHttpRequest(ConnStateData * conn, m
     http = cbdataAlloc(clientHttpRequest);
     http->http_ver = http_ver;
     http->conn = conn;
-    http->start = current_time;
+    http->start = currentTimeVal();
     http->req_sz = prefix_sz;
     result = clientSocketContextNew(http);
     tempBuffer.data = result->reqbuf;
@@ -1168,7 +1168,7 @@ clientReadDefer(int fdnotused, void *dat
     if (conn->body.size_left)
 	return conn->in.notYetUsed >= conn->in.allocatedSize - 1;
     else
-	return conn->defer.until > squid_curtime;
+	return conn->defer.until > currentTimeC();
 }
 
 int
@@ -1454,7 +1454,7 @@ connOkToAddRequest(ConnStateData *conn)
 static void
 connSetDefer (ConnStateData *conn, size_t milliSeconds)
 {
-    conn->defer.until = squid_curtime + milliSeconds;
+    conn->defer.until = currentTimeC() + milliSeconds;
     conn->defer.n++;
 }
 
@@ -1765,9 +1765,9 @@ httpAcceptDefer(int fdunused, void *data
     static time_t last_warn = 0;
     if (fdNFree() >= RESERVED_FD)
 	return 0;
-    if (last_warn + 15 < squid_curtime) {
+    if (last_warn + 15 < currentTimeC()) {
 	debug(33, 0) ("WARNING! Your cache is running out of filedescriptors\n");
-	last_warn = squid_curtime;
+	last_warn = currentTimeC();
     }
     return 1;
 }
@@ -1979,14 +1979,14 @@ checkFailureRatio(err_type etype, hier_c
 	n_good++;
     }
     request_failure_ratio = n_bad / n_good;
-    if (hit_only_mode_until > squid_curtime)
+    if (hit_only_mode_until > currentTimeC())
 	return;
     if (request_failure_ratio < 1.0)
 	return;
     debug(33, 0) ("Failure Ratio at %4.2f\n", request_failure_ratio);
     debug(33, 0) ("Going into hit-only-mode for %d minutes...\n",
 	FAILURE_MODE_TIME / 60);
-    hit_only_mode_until = squid_curtime + FAILURE_MODE_TIME;
+    hit_only_mode_until = currentTimeC() + FAILURE_MODE_TIME;
     request_failure_ratio = 0.8;	/* reset to something less than 1.0 */
 }
 
Index: src/client_side_reply.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/client_side_reply.cc,v
retrieving revision 1.26
diff -u -w -p -r1.26 client_side_reply.cc
--- src/client_side_reply.cc	15 Nov 2002 14:18:30 -0000	1.26
+++ src/client_side_reply.cc	15 Dec 2002 13:43:38 -0000
@@ -468,7 +468,7 @@ clientHandleIMSReply(void *data, StoreIO
 	httpReplyUpdateOnNotModified(oldentry->mem_obj->reply, mem->reply);
 	storeTimestampsSet(oldentry);
 	clientRemoveStoreReference(context, &context->sc, &entry);
-	oldentry->timestamp = squid_curtime;
+	oldentry->timestamp = currentTimeC();
 	if (unlink_request) {
 	    requestUnlink(oldentry->mem_obj->request);
 	    oldentry->mem_obj->request = NULL;
@@ -977,7 +977,7 @@ clientTraceReply(clientStreamNode * node
     rep = httpReplyCreate();
     httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(rep, version, HTTP_OK, NULL, "text/plain",
-	httpRequestPrefixLen(context->http->request), 0, squid_curtime);
+	httpRequestPrefixLen(context->http->request), 0, currentTimeC());
     httpReplySwapOut(rep, context->http->entry);
     httpReplyDestroy(rep);
     httpRequestSwapOut(context->http->request, context->http->entry);
@@ -1252,9 +1252,9 @@ clientBuildReplyHeader(clientReplyContex
 	    (void) 0;
 	else if (http->entry->timestamp < 0)
 	    (void) 0;
-	else if (http->entry->timestamp < squid_curtime)
+	else if (http->entry->timestamp < currentTimeC())
 	    httpHeaderPutInt(hdr, HDR_AGE,
-		squid_curtime - http->entry->timestamp);
+		currentTimeC() - http->entry->timestamp);
     }
     /* Filter unproxyable authentication types */
     if (http->logType != LOG_TCP_DENIED &&
Index: src/client_side_request.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/client_side_request.cc,v
retrieving revision 1.8
diff -u -w -p -r1.8 client_side_request.cc
--- src/client_side_request.cc	22 Oct 2002 21:16:11 -0000	1.8
+++ src/client_side_request.cc	15 Dec 2002 13:43:38 -0000
@@ -116,7 +116,7 @@ clientBeginRequest(method_t method, char
     StoreIOBuffer tempBuffer = EMPTYIOBUFFER;
     http->http_ver = http_ver;
     http->conn = NULL;
-    http->start = current_time;
+    http->start = currentTimeVal();
     /* this is only used to adjust the connection offset in client_side.c */
     http->req_sz = 0;
     tempBuffer.length = taillen;
Index: src/comm.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/comm.cc,v
retrieving revision 1.360
diff -u -w -p -r1.360 comm.cc
--- src/comm.cc	6 Dec 2002 23:19:15 -0000	1.360
+++ src/comm.cc	15 Dec 2002 13:43:39 -0000
@@ -749,9 +749,9 @@ comm_accept_check_event(void *data)
 		commSetSelect(fd, COMM_SELECT_READ, comm_accept_try, NULL, 0);
 		return;
 	}
-	if (last_warn + 15 < squid_curtime) {
+	if (last_warn + 15 < currentTimeC()) {
 		debug(33, 0) ("WARNING! Your cache is running out of filedescriptors\n");
-		last_warn = squid_curtime;
+		last_warn = currentTimeC();
 	}
 	eventAdd("comm_accept_check_event", comm_accept_check_event, &fdc_table[fd],
 	    1000.0 / (double)(fdc_table[fd].accept.check_delay), 1);
@@ -967,7 +967,7 @@ commConnectDnsHandle(const ipcache_addrs
     cs->in_addr = ia->in_addrs[ia->cur];
     ipcacheCycleAddr(cs->host, NULL);
     cs->addrcount = ia->count;
-    cs->connstart = squid_curtime;
+    cs->connstart = currentTimeC();
     commConnectHandle(cs->fd, cs);
 }
 
@@ -1060,7 +1060,7 @@ commRetryConnect(ConnectStateData * cs)
     if (cs->addrcount == 1) {
 	if (cs->tries >= Config.retry.maxtries)
 	    return 0;
-	if (squid_curtime - cs->connstart > Config.Timeout.connect)
+	if (currentTimeC() - cs->connstart > Config.Timeout.connect)
 	    return 0;
     } else {
 	if (cs->tries > cs->addrcount)
@@ -1125,7 +1125,7 @@ commSetTimeout(int fd, int timeout, PF *
 	    F->timeout_handler = handler;
 	    F->timeout_data = cbdataReference(data);
 	}
-	F->timeout = squid_curtime + (time_t) timeout;
+	F->timeout = currentTimeC() + (time_t) timeout;
     }
     return F->timeout;
 }
@@ -1757,7 +1757,7 @@ checkTimeouts(void)
 	    continue;
 	if (F->timeout == 0)
 	    continue;
-	if (F->timeout > squid_curtime)
+	if (F->timeout > currentTimeC())
 	    continue;
 	debug(5, 5) ("checkTimeouts: FD %d Expired\n", fd);
 	if (F->timeout_handler) {
Index: src/comm_kqueue.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/comm_kqueue.cc,v
retrieving revision 1.6
diff -u -w -p -r1.6 comm_kqueue.cc
--- src/comm_kqueue.cc	28 Oct 2002 00:37:36 -0000	1.6
+++ src/comm_kqueue.cc	15 Dec 2002 13:43:39 -0000
@@ -200,7 +200,7 @@ commSetSelect(int fd, unsigned int type,
         F->write_data = client_data;
     }
     if (timeout)
-        F->timeout = squid_curtime + timeout;
+        F->timeout = currentTimeC() + timeout;
 
 }
 
Index: src/comm_poll.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/comm_poll.cc,v
retrieving revision 1.8
diff -u -w -p -r1.8 comm_poll.cc
--- src/comm_poll.cc	28 Oct 2002 01:12:28 -0000	1.8
+++ src/comm_poll.cc	15 Dec 2002 13:43:39 -0000
@@ -144,7 +144,7 @@ commSetSelect(int fd, unsigned int type,
 	commUpdateWriteBits(fd, handler);
     }
     if (timeout)
-	F->timeout = squid_curtime + timeout;
+	F->timeout = currentTimeC() + timeout;
 }
 
 static int
@@ -330,11 +330,11 @@ comm_select(int msec)
     int callicp = 0, callhttp = 0;
     int calldns = 0;
     static time_t last_timeout = 0;
-    double timeout = current_dtime + (msec / 1000.0);
+    double timeout = currentDTime() + (msec / 1000.0);
     do {
 	double start;
 	getCurrentTime();
-	start = current_dtime;
+	start = currentDTime();
 #if DELAY_POOLS
 	FD_ZERO(&slowfds);
 #endif
@@ -408,8 +408,8 @@ comm_select(int msec)
 	debug(5, num ? 5 : 8) ("comm_poll: %d+%ld FDs ready\n", num, npending);
 	statHistCount(&statCounter.select_fds_hist, num);
 	/* Check timeout handlers ONCE each second. */
-	if (squid_curtime > last_timeout) {
-	    last_timeout = squid_curtime;
+	if (currentTimeC() > last_timeout) {
+	    last_timeout = currentTimeC();
 	    checkTimeouts();
 	}
 	if (num == 0 && npending == 0)
@@ -529,11 +529,11 @@ comm_select(int msec)
 	}
 #endif
 	getCurrentTime();
-	statCounter.select_time += (current_dtime - start);
+	statCounter.select_time += (currentDTime() - start);
 	return COMM_OK;
     }
-    while (timeout > current_dtime);
-    debug(5, 8) ("comm_poll: time out: %ld.\n", (long int) squid_curtime);
+    while (timeout > currentDTime());
+    debug(5, 8) ("comm_poll: time out: %ld.\n", (long int) currentTimeC());
     return COMM_TIMEOUT;
 }
 
Index: src/comm_select.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/comm_select.cc,v
retrieving revision 1.64
diff -u -w -p -r1.64 comm_select.cc
--- src/comm_select.cc	15 Nov 2002 13:29:20 -0000	1.64
+++ src/comm_select.cc	15 Dec 2002 13:43:39 -0000
@@ -146,7 +146,7 @@ commSetSelect(int fd, unsigned int type,
 	commUpdateWriteBits(fd, handler);
     }
     if (timeout)
-	F->timeout = squid_curtime + timeout;
+	F->timeout = currentTimeC() + timeout;
 }
 
 
@@ -341,7 +341,7 @@ comm_select(int msec)
     fd_mask tmask;
     static time_t last_timeout = 0;
     struct timeval poll_time;
-    double timeout = current_dtime + (msec / 1000.0);
+    double timeout = currentDTime() + (msec / 1000.0);
     fde *F;
     do {
 	getCurrentTime();
@@ -435,12 +435,12 @@ comm_select(int msec)
 	if (num < 0 && !pending)
 	    continue;
 	debug(5, num ? 5 : 8) ("comm_select: %d+%d FDs ready at %d\n",
-	    num, pending, (int) squid_curtime);
+	    num, pending, (int) currentTimeC());
 	statHistCount(&statCounter.select_fds_hist, num);
 	/* Check lifetime and timeout handlers ONCE each second.
 	 * Replaces brain-dead check every time through the loop! */
-	if (squid_curtime > last_timeout) {
-	    last_timeout = squid_curtime;
+	if (currentTimeC() > last_timeout) {
+	    last_timeout = currentTimeC();
 	    checkTimeouts();
 	}
 	if (num == 0 && pending == 0)
@@ -568,8 +568,8 @@ comm_select(int msec)
 #endif
 	return COMM_OK;
     }
-    while (timeout > current_dtime);
-    debug(5, 8) ("comm_select: time out: %d\n", (int) squid_curtime);
+    while (timeout > currentDTime());
+    debug(5, 8) ("comm_select: time out: %d\n", (int) currentTimeC());
     return COMM_TIMEOUT;
 }
 
Index: src/debug.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/debug.cc,v
retrieving revision 1.85
diff -u -w -p -r1.85 debug.cc
--- src/debug.cc	1 Sep 2002 15:16:35 -0000	1.85
+++ src/debug.cc	15 Dec 2002 13:43:39 -0000
@@ -75,7 +75,7 @@ _db_print(va_alist)
     format = va_arg(args1, const char *);
 #endif
     snprintf(f, BUFSIZ, "%s| %s",
-	debugLogTime(squid_curtime),
+	debugLogTime(currentTimeC()),
 	format);
     _db_print_file(f, args1);
     _db_print_stderr(f, args2);
Index: src/delay_pools.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/delay_pools.cc,v
retrieving revision 1.29
diff -u -w -p -r1.29 delay_pools.cc
--- src/delay_pools.cc	14 Oct 2002 08:43:46 -0000	1.29
+++ src/delay_pools.cc	15 Dec 2002 13:43:40 -0000
@@ -538,7 +538,7 @@ delayUpdateClass3(class3DelayPool * clas
 void
 delayPoolsUpdate(void *unused)
 {
-    int incr = squid_curtime - delay_pools_last_update;
+    int incr = currentTimeC() - delay_pools_last_update;
     unsigned short i;
     unsigned char delay_class;
     if (!Config.Delay.pools)
@@ -546,7 +546,7 @@ delayPoolsUpdate(void *unused)
     eventAdd("delayPoolsUpdate", delayPoolsUpdate, NULL, 1.0, 1);
     if (incr < 1)
 	return;
-    delay_pools_last_update = squid_curtime;
+    delay_pools_last_update = currentTimeC();
     for (i = 0; i < Config.Delay.pools; i++) {
 	delay_class = Config.Delay.delay_class[i];
 	if (!delay_class)
Index: src/dns.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/dns.cc,v
retrieving revision 1.89
diff -u -w -p -r1.89 dns.cc
--- src/dns.cc	15 Nov 2002 13:28:33 -0000	1.89
+++ src/dns.cc	15 Dec 2002 13:43:40 -0000
@@ -94,8 +94,8 @@ dnsSubmit(const char *lookup, HLPCB * ca
     snprintf(buf, 256, "%s\n", lookup);
     if (dnsservers->stats.queue_size >= dnsservers->n_running * 2) {
 	if (first_warn == 0)
-	    first_warn = squid_curtime;
-	if (squid_curtime - first_warn > 3 * 60)
+	    first_warn = currentTimeC();
+	if (currentTimeC() - first_warn > 3 * 60)
 	    fatal("DNS servers not responding for 3 minutes");
 	debug(34, 1) ("dnsSubmit: queue overload, rejecting %s\n", lookup);
 	callback(data, "$fail Temporary network problem, please retry later");
Index: src/dns_internal.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/dns_internal.cc,v
retrieving revision 1.50
diff -u -w -p -r1.50 dns_internal.cc
--- src/dns_internal.cc	21 Oct 2002 06:43:07 -0000	1.50
+++ src/dns_internal.cc	15 Dec 2002 13:43:40 -0000
@@ -340,8 +340,8 @@ idnsStats(StoreEntry * sentry)
 	q = (idns_query *)n->data;
 	storeAppendPrintf(sentry, "%#06x %4d %5d %10.3f %9.3f\n",
 	    (int) q->id, (int) q->sz, q->nsends,
-	    tvSubDsec(q->start_t, current_time),
-	    tvSubDsec(q->sent_t, current_time));
+	    tvSubDsec(q->start_t, currentTimeVal()),
+	    tvSubDsec(q->sent_t, currentTimeVal()));
     }
     storeAppendPrintf(sentry, "\nNameservers:\n");
     storeAppendPrintf(sentry, "IP ADDRESS      # QUERIES # REPLIES\n");
@@ -397,7 +397,7 @@ idnsSendQuery(idns_query * q)
 	q->buf,
 	q->sz);
     q->nsends++;
-    q->sent_t = current_time;
+    q->sent_t = currentTimeVal();
     if (x < 0) {
 	debug(50, 1) ("idnsSendQuery: FD %d: sendto: %s\n",
 	    DnsSocket, xstrerror());
@@ -475,7 +475,7 @@ idnsGrokReply(const char *buf, size_t sz
 	     * the name server."
 	     */
 	    assert(NULL == answers);
-	    q->start_t = current_time;
+	    q->start_t = currentTimeVal();
 	    q->id = rfc1035RetryQuery(q->buf);
 	    idnsSendQuery(q);
 	    return;
@@ -531,10 +531,10 @@ idnsRead(int fd, void *data)
 	    nameservers[ns].nreplies++;
 	} else if (Config.onoff.ignore_unknown_nameservers) {
 	    static time_t last_warning = 0;
-	    if (squid_curtime - last_warning > 60) {
+	    if (currentTimeC() - last_warning > 60) {
 		debug(78, 1) ("WARNING: Reply from unknown nameserver [%s]\n",
 		    inet_ntoa(from.sin_addr));
-		last_warning = squid_curtime;
+		last_warning = currentTimeC();
 	    }
 	    continue;
 	}
@@ -573,20 +573,20 @@ idnsCheckQueue(void *unused)
 	    /* name servers went away; reconfiguring or shutting down */
 	    break;
 	q = (idns_query *)n->data;
-	if (tvSubDsec(q->sent_t, current_time) < Config.Timeout.idns_retransmit * (1 << q->nsends % nns))
+	if (tvSubDsec(q->sent_t, currentTimeVal()) < Config.Timeout.idns_retransmit * (1 << q->nsends % nns))
 	    break;
 	debug(78, 3) ("idnsCheckQueue: ID %#04x timeout\n",
 	    q->id);
 	p = n->prev;
 	dlinkDelete(&q->lru, &lru_list);
-	if (tvSubDsec(q->start_t, current_time) < Config.Timeout.idns_query) {
+	if (tvSubDsec(q->start_t, currentTimeVal()) < Config.Timeout.idns_query) {
 	    idnsSendQuery(q);
 	} else {
 	    IDNSCB *callback;
 	    void *cbdata;
 	    debug(78, 2) ("idnsCheckQueue: ID %x: giving up after %d tries and %5.1f seconds\n",
 		(int) q->id, q->nsends,
-		tvSubDsec(q->start_t, current_time));
+		tvSubDsec(q->start_t, currentTimeVal()));
 	    callback = q->callback;
 	    q->callback = NULL;
 	    if (cbdataReferenceValidDone(q->callback_data, &cbdata))
@@ -695,7 +695,7 @@ idnsALookup(const char *name, IDNSCB * c
 	(int) q->sz, name, q->id);
     q->callback = callback;
     q->callback_data = cbdataReference(data);
-    q->start_t = current_time;
+    q->start_t = currentTimeVal();
     idnsSendQuery(q);
 }
 
@@ -709,7 +709,7 @@ idnsPTRLookup(const struct in_addr addr,
 	(int) q->sz, inet_ntoa(addr), q->id);
     q->callback = callback;
     q->callback_data = cbdataReference(data);
-    q->start_t = current_time;
+    q->start_t = currentTimeVal();
     idnsSendQuery(q);
 }
 
Index: src/errorpage.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/errorpage.cc,v
retrieving revision 1.180
diff -u -w -p -r1.180 errorpage.cc
--- src/errorpage.cc	25 Oct 2002 07:36:32 -0000	1.180
+++ src/errorpage.cc	15 Dec 2002 13:43:40 -0000
@@ -444,7 +444,7 @@ errorDump(ErrorState * err, MemBuf * mb)
 	memBufPrintf(&str, "DNS Server ErrMsg: %s\r\n", err->dnsserver_msg);
     }
     /* - TimeStamp */
-    memBufPrintf(&str, "TimeStamp: %s\r\n\r\n", mkrfc1123(squid_curtime));
+    memBufPrintf(&str, "TimeStamp: %s\r\n\r\n", mkrfc1123(currentTimeC()));
     /* - IP stuff */
     memBufPrintf(&str, "ClientIP: %s\r\n", inet_ntoa(err->src_addr));
     if (err->host) {
@@ -631,10 +631,10 @@ errorConvert(char token, ErrorState * er
 	}
 	break;
     case 't':
-	memBufPrintf(&mb, "%s", mkhttpdlogtime(&squid_curtime));
+	memBufPrintf(&mb, "%s", mkhttpdlogtime(currentTimeC()));
 	break;
     case 'T':
-	memBufPrintf(&mb, "%s", mkrfc1123(squid_curtime));
+	memBufPrintf(&mb, "%s", mkrfc1123(currentTimeC()));
 	break;
     case 'U':
 	p = r ? urlCanonicalClean(r) : err->url ? err->url : "[no URL]";
@@ -686,12 +686,12 @@ errorBuildReply(ErrorState * err)
     if (strchr(name, ':')) {
 	/* Redirection */
 	char *quoted_url = rfc1738_escape_part(errorConvert('u', err));
-	httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL, "text/html", 0, 0, squid_curtime);
+	httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL, "text/html", 0, 0, currentTimeC());
 	httpHeaderPutStrf(&rep->header, HDR_LOCATION, name, quoted_url);
 	httpHeaderPutStrf(&rep->header, HDR_X_SQUID_ERROR, "%d %s\n", err->httpStatus, "Access Denied");
     } else {
 	MemBuf content = errorBuildContent(err);
-	httpReplySetHeaders(rep, version, err->httpStatus, NULL, "text/html", content.size, 0, squid_curtime);
+	httpReplySetHeaders(rep, version, err->httpStatus, NULL, "text/html", content.size, 0, currentTimeC());
 	/*
 	 * include some information for downstream caches. Implicit
 	 * replaceable content. This isn't quite sufficient. xerrno is not
Index: src/event.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/event.cc,v
retrieving revision 1.34
diff -u -w -p -r1.34 event.cc
--- src/event.cc	15 Nov 2002 13:29:20 -0000	1.34
+++ src/event.cc	15 Dec 2002 13:43:40 -0000
@@ -60,7 +60,7 @@ eventAdd(const char *name, EVH * func, v
     event->func = func;
     event->arg = cbdataReference(arg);
     event->name = name;
-    event->when = current_dtime + when;
+    event->when = currentDTime() + when;
     event->weight = weight;
     event->id = run_id;
     debug(41, 7) ("eventAdd: Adding '%s', in %f seconds\n", name, when);
@@ -113,14 +113,14 @@ eventRun(void)
     int weight = 0;
     if (NULL == tasks)
 	return;
-    if (tasks->when > current_dtime)
+    if (tasks->when > currentDTime())
 	return;
     run_id++;
     debug(41, 5) ("eventRun: RUN ID %d\n", run_id);
     while ((event = tasks)) {
 	EVH *callback;
 	void *cbdata;
-	if (event->when > current_dtime)
+	if (event->when > currentDTime())
 	    break;
 	if (event->id == run_id)	/* was added during this run */
 	    break;
@@ -146,7 +146,7 @@ eventNextTime(void)
 {
     if (!tasks)
 	return (int) 10;
-    return (int) ((tasks->when - current_dtime) * 1000);
+    return (int) ((tasks->when - currentDTime()) * 1000);
 }
 
 void
@@ -171,7 +171,7 @@ eventDump(StoreEntry * sentry)
 	"Callback Valid?");
     while (e != NULL) {
 	storeAppendPrintf(sentry, "%s\t%f seconds\t%d\t%s\n",
-	    e->name, e->when - current_dtime, e->weight,
+	    e->name, e->when - currentDTime(), e->weight,
 	    e->arg ? cbdataReferenceValid(e->arg) ? "yes" : "no" : "N/A");
 	e = e->next;
     }
Index: src/external_acl.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/external_acl.cc,v
retrieving revision 1.21
diff -u -w -p -r1.21 external_acl.cc
--- src/external_acl.cc	9 Dec 2002 16:55:24 -0000	1.21
+++ src/external_acl.cc	15 Dec 2002 13:43:40 -0000
@@ -613,7 +613,7 @@ makeExternalAclKey(aclCheck_t * ch, exte
 static int
 external_acl_entry_expired(external_acl * def, external_acl_entry * entry)
 {
-    if (entry->date + (entry->result == 1 ? def->ttl : def->negative_ttl) < squid_curtime)
+    if (entry->date + (entry->result == 1 ? def->ttl : def->negative_ttl) < currentTimeC())
 	return 1;
     else
 	return 0;
@@ -635,7 +635,7 @@ external_acl_cache_add(external_acl * de
     debug(82, 2) ("external_acl_cache_add: Adding '%s' = %d\n", key, result);
     if (entry) {
 	debug(82, 3) ("external_acl_cache_add: updating existing entry\n");
-	entry->date = squid_curtime;
+	entry->date = currentTimeC();
 	entry->result = result;
 	safe_free(entry->user);
 	safe_free(entry->error);
@@ -652,7 +652,7 @@ external_acl_cache_add(external_acl * de
 	external_acl_cache_delete(def, static_cast<external_acl_entry *>(def->lru_list.tail->data));
     entry = cbdataAlloc(external_acl_entry);
     entry->key = xstrdup(key);
-    entry->date = squid_curtime;
+    entry->date = currentTimeC();
     entry->result = result;
     if (user)
 	entry->user = xstrdup(user);
Index: src/fd.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/fd.cc,v
retrieving revision 1.45
diff -u -w -p -r1.45 fd.cc
--- src/fd.cc	13 Oct 2002 20:35:01 -0000	1.45
+++ src/fd.cc	15 Dec 2002 13:43:40 -0000
@@ -188,7 +188,7 @@ fdAdjustReserved(void)
     /*
      * don't update too frequently
      */
-    if (last + 5 > squid_curtime)
+    if (last + 5 > currentTimeC())
 	return;
     /*
      * Calculate a new reserve, based on current usage and a small extra
Index: src/forward.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/forward.cc,v
retrieving revision 1.90
diff -u -w -p -r1.90 forward.cc
--- src/forward.cc	6 Dec 2002 23:19:15 -0000	1.90
+++ src/forward.cc	15 Dec 2002 13:43:41 -0000
@@ -135,7 +135,7 @@ fwdCheckRetry(FwdState * fwdState)
 	return 0;
     if (fwdState->n_tries > 10)
 	return 0;
-    if (squid_curtime - fwdState->start > Config.Timeout.connect)
+    if (currentTimeC() - fwdState->start > Config.Timeout.connect)
 	return 0;
     if (fwdState->flags.dont_retry)
 	return 0;
@@ -154,7 +154,7 @@ fwdServerClosed(int fd, void *data)
     if (fwdCheckRetry(fwdState)) {
 	debug(17, 3) ("fwdServerClosed: re-forwarding (%d tries, %d secs)\n",
 	    fwdState->n_tries,
-	    (int) (squid_curtime - fwdState->start));
+	    (int) (currentTimeC() - fwdState->start));
 	if (fwdState->servers->next) {
 	    /* use next, or cycle if origin server isn't last */
 	    FwdServer *fs = fwdState->servers;
@@ -713,7 +713,7 @@ fwdStart(int fd, StoreEntry * e, request
     fwdState->client_fd = fd;
     fwdState->server_fd = -1;
     fwdState->request = requestLink(r);
-    fwdState->start = squid_curtime;
+    fwdState->start = currentTimeC();
     storeLockObject(e);
     EBIT_SET(e->flags, ENTRY_FWD_HDR_WAIT);
     storeRegisterAbort(e, fwdAbort, fwdState);
@@ -919,8 +919,8 @@ fwdLog(FwdState * fwdState)
     if (NULL == logfile)
 	return;
     logfilePrintf(logfile, "%9d.%03d %03d %s %s\n",
-	(int) current_time.tv_sec,
-	(int) current_time.tv_usec / 1000,
+	(int) currentTimeVal().tv_sec,
+	(int) currentTimeVal().tv_usec / 1000,
 	fwdState->last_status,
 	RequestMethodStr[fwdState->request->method],
 	fwdState->request->canonical);
Index: src/fqdncache.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/fqdncache.cc,v
retrieving revision 1.152
diff -u -w -p -r1.152 fqdncache.cc
--- src/fqdncache.cc	13 Oct 2002 20:35:01 -0000	1.152
+++ src/fqdncache.cc	15 Dec 2002 13:43:41 -0000
@@ -130,7 +130,7 @@ fqdncacheExpiredEntry(const fqdncache_en
     /* all static entries are locked, so this takes care of them too */
     if (f->locks != 0)
 	return 0;
-    if (f->expires > squid_curtime)
+    if (f->expires > currentTimeC())
 	return 0;
     return 1;
 }
@@ -183,7 +183,7 @@ fqdncacheCreateEntry(const char *name)
     static fqdncache_entry *f;
     f = (fqdncache_entry *)memAllocate(MEM_FQDNCACHE_ENTRY);
     f->hash.key = xstrdup(name);
-    f->expires = squid_curtime + Config.negativeDnsTtl;
+    f->expires = currentTimeC() + Config.negativeDnsTtl;
     return f;
 }
 
@@ -198,7 +198,7 @@ fqdncacheAddEntry(fqdncache_entry * f)
     }
     hash_join(fqdn_table, &f->hash);
     dlinkAdd(f, &f->lru, &lru_list);
-    f->lastref = squid_curtime;
+    f->lastref = currentTimeC();
 }
 
 /* walks down the pending list, calling handlers */
@@ -207,7 +207,7 @@ fqdncacheCallback(fqdncache_entry * f)
 {
     FQDNH *callback;
     void *cbdata;
-    f->lastref = squid_curtime;
+    f->lastref = currentTimeC();
     if (!f->handler)
 	return;
     fqdncacheLockEntry(f);
@@ -229,7 +229,7 @@ fqdncacheParse(const char *inbuf)
     static fqdncache_entry f;
     int ttl;
     memset(&f, '\0', sizeof(f));
-    f.expires = squid_curtime;
+    f.expires = currentTimeC();
     f.flags.negcached = 1;
     if (inbuf == NULL) {
 	debug(35, 1) ("fqdncacheParse: Got <NULL> reply\n");
@@ -243,7 +243,7 @@ fqdncacheParse(const char *inbuf)
 	return &f;
     }
     if (0 == strcmp(token, "$fail")) {
-	f.expires = squid_curtime + Config.negativeDnsTtl;
+	f.expires = currentTimeC() + Config.negativeDnsTtl;
 	token = strtok(NULL, "\n");
 	assert(NULL != token);
 	f.error_message = xstrdup(token);
@@ -261,9 +261,9 @@ fqdncacheParse(const char *inbuf)
     f.flags.negcached = 0;
     ttl = atoi(token);
     if (ttl > 0)
-	f.expires = squid_curtime + ttl;
+	f.expires = currentTimeC() + ttl;
     else
-	f.expires = squid_curtime + Config.positiveDnsTtl;
+	f.expires = currentTimeC() + Config.positiveDnsTtl;
     token = strtok(NULL, w_space);
     if (NULL != token) {
 	f.names[0] = xstrdup(token);
@@ -278,7 +278,7 @@ fqdncacheParse(rfc1035_rr * answers, int
     int k;
     int na = 0;
     memset(&f, '\0', sizeof(f));
-    f.expires = squid_curtime;
+    f.expires = currentTimeC();
     f.flags.negcached = 1;
     if (nr < 0) {
 	debug(35, 3) ("fqdncacheParse: Lookup failed (error %d)\n",
@@ -303,7 +303,7 @@ fqdncacheParse(rfc1035_rr * answers, int
 	f.flags.negcached = 0;
 	f.names[0] = xstrdup(answers[k].rdata);
 	f.name_count = 1;
-	f.expires = squid_curtime + answers[k].ttl;
+	f.expires = currentTimeC() + answers[k].ttl;
 	return &f;
     }
     debug(35, 1) ("fqdncacheParse: No PTR record\n");
@@ -327,7 +327,7 @@ fqdncacheHandleReply(void *data, rfc1035
     c = NULL;
     n = ++FqdncacheStats.replies;
     statHistCount(&statCounter.dns.svc_time,
-	tvSubMsec(f->request_time, current_time));
+	tvSubMsec(f->request_time, currentTimeVal()));
 #if USE_DNSSERVERS
     x = fqdncacheParse(reply);
 #else
@@ -384,7 +384,7 @@ fqdncache_nbgethostbyaddr(struct in_addr
     f = fqdncacheCreateEntry(name);
     f->handler = handler;
     f->handlerData = cbdataReference(handlerData);
-    f->request_time = current_time;
+    f->request_time = currentTimeVal();
     c = cbdataAlloc(generic_cbdata);
     c->data = f;
 #if USE_DNSSERVERS
@@ -437,7 +437,7 @@ fqdncache_gethostbyaddr(struct in_addr a
 	return NULL;
     } else {
 	FqdncacheStats.hits++;
-	f->lastref = squid_curtime;
+	f->lastref = currentTimeC();
 	return f->names[0];
     }
     /* check if it's already a FQDN address in text form. */
@@ -477,7 +477,7 @@ fqdnStats(StoreEntry * sentry)
 	"Address", "Flg", "TTL", "Cnt", "Hostnames");
     hash_first(fqdn_table);
     while ((f = (fqdncache_entry *) hash_next(fqdn_table))) {
-	ttl = (f->flags.fromhosts ? -1 : (f->expires - squid_curtime));
+	ttl = (f->flags.fromhosts ? -1 : (f->expires - currentTimeC()));
 	storeAppendPrintf(sentry, "%-15.15s  %c%c %3.3d % 3d",
 	    hashKeyStr(&f->hash),
 	    f->flags.negcached ? 'N' : ' ',
Index: src/ftp.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/ftp.cc,v
retrieving revision 1.337
diff -u -w -p -r1.337 ftp.cc
--- src/ftp.cc	21 Oct 2002 15:35:12 -0000	1.337
+++ src/ftp.cc	15 Dec 2002 13:43:41 -0000
@@ -356,7 +356,7 @@ ftpListingStart(FtpStateData * ftpState)
     storeBuffer(e);
     storeAppendPrintf(e, "<!-- HTML listing generated by Squid %s -->\n",
 	version_string);
-    storeAppendPrintf(e, "<!-- %s -->\n", mkrfc1123(squid_curtime));
+    storeAppendPrintf(e, "<!-- %s -->\n", mkrfc1123(currentTimeC()));
     storeAppendPrintf(e, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
     storeAppendPrintf(e, "<HTML><HEAD><TITLE>\n");
     storeAppendPrintf(e, "FTP Directory: %s\n",
@@ -425,7 +425,7 @@ ftpListingFinish(FtpStateData * ftpState
     storeAppendPrintf(e, "<HR noshade size=\"1px\">\n");
     storeAppendPrintf(e, "<ADDRESS>\n");
     storeAppendPrintf(e, "Generated %s by %s (%s)\n",
-	mkrfc1123(squid_curtime),
+	mkrfc1123(currentTimeC()),
 	getMyHostname(),
 	full_appname_string);
     storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n");
Index: src/globals.h
===================================================================
RCS file: /cvsroot/squid/squid3/src/globals.h,v
retrieving revision 1.115
diff -u -w -p -r1.115 globals.h
--- src/globals.h	6 Dec 2002 23:19:15 -0000	1.115
+++ src/globals.h	15 Dec 2002 13:43:41 -0000
@@ -111,9 +111,7 @@ extern struct in_addr local_addr;
 extern struct in_addr no_addr;
 extern struct in_addr theOutICPAddr;
 extern struct in_addr theOutSNMPAddr;
-extern struct timeval current_time;
 extern struct timeval squid_start;
-extern time_t squid_curtime;	/* 0 */
 extern int shutting_down;	/* 0 */
 extern int reconfiguring;	/* 0 */
 extern int store_dirs_rebuilding;	/* 1 */
@@ -126,7 +124,6 @@ extern char *icp_opcode_str[];
 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: src/gopher.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/gopher.cc,v
retrieving revision 1.177
diff -u -w -p -r1.177 gopher.cc
--- src/gopher.cc	21 Oct 2002 15:31:44 -0000	1.177
+++ src/gopher.cc	15 Dec 2002 13:43:42 -0000
@@ -151,7 +151,7 @@ gopherMimeCreate(GopherStateData * gophe
 	"HTTP/1.0 200 OK Gatewaying\r\n"
 	"Server: Squid/%s\r\n"
 	"Date: %s\r\n",
-	version_string, mkrfc1123(squid_curtime));
+	version_string, mkrfc1123(currentTimeC()));
 
     switch (gopherState->type_id) {
 
@@ -258,7 +258,7 @@ gopherHTMLFooter(StoreEntry * e)
     storeAppendPrintf(e, "<HR noshade size=\"1px\">\n");
     storeAppendPrintf(e, "<ADDRESS>\n");
     storeAppendPrintf(e, "Generated %s by %s (%s)\n",
-	mkrfc1123(squid_curtime),
+	mkrfc1123(currentTimeC()),
 	getMyHostname(),
 	full_appname_string);
     storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n");
Index: src/helper.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/helper.cc,v
retrieving revision 1.54
diff -u -w -p -r1.54 helper.cc
--- src/helper.cc	23 Oct 2002 09:15:00 -0000	1.54
+++ src/helper.cc	15 Dec 2002 13:43:42 -0000
@@ -428,7 +428,7 @@ helperStats(StoreEntry * sentry, helper 
     for (link = hlp->servers.head; link; link = link->next) {
 	srv = (helper_server*)link->data;
 	tt = 0.001 * tvSubMsec(srv->dispatch_time,
-	    srv->flags.busy ? current_time : srv->answer_time);
+	    srv->flags.busy ? currentTimeVal() : srv->answer_time);
 	storeAppendPrintf(sentry, "%7d\t%7d\t%7d\t%11d\t%c%c%c%c\t%7.3f\t%7d\t%s\n",
 	    srv->index + 1,
 	    srv->rfd,
@@ -478,7 +478,7 @@ helperStatefulStats(StoreEntry * sentry,
 	"Request");
     for (link = hlp->servers.head; link; link = link->next) {
 	srv = (helper_stateful_server *)link->data;
-	tt = 0.001 * tvSubMsec(srv->dispatch_time, current_time);
+	tt = 0.001 * tvSubMsec(srv->dispatch_time, currentTimeVal());
 	storeAppendPrintf(sentry, "%7d\t%7d\t%7d\t%11d\t%11d\t%c%c%c%c%c%c\t%7.3f\t%7d\t%s\n",
 	    srv->index + 1,
 	    srv->rfd,
@@ -744,10 +744,10 @@ helperHandleRead(int fd, char *buf, size
 	helperRequestFree(r);
 	srv->request = NULL;
 	hlp->stats.replies++;
-	srv->answer_time = current_time;
+	srv->answer_time = currentTimeVal();
 	hlp->stats.avg_svc_time =
 	    intAverage(hlp->stats.avg_svc_time,
-	    tvSubUsec(srv->dispatch_time, current_time),
+	    tvSubUsec(srv->dispatch_time, currentTimeVal()),
 	    hlp->stats.replies, REDIRECT_AV_FACTOR);
 	if (srv->flags.shutdown) {
 	    int wfd = srv->wfd;
@@ -843,7 +843,7 @@ helperStatefulHandleRead(int fd, char *b
 	hlp->stats.replies++;
 	hlp->stats.avg_svc_time =
 	    intAverage(hlp->stats.avg_svc_time,
-	    tvSubMsec(srv->dispatch_time, current_time),
+	    tvSubMsec(srv->dispatch_time, currentTimeVal()),
 	    hlp->stats.replies, REDIRECT_AV_FACTOR);
 	if (srv->flags.shutdown
 	    && srv->flags.reserved == S_HELPER_FREE
@@ -871,11 +871,11 @@ Enqueue(helper * hlp, helper_request * r
     hlp->stats.queue_size++;
     if (hlp->stats.queue_size < hlp->n_running)
 	return;
-    if (squid_curtime - hlp->last_queue_warn < 600)
+    if (currentTimeC() - hlp->last_queue_warn < 600)
 	return;
     if (shutting_down || reconfiguring)
 	return;
-    hlp->last_queue_warn = squid_curtime;
+    hlp->last_queue_warn = currentTimeC();
     debug(84, 0) ("WARNING: All %s processes are busy.\n", hlp->id_name);
     debug(84, 0) ("WARNING: %d pending requests queued\n", hlp->stats.queue_size);
     if (hlp->stats.queue_size > hlp->n_running * 2)
@@ -893,11 +893,11 @@ StatefulEnqueue(statefulhelper * hlp, he
 	return;
     if (hlp->stats.queue_size > hlp->n_running * 2)
 	fatalf("Too many queued %s requests", hlp->id_name);
-    if (squid_curtime - hlp->last_queue_warn < 600)
+    if (currentTimeC() - hlp->last_queue_warn < 600)
 	return;
     if (shutting_down || reconfiguring)
 	return;
-    hlp->last_queue_warn = squid_curtime;
+    hlp->last_queue_warn = currentTimeC();
     debug(84, 0) ("WARNING: All %s processes are busy.\n", hlp->id_name);
     debug(84, 0) ("WARNING: %d pending requests queued\n", hlp->stats.queue_size);
     debug(84, 1) ("Consider increasing the number of %s processes in your config file.\n", hlp->id_name);
@@ -915,11 +915,11 @@ StatefulServerEnqueue(helper_stateful_se
 /*    hlp->stats.queue_size++;
  * if (hlp->stats.queue_size < hlp->n_running)
  * return;
- * if (squid_curtime - hlp->last_queue_warn < 600)
+ * if (currentTimeC() - hlp->last_queue_warn < 600)
  * return;
  * if (shutting_down || reconfiguring)
  * return;
- * hlp->last_queue_warn = squid_curtime;
+ * hlp->last_queue_warn = currentTimeC();
  * debug(84, 0) ("WARNING: All %s processes are busy.\n", hlp->id_name);
  * debug(84, 0) ("WARNING: %d pending requests queued\n", hlp->stats.queue_size);
  * if (hlp->stats.queue_size > hlp->n_running * 2)
@@ -1030,7 +1030,7 @@ helperDispatch(helper_server * srv, help
     assert(!srv->flags.busy);
     srv->flags.busy = 1;
     srv->request = r;
-    srv->dispatch_time = current_time;
+    srv->dispatch_time = currentTimeVal();
     comm_write(srv->wfd,
 	r->buf,
 	strlen(r->buf),
@@ -1088,7 +1088,7 @@ helperStatefulDispatch(helper_stateful_s
     }
     srv->flags.busy = 1;
     srv->request = r;
-    srv->dispatch_time = current_time;
+    srv->dispatch_time = currentTimeVal();
     comm_write(srv->wfd,
 	r->buf,
 	strlen(r->buf),
Index: src/htcp.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/htcp.cc,v
retrieving revision 1.47
diff -u -w -p -r1.47 htcp.cc
--- src/htcp.cc	21 Oct 2002 09:31:55 -0000	1.47
+++ src/htcp.cc	15 Dec 2002 13:43:42 -0000
@@ -609,8 +609,8 @@ htcpTstReply(htcpDataHeader * dhdr, Stor
 	stuff.S.version = spec->version;
 	stuff.S.req_hdrs = spec->req_hdrs;
 	httpHeaderPutInt(&hdr, HDR_AGE,
-	    e->timestamp <= squid_curtime ?
-	    squid_curtime - e->timestamp : 0);
+	    e->timestamp <= currentTimeC() ?
+	    currentTimeC() - e->timestamp : 0);
 	httpHeaderPackInto(&hdr, &p);
 	stuff.D.resp_hdrs = xstrdup(mb.buf);
 	debug(31, 3) ("htcpTstReply: resp_hdrs = {%s}\n", stuff.D.resp_hdrs);
Index: src/http.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/http.cc,v
retrieving revision 1.403
diff -u -w -p -r1.403 http.cc
--- src/http.cc	6 Dec 2002 23:19:15 -0000	1.403
+++ src/http.cc	15 Dec 2002 13:43:42 -0000
@@ -284,7 +284,7 @@ httpCachableReply(HttpStateData * httpSt
 	    return 1;
 	else if (!httpState->_peer)
 	    return 1;
-	/* @?@ (here and 302): invalid expires header compiles to squid_curtime */
+	/* @?@ (here and 302): invalid expires header compiles to currentTimeC() */
 	else if (rep->expires > -1)
 	    return 1;
 	else
@@ -490,7 +490,7 @@ HttpStateData::processReplyHeader(const 
 	if (_peer)
 	    _peer->stats.n_keepalives_recv++;
     if (reply->date > -1 && !_peer) {
-	int skew = abs(reply->date - squid_curtime);
+	int skew = abs(reply->date - currentTimeC());
 	if (skew > 86400)
 	    debug(11, 3) ("%s's clock is skewed by %d seconds!\n",
 		request->host, skew);
Index: src/icp_v2.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/icp_v2.cc,v
retrieving revision 1.72
diff -u -w -p -r1.72 icp_v2.cc
--- src/icp_v2.cc	21 Oct 2002 14:00:02 -0000	1.72
+++ src/icp_v2.cc	15 Dec 2002 13:43:43 -0000
@@ -165,7 +165,7 @@ icpUdpSendQueue(int fd, void *unused)
     int x;
     int delay;
     while ((q = IcpQueueHead) != NULL) {
-	delay = tvSubUsec(q->queue_time, current_time);
+	delay = tvSubUsec(q->queue_time, currentTimeVal());
 	/* increment delay to prevent looping */
 	x = icpUdpSend(fd, &q->address, (icp_common_t *) q->msg, q->logcode, ++delay);
 	IcpQueueHead = q->next;
@@ -235,7 +235,7 @@ icpUdpSend(int fd,
 	queue->address = *to;
 	queue->msg = msg;
 	queue->len = (int) ntohs(msg->length);
-	queue->queue_time = current_time;
+	queue->queue_time = currentTimeVal();
 	queue->logcode = logcode;
 	if (IcpQueueHead == NULL) {
 	    IcpQueueHead = queue;
@@ -276,7 +276,7 @@ icpGetCommonOpcode()
 {
     /* if store is rebuilding, return a UDP_HIT, but not a MISS */
     if (store_dirs_rebuilding && opt_reload_hit_only ||
-	hit_only_mode_until > squid_curtime) {
+	hit_only_mode_until > currentTimeC()) {
 	return ICP_MISS_NOFETCH;
     }
     return ICP_ERR;
Index: src/internal.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/internal.cc,v
retrieving revision 1.26
diff -u -w -p -r1.26 internal.cc
--- src/internal.cc	13 Oct 2002 20:35:02 -0000	1.26
+++ src/internal.cc	15 Dec 2002 13:43:43 -0000
@@ -63,7 +63,7 @@ internalStart(request_t * request, Store
 	    "Not Found",
 	    "text/plain",
 	    strlen(msgbuf),
-	    squid_curtime,
+	    currentTimeC(),
 	    -2);
 	httpReplySwapOut(entry->mem_obj->reply, entry);
 	storeAppend(entry, msgbuf, strlen(msgbuf));
Index: src/ipcache.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/ipcache.cc,v
retrieving revision 1.239
diff -u -w -p -r1.239 ipcache.cc
--- src/ipcache.cc	13 Oct 2002 20:35:02 -0000	1.239
+++ src/ipcache.cc	15 Dec 2002 13:43:43 -0000
@@ -140,7 +140,7 @@ ipcacheExpiredEntry(ipcache_entry * i)
     if (i->addrs.count == 0)
 	if (0 == i->flags.negcached)
 	    return 1;
-    if (i->expires > squid_curtime)
+    if (i->expires > currentTimeC())
 	return 0;
     return 1;
 }
@@ -193,7 +193,7 @@ ipcacheCreateEntry(const char *name)
     static ipcache_entry *i;
     i = (ipcache_entry *)memAllocate(MEM_IPCACHE_ENTRY);
     i->hash.key = xstrdup(name);
-    i->expires = squid_curtime + Config.negativeDnsTtl;
+    i->expires = currentTimeC() + Config.negativeDnsTtl;
     return i;
 }
 
@@ -208,7 +208,7 @@ ipcacheAddEntry(ipcache_entry * i)
     }
     hash_join(ip_table, &i->hash);
     dlinkAdd(i, &i->lru, &lru_list);
-    i->lastref = squid_curtime;
+    i->lastref = currentTimeC();
 }
 
 /* walks down the pending list, calling handlers */
@@ -217,7 +217,7 @@ ipcacheCallback(ipcache_entry * i)
 {
     IPH *callback = i->handler;
     void *cbdata;
-    i->lastref = squid_curtime;
+    i->lastref = currentTimeC();
     if (!i->handler)
 	return;
     ipcacheLockEntry(i);
@@ -243,7 +243,7 @@ ipcacheParse(const char *inbuf)
     int ttl;
     char A[32][16];
     memset(&i, '\0', sizeof(i));
-    i.expires = squid_curtime;
+    i.expires = currentTimeC();
     i.flags.negcached = 1;
     if (inbuf == NULL) {
 	debug(14, 1) ("ipcacheParse: Got <NULL> reply\n");
@@ -258,7 +258,7 @@ ipcacheParse(const char *inbuf)
 	return &i;
     }
     if (0 == strcmp(token, "$fail")) {
-	i.expires = squid_curtime + Config.negativeDnsTtl;
+	i.expires = currentTimeC() + Config.negativeDnsTtl;
 	token = strtok(NULL, "\n");
 	assert(NULL != token);
 	i.error_message = xstrdup(token);
@@ -276,9 +276,9 @@ ipcacheParse(const char *inbuf)
     i.flags.negcached = 0;
     ttl = atoi(token);
     if (ttl > 0)
-	i.expires = squid_curtime + ttl;
+	i.expires = currentTimeC() + ttl;
     else
-	i.expires = squid_curtime + Config.positiveDnsTtl;
+	i.expires = currentTimeC() + Config.positiveDnsTtl;
     while (NULL != (token = strtok(NULL, w_space))) {
 	xstrncpy(A[ipcount], token, 16);
 	if (++ipcount == 32)
@@ -308,7 +308,7 @@ ipcacheParse(rfc1035_rr * answers, int n
     int j;
     int na = 0;
     memset(&i, '\0', sizeof(i));
-    i.expires = squid_curtime + Config.negativeDnsTtl;
+    i.expires = currentTimeC() + Config.negativeDnsTtl;
     i.flags.negcached = 1;
     if (nr < 0) {
 	debug(14, 3) ("ipcacheParse: Lookup failed (error %d)\n",
@@ -345,7 +345,7 @@ ipcacheParse(rfc1035_rr * answers, int n
 	if (answers[k]._class != RFC1035_CLASS_IN)
 	    continue;
 	if (j == 0)
-	    i.expires = squid_curtime + answers[k].ttl;
+	    i.expires = currentTimeC() + answers[k].ttl;
 	assert(answers[k].rdlength == 4);
 	xmemcpy(&i.addrs.in_addrs[j++], answers[k].rdata, 4);
 	debug(14, 3) ("ipcacheParse: #%d %s\n",
@@ -371,7 +371,7 @@ ipcacheHandleReply(void *data, rfc1035_r
     c = NULL;
     IpcacheStats.replies++;
     statHistCount(&statCounter.dns.svc_time,
-	tvSubMsec(i->request_time, current_time));
+	tvSubMsec(i->request_time, currentTimeVal()));
 #if USE_DNSSERVERS
     x = ipcacheParse(reply);
 #else
@@ -429,7 +429,7 @@ ipcache_nbgethostbyname(const char *name
     i = ipcacheCreateEntry(name);
     i->handler = handler;
     i->handlerData = cbdataReference(handlerData);
-    i->request_time = current_time;
+    i->request_time = currentTimeVal();
     c = cbdataAlloc(generic_cbdata);
     c->data = i;
 #if USE_DNSSERVERS
@@ -490,7 +490,7 @@ ipcache_gethostbyname(const char *name, 
 	return NULL;
     } else {
 	IpcacheStats.hits++;
-	i->lastref = squid_curtime;
+	i->lastref = currentTimeC();
 	return &i->addrs;
     }
     if ((addrs = ipcacheCheckNumeric(name)))
@@ -509,8 +509,8 @@ ipcacheStatPrint(ipcache_entry * i, Stor
 	hashKeyStr(&i->hash),
 	i->flags.fromhosts ? 'H' : ' ',
 	i->flags.negcached ? 'N' : ' ',
-	(int) (squid_curtime - i->lastref),
-	(int) ((i->flags.fromhosts ? -1 : i->expires - squid_curtime)),
+	(int) (currentTimeC() - i->lastref),
+	(int) ((i->flags.fromhosts ? -1 : i->expires - currentTimeC())),
 	(int) i->addrs.count,
 	(int) i->addrs.badcount);
     for (k = 0; k < (int) i->addrs.count; k++) {
@@ -565,7 +565,7 @@ ipcacheInvalidate(const char *name)
     ipcache_entry *i;
     if ((i = ipcache_get(name)) == NULL)
 	return;
-    i->expires = squid_curtime;
+    i->expires = currentTimeC();
     /*
      * NOTE, don't call ipcacheRelease here becuase we might be here due
      * to a thread started from a callback.
Index: src/leakfinder.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/leakfinder.cc,v
retrieving revision 1.7
diff -u -w -p -r1.7 leakfinder.cc
--- src/leakfinder.cc	13 Oct 2002 20:35:02 -0000	1.7
+++ src/leakfinder.cc	15 Dec 2002 13:43:43 -0000
@@ -80,7 +80,7 @@ leakAddFL(void *p, const char *file, int
     c->key = p;
     c->file = file;
     c->line = line;
-    c->when = squid_curtime;
+    c->when = currentTimeC();
     hash_join(htable, &c->hash);
     leakCount++;
     return p;
@@ -95,7 +95,7 @@ leakTouchFL(void *p, const char *file, i
     assert(c);
     c->file = file;
     c->line = line;
-    c->when = squid_curtime;
+    c->when = currentTimeC();
     return p;
 }
 
@@ -136,6 +136,6 @@ ptrDump(StoreEntry * sentry)
     while ((hptr = (hash_link *)hash_next(htable))) {
 	c = (ptr *) hptr;
 	storeAppendPrintf(sentry, "%20p last used %9d seconds ago by %s:%d\n",
-	    c->key, (int)(squid_curtime - c->when), c->file, c->line);
+	    c->key, (int)(currentTimeC() - c->when), c->file, c->line);
     }
 }
Index: src/main.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/main.cc,v
retrieving revision 1.359
diff -u -w -p -r1.359 main.cc
--- src/main.cc	15 Nov 2002 13:29:20 -0000	1.359
+++ src/main.cc	15 Dec 2002 13:43:43 -0000
@@ -613,7 +613,7 @@ main(int argc, char **argv)
     squid_srandom(time(NULL));
 
     getCurrentTime();
-    squid_start = current_time;
+    squid_start = currentTimeVal();
     failure_notify = fatal_dump;
 
     mainParseOptions(argc, argv);
Index: src/mem.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/mem.cc,v
retrieving revision 1.69
diff -u -w -p -r1.69 mem.cc
--- src/mem.cc	6 Dec 2002 23:19:16 -0000	1.69
+++ src/mem.cc	15 Dec 2002 13:43:43 -0000
@@ -560,7 +560,7 @@ memPoolReport(const MemPoolStats * mp_st
 	mp_st->items_alloc,
 	toKB(mp_st->obj_size * pm->alloc.level),
 	toKB(mp_st->obj_size * pm->alloc.hwater_level),
-	(double) ((squid_curtime - pm->alloc.hwater_stamp) / 3600.),
+	(double) ((currentTimeC() - pm->alloc.hwater_stamp) / 3600.),
 	xpercent(mp_st->obj_size * pm->alloc.level, AllMeter->alloc.level),
     /* in use */
 	mp_st->items_inuse,
@@ -610,8 +610,8 @@ memReport(StoreEntry * e)
 	"(#)\t %%cnt\t %%vol\t"
 	"(#) / sec\t"
 	"\n");
-    xm_deltat = current_dtime - xm_time;
-    xm_time = current_dtime;
+    xm_deltat = currentDTime() - xm_time;
+    xm_time = currentDTime();
 
     /* Get stats for Totals report line */
     memPoolGetGlobalStats(&mp_total);
Index: src/neighbors.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/neighbors.cc,v
retrieving revision 1.308
diff -u -w -p -r1.308 neighbors.cc
--- src/neighbors.cc	25 Oct 2002 07:36:32 -0000	1.308
+++ src/neighbors.cc	15 Dec 2002 13:43:44 -0000
@@ -173,7 +173,7 @@ peerWouldBePinged(const peer * p, reques
 	return 0;
     if (p->options.no_query)
 	return 0;
-    if (p->options.background_ping && (squid_curtime - p->stats.last_query < Config.backgroundPingRate))
+    if (p->options.background_ping && (currentTimeC() - p->stats.last_query < Config.backgroundPingRate))
 	return 0;
     if (p->options.mcast_responder)
 	return 0;
@@ -187,7 +187,7 @@ peerWouldBePinged(const peer * p, reques
 	if (!request->flags.hierarchical)
 	    return 0;
     /* Ping dead peers every timeout interval */
-    if (squid_curtime - p->stats.last_query > Config.Timeout.deadPeer)
+    if (currentTimeC() - p->stats.last_query > Config.Timeout.deadPeer)
 	return 1;
     if (p->icp.port == echo_port)
 	if (!neighborUp(p))
@@ -478,7 +478,7 @@ neighborsUdpPing(request_t * request,
     if (theOutIcpConnection < 0)
 	fatal("neighborsUdpPing: There is no ICP socket!");
     assert(entry->swap_status == SWAPOUT_NONE);
-    mem->start_ping = current_time;
+    mem->start_ping = currentTimeVal();
     mem->ping_reply_callback = callback;
     mem->ircb_data = callback_data;
     reqnum = icpSetCacheKey((const cache_key *)entry->key);
@@ -531,7 +531,7 @@ neighborsUdpPing(request_t * request,
 	     * set a bogus last_reply time so neighborUp() never
 	     * says a multicast peer is dead.
 	     */
-	    p->stats.last_reply = squid_curtime;
+	    p->stats.last_reply = currentTimeC();
 	    (*exprep) += p->mcast.n_replies_expected;
 	} else if (neighborUp(p)) {
 	    /* its alive, expect a reply from it */
@@ -552,9 +552,9 @@ neighborsUdpPing(request_t * request,
 		p->stats.logged_state = PEER_DEAD;
 	    }
 	}
-	p->stats.last_query = squid_curtime;
+	p->stats.last_query = currentTimeC();
 	if (p->stats.probe_start == 0)
-	    p->stats.probe_start = squid_curtime;
+	    p->stats.probe_start = currentTimeC();
     }
     if ((first_ping = first_ping->next) == NULL)
 	first_ping = Config.peers;
@@ -730,7 +730,7 @@ neighborAlive(peer * p, const MemObject 
 	    p->host, p->http_port, p->icp.port);
 	p->stats.logged_state = PEER_ALIVE;
     }
-    p->stats.last_reply = squid_curtime;
+    p->stats.last_reply = currentTimeC();
     p->stats.probe_start = 0;
     p->stats.pings_acked++;
     if ((icp_opcode) header->opcode <= ICP_END)
@@ -746,7 +746,7 @@ neighborUpdateRtt(peer * p, MemObject * 
 	return;
     if (!mem->start_ping.tv_sec)
 	return;
-    rtt = tvSubMsec(mem->start_ping, current_time);
+    rtt = tvSubMsec(mem->start_ping, currentTimeVal());
     if (rtt < 1 || rtt > 10000)
 	return;
     rtt_av_factor = RTT_AV_FACTOR;
@@ -766,7 +766,7 @@ neighborAliveHtcp(peer * p, const MemObj
 	    p->host, p->http_port, p->icp.port);
 	p->stats.logged_state = PEER_ALIVE;
     }
-    p->stats.last_reply = squid_curtime;
+    p->stats.last_reply = currentTimeC();
     p->stats.probe_start = 0;
     p->stats.pings_acked++;
     p->htcp.counts[htcp->hit ? 1 : 0]++;
@@ -984,7 +984,7 @@ neighborUp(const peer * p)
     if (p->options.no_query)
 	return 1;
     if (p->stats.probe_start != 0 &&
-	squid_curtime - p->stats.probe_start > Config.Timeout.deadPeer)
+	currentTimeC() - p->stats.probe_start > Config.Timeout.deadPeer)
 	return 0;
     /*
      * The peer can not be UP if we don't have any IP addresses
@@ -1080,7 +1080,7 @@ peerRefreshDNS(void *data)
 void
 peerConnectFailed(peer * p)
 {
-    p->stats.last_connect_failure = squid_curtime;
+    p->stats.last_connect_failure = currentTimeC();
     if (!p->tcp_up) {
 	debug(15, 2) ("TCP connection to %s/%d dead\n", p->host, p->http_port);
 	return;
@@ -1117,14 +1117,14 @@ peerProbeConnect(peer * p)
     int fd;
     if (p->test_fd != -1)
 	return;			/* probe already running */
-    if (squid_curtime - p->stats.last_connect_probe < Config.Timeout.connect)
+    if (currentTimeC() - p->stats.last_connect_probe < Config.Timeout.connect)
 	return;			/* don't probe to often */
     fd = comm_open(SOCK_STREAM, 0, getOutgoingAddr(NULL),
 	0, COMM_NONBLOCKING, p->host);
     if (fd < 0)
 	return;
     p->test_fd = fd;
-    p->stats.last_connect_probe = squid_curtime;
+    p->stats.last_connect_probe = currentTimeC();
     ipcache_nbgethostbyname(p->host, peerProbeConnect2, p);
 }
 
@@ -1184,10 +1184,10 @@ peerCountMcastPeersStart(void *data)
     psstate->entry = fake;
     psstate->callback = NULL;
     psstate->callback_data = p;
-    psstate->ping.start = current_time;
+    psstate->ping.start = currentTimeVal();
     mem = fake->mem_obj;
     mem->request = requestLink(psstate->request);
-    mem->start_ping = current_time;
+    mem->start_ping = currentTimeVal();
     mem->ping_reply_callback = peerCountHandleIcpReply;
     mem->ircb_data = psstate;
     mcastSetTtl(theOutIcpConnection, p->mcast.ttl);
@@ -1242,7 +1242,7 @@ peerCountHandleIcpReply(peer * p, peer_t
     ps_state *psstate = (ps_state *)data;
     StoreEntry *fake = psstate->entry;
     MemObject *mem = fake->mem_obj;
-    int rtt = tvSubMsec(mem->start_ping, current_time);
+    int rtt = tvSubMsec(mem->start_ping, currentTimeVal());
     assert(proto == PROTO_ICP);
     assert(fake);
     assert(mem);
@@ -1330,9 +1330,9 @@ dump_peers(StoreEntry * sentry, peer * p
 	storeAppendPrintf(sentry, "AVG RTT    : %d msec\n", e->stats.rtt);
 	storeAppendPrintf(sentry, "OPEN CONNS : %d\n", e->stats.conn_open);
 	storeAppendPrintf(sentry, "LAST QUERY : %8d seconds ago\n",
-	    (int) (squid_curtime - e->stats.last_query));
+	    (int) (currentTimeC() - e->stats.last_query));
 	storeAppendPrintf(sentry, "LAST REPLY : %8d seconds ago\n",
-	    (int) (squid_curtime - e->stats.last_reply));
+	    (int) (currentTimeC() - e->stats.last_reply));
 	storeAppendPrintf(sentry, "PINGS SENT : %8d\n", e->stats.pings_sent);
 	storeAppendPrintf(sentry, "PINGS ACKED: %8d %3d%%\n",
 	    e->stats.pings_acked,
@@ -1367,7 +1367,7 @@ dump_peers(StoreEntry * sentry, peer * p
 #endif
 	if (e->stats.last_connect_failure) {
 	    storeAppendPrintf(sentry, "Last failed connect() at: %s\n",
-		mkhttpdlogtime(&(e->stats.last_connect_failure)));
+		mkhttpdlogtime(e->stats.last_connect_failure));
 	}
 	if (e->peer_domain != NULL) {
 	    storeAppendPrintf(sentry, "DOMAIN LIST: ");
Index: src/net_db.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/net_db.cc,v
retrieving revision 1.166
diff -u -w -p -r1.166 net_db.cc
--- src/net_db.cc	25 Oct 2002 07:36:32 -0000	1.166
+++ src/net_db.cc	15 Dec 2002 13:43:44 -0000
@@ -287,12 +287,12 @@ netdbSendPing(const ipcache_addrs * ia, 
 	na->link_count++;
 	n = na;
     }
-    if (n->next_ping_time <= squid_curtime) {
+    if (n->next_ping_time <= currentTimeC()) {
 	debug(38, 3) ("netdbSendPing: pinging %s\n", hostname);
 	icmpDomainPing(addr, hostname);
 	n->pings_sent++;
-	n->next_ping_time = squid_curtime + Config.Netdb.period;
-	n->last_use_time = squid_curtime;
+	n->next_ping_time = currentTimeC() + Config.Netdb.period;
+	n->last_use_time = currentTimeC();
     }
     xfree(hostname);
 }
@@ -391,7 +391,7 @@ netdbSaveState(void *foo)
     Logfile *lf;
     netdbEntry *n;
     net_db_name *x;
-    struct timeval start = current_time;
+    struct timeval start = currentTimeVal();
     int count = 0;
     snprintf(path, SQUID_MAXPATHLEN, "%s/netdb_state", storeSwapDir(0));
     /*
@@ -430,7 +430,7 @@ netdbSaveState(void *foo)
     logfileClose(lf);
     getCurrentTime();
     debug(38, 1) ("NETDB state saved; %d entries, %d msec\n",
-	count, tvSubMsec(start, current_time));
+	count, tvSubMsec(start, currentTimeVal()));
     eventAddIsh("netdbSaveState", netdbSaveState, NULL, 3600.0, 1);
 }
 
@@ -446,7 +446,7 @@ netdbReloadState(void)
     netdbEntry N;
     struct in_addr addr;
     int count = 0;
-    struct timeval start = current_time;
+    struct timeval start = currentTimeVal();
     snprintf(path, SQUID_MAXPATHLEN, "%s/netdb_state", storeSwapDir(0));
     /*
      * This was nicer when we were using stdio, but thanks to
@@ -518,7 +518,7 @@ netdbReloadState(void)
     xfree(buf);
     getCurrentTime();
     debug(38, 1) ("NETDB state reloaded; %d entries, %d msec\n",
-	count, tvSubMsec(start, current_time));
+	count, tvSubMsec(start, currentTimeVal()));
 }
 
 static const char *
@@ -766,7 +766,7 @@ netdbPingSite(const char *hostname)
     netdbEntry *n;
     generic_cbdata *h;
     if ((n = netdbLookupHost(hostname)) != NULL)
-	if (n->next_ping_time > squid_curtime)
+	if (n->next_ping_time > currentTimeC())
 	    return;
     h = cbdataAlloc(generic_cbdata);
     h->data = xstrdup(hostname);
@@ -818,7 +818,7 @@ netdbHops(struct in_addr addr)
 #if USE_ICMP
     netdbEntry *n = netdbLookupAddr(addr);
     if (n && n->pings_recv) {
-	n->last_use_time = squid_curtime;
+	n->last_use_time = currentTimeC();
 	return (int) (n->hops + 0.5);
     }
 #endif
@@ -887,7 +887,7 @@ netdbHostHops(const char *host)
 #if USE_ICMP
     netdbEntry *n = netdbLookupHost(host);
     if (n) {
-	n->last_use_time = squid_curtime;
+	n->last_use_time = currentTimeC();
 	return (int) (n->hops + 0.5);
     }
 #endif
@@ -900,7 +900,7 @@ netdbHostRtt(const char *host)
 #if USE_ICMP
     netdbEntry *n = netdbLookupHost(host);
     if (n) {
-	n->last_use_time = squid_curtime;
+	n->last_use_time = currentTimeC();
 	return (int) (n->rtt + 0.5);
     }
 #endif
@@ -927,7 +927,7 @@ netdbHostPeerRtt(const char *host, peer 
     const netdbEntry *n = netdbLookupHost(host);
     if (n) {
 	const net_db_peer *np = netdbPeerByName(n, p->host);
-	if (np && np->expires >= squid_curtime)
+	if (np && np->expires >= currentTimeC())
 	    return (int) (np->rtt + 0.5);
     }
 #endif
@@ -952,7 +952,7 @@ netdbUpdatePeer(request_t * r, peer * e,
 	p = netdbPeerAdd(n, e);
     p->rtt = rtt;
     p->hops = hops;
-    p->expires = squid_curtime + 3600;
+    p->expires = currentTimeC() + 3600;
     if (n->n_peers < 2)
 	return;
     qsort((char *) n->peers,
@@ -978,7 +978,7 @@ netdbExchangeUpdatePeer(struct in_addr a
 	p = netdbPeerAdd(n, e);
     p->rtt = rtt;
     p->hops = hops;
-    p->expires = squid_curtime + 3600;	/* XXX ? */
+    p->expires = currentTimeC() + 3600;	/* XXX ? */
     if (n->n_peers < 2)
 	return;
     qsort((char *) n->peers,
@@ -1016,7 +1016,7 @@ netdbBinaryExchange(StoreEntry * s)
     httpReplyReset(reply);
     httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(reply, version, HTTP_OK, "OK",
-	NULL, -1, squid_curtime, -2);
+	NULL, -1, currentTimeC(), -2);
     httpReplySwapOut(reply, s);
     rec_sz = 0;
     rec_sz += 1 + sizeof(addr.s_addr);
@@ -1059,7 +1059,7 @@ netdbBinaryExchange(StoreEntry * s)
     httpReplyReset(reply);
     httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(reply, version, HTTP_BAD_REQUEST, "Bad Request",
-	NULL, -1, squid_curtime, -2);
+	NULL, -1, currentTimeC(), -2);
     storeAppendPrintf(s, "NETDB support not compiled into this Squid cache.\n");
 #endif
     storeComplete(s);
Index: src/peer_digest.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/peer_digest.cc,v
retrieving revision 1.93
diff -u -w -p -r1.93 peer_digest.cc
--- src/peer_digest.cc	18 Oct 2002 22:46:46 -0000	1.93
+++ src/peer_digest.cc	15 Dec 2002 13:43:44 -0000
@@ -89,7 +89,7 @@ peerDigestInit(PeerDigest * pd, peer * p
     /* if peer disappears, we will know it's name */
     stringInit(&pd->host, p->host);
 
-    pd->times.initialized = squid_curtime;
+    pd->times.initialized = currentTimeC();
 }
 
 static void
@@ -142,7 +142,7 @@ peerDigestNeeded(PeerDigest * pd)
     assert(!pd->cd);
 
     pd->flags.needed = 1;
-    pd->times.needed = squid_curtime;
+    pd->times.needed = currentTimeC();
     peerDigestSetCheck(pd, 0);	/* check asap */
 }
 
@@ -154,7 +154,7 @@ peerDigestDisable(PeerDigest * pd)
 {
     debug(72, 2) ("peerDigestDisable: peer %s disabled for good\n",
 	strBuf(pd->host));
-    pd->times.disabled = squid_curtime;
+    pd->times.disabled = currentTimeC();
     pd->times.next_check = -1;	/* never */
     pd->flags.usable = 0;
 
@@ -183,7 +183,7 @@ peerDigestNewDelay(const StoreEntry * e)
 {
     assert(e);
     if (e->expires > 0)
-	return e->expires + PeerDigestReqMinGap - squid_curtime;
+	return e->expires + PeerDigestReqMinGap - currentTimeC();
     return PeerDigestReqMinGap;
 }
 
@@ -192,7 +192,7 @@ static void
 peerDigestSetCheck(PeerDigest * pd, time_t delay)
 {
     eventAdd("peerDigestCheck", peerDigestCheck, pd, (double) delay, 1);
-    pd->times.next_check = squid_curtime + delay;
+    pd->times.next_check = currentTimeC() + delay;
     debug(72, 3) ("peerDigestSetCheck: will check peer %s in %d secs\n",
 	strBuf(pd->host), (int) delay);
 }
@@ -233,11 +233,11 @@ peerDigestCheck(void *data)
     }
     debug(72, 3) ("peerDigestCheck: peer %s:%d\n", pd->peer->host, pd->peer->http_port);
     debug(72, 3) ("peerDigestCheck: time: %ld, last received: %ld (%+d)\n",
-	(long int) squid_curtime, (long int) pd->times.received, (int) (squid_curtime - pd->times.received));
+	(long int) currentTimeC(), (long int) pd->times.received, (int) (currentTimeC() - pd->times.received));
 
     /* decide when we should send the request:
      * request now unless too close to other requests */
-    req_time = squid_curtime;
+    req_time = currentTimeC();
 
     /* per-peer limit */
     if (req_time - pd->times.received < PeerDigestReqMinGap) {
@@ -253,10 +253,10 @@ peerDigestCheck(void *data)
 	    (int) GlobDigestReqMinGap);
 	req_time = pd_last_req_time + GlobDigestReqMinGap;
     }
-    if (req_time <= squid_curtime)
+    if (req_time <= currentTimeC())
 	peerDigestRequest(pd);	/* will set pd->flags.requested */
     else
-	peerDigestSetCheck(pd, req_time - squid_curtime);
+	peerDigestSetCheck(pd, req_time - currentTimeC());
 }
 
 CBDATA_TYPE(DigestFetchState);
@@ -303,9 +303,9 @@ peerDigestRequest(PeerDigest * pd)
     fetch->state = DIGEST_READ_REPLY;
 
     /* update timestamps */
-    fetch->start_time = squid_curtime;
-    pd->times.requested = squid_curtime;
-    pd_last_req_time = squid_curtime;
+    fetch->start_time = currentTimeC();
+    pd->times.requested = currentTimeC();
+    pd_last_req_time = currentTimeC();
 
     req->flags.cachable = 1;
     /* the rest is based on clientProcessExpired() */
@@ -462,7 +462,7 @@ peerDigestFetchReply(void *data, char *b
 	status = reply->sline.status;
 	debug(72, 3) ("peerDigestFetchReply: %s status: %d, expires: %ld (%+d)\n",
 	    strBuf(pd->host), status,
-	    (long int) reply->expires, (int) (reply->expires - squid_curtime));
+	    (long int) reply->expires, (int) (reply->expires - currentTimeC()));
 
 	/* this "if" is based on clientHandleIMSReply() */
 	if (status == HTTP_NOT_MODIFIED) {
@@ -748,7 +748,7 @@ peerDigestPDFinish(DigestFetchState * fe
     PeerDigest *pd = fetch->pd;
     const char *host = strBuf(pd->host);
 
-    pd->times.received = squid_curtime;
+    pd->times.received = currentTimeC();
     pd->times.req_delay = fetch->resp_time;
     kb_incr(&pd->stats.sent.kbytes, (size_t) fetch->sent.bytes);
     kb_incr(&pd->stats.recv.kbytes, (size_t) fetch->recv.bytes);
@@ -829,13 +829,13 @@ peerDigestFetchSetStats(DigestFetchState
 	mem->inmem_hi : mem->object_sz;
     fetch->sent.msg = fetch->recv.msg = 1;
     fetch->expires = fetch->entry->expires;
-    fetch->resp_time = squid_curtime - fetch->start_time;
+    fetch->resp_time = currentTimeC() - fetch->start_time;
 
     debug(72, 3) ("peerDigestFetchFinish: recv %d bytes in %d secs\n",
 	fetch->recv.bytes, (int) fetch->resp_time);
     debug(72, 3) ("peerDigestFetchFinish: expires: %ld (%+d), lmt: %ld (%+d)\n",
-	(long int) fetch->expires, (int) (fetch->expires - squid_curtime),
-	(long int) fetch->entry->lastmod, (int) (fetch->entry->lastmod - squid_curtime));
+	(long int) fetch->expires, (int) (fetch->expires - currentTimeC()),
+	(long int) fetch->entry->lastmod, (int) (fetch->entry->lastmod - currentTimeC()));
 }
 
 
@@ -930,7 +930,7 @@ peerDigestUseful(const PeerDigest * pd)
 static int
 saneDiff(time_t diff)
 {
-    return abs(diff) > squid_curtime / 2 ? 0 : diff;
+    return abs(diff) > currentTimeC() / 2 ? 0 : diff;
 }
 
 void
@@ -939,7 +939,7 @@ peerDigestStatsReport(const PeerDigest *
 #define f2s(flag) (pd->flags.flag ? "yes" : "no")
 #define appendTime(tm) storeAppendPrintf(e, "%s\t %10ld\t %+d\t %+d\n", \
     ""#tm, (long int)pd->times.tm, \
-    saneDiff(pd->times.tm - squid_curtime), \
+    saneDiff(pd->times.tm - currentTimeC()), \
     saneDiff(pd->times.tm - pd->times.initialized))
 
     const char *host = pd ? strBuf(pd->host) : NULL;
Index: src/peer_select.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/peer_select.cc,v
retrieving revision 1.124
diff -u -w -p -r1.124 peer_select.cc
--- src/peer_select.cc	13 Oct 2002 20:35:02 -0000	1.124
+++ src/peer_select.cc	15 Dec 2002 13:43:44 -0000
@@ -148,7 +148,7 @@ peerSelect(request_t * request,
     psstate->callback_data = cbdataReference(callback_data);
     psstate->direct = DIRECT_UNKNOWN;
 #if USE_CACHE_DIGESTS
-    request->hier.peer_select_start = current_time;
+    request->hier.peer_select_start = currentTimeVal();
 #endif
     if (psstate->entry)
 	storeLockObject(psstate->entry);
@@ -194,7 +194,7 @@ peerSelectCallback(ps_state * psstate)
 	debug(44, 1) ("   never_direct = %d\n", psstate->never_direct);
 	debug(44, 1) ("       timedout = %d\n", psstate->ping.timedout);
     }
-    psstate->ping.stop = current_time;
+    psstate->ping.stop = currentTimeVal();
     psstate->request->hier.ping = psstate->ping;
     callback = psstate->callback;
     psstate->callback = NULL;
@@ -340,7 +340,7 @@ peerGetSomeNeighbor(ps_state * ps)
 	code = CLOSEST_PARENT;
     } else if (peerSelectIcpPing(request, ps->direct, entry)) {
 	debug(44, 3) ("peerSelect: Doing ICP pings\n");
-	ps->ping.start = current_time;
+	ps->ping.start = currentTimeVal();
 	ps->ping.n_sent = neighborsUdpPing(request,
 	    entry,
 	    peerHandlePingReply,
@@ -538,7 +538,7 @@ peerIcpParentMiss(peer * p, icp_common_t
     /* set FIRST_MISS if there is no CLOSEST parent */
     if (ps->closest_parent_miss.sin_addr.s_addr != any_addr.s_addr)
 	return;
-    rtt = (tvSubMsec(ps->ping.start, current_time) - p->basetime) / p->weight;
+    rtt = (tvSubMsec(ps->ping.start, currentTimeVal()) - p->basetime) / p->weight;
     if (rtt < 1)
 	rtt = 1;
     if (ps->first_parent_miss.sin_addr.s_addr == any_addr.s_addr ||
@@ -628,7 +628,7 @@ peerHtcpParentMiss(peer * p, htcpReplyDa
     /* set FIRST_MISS if there is no CLOSEST parent */
     if (ps->closest_parent_miss.sin_addr.s_addr != any_addr.s_addr)
 	return;
-    rtt = (tvSubMsec(ps->ping.start, current_time) - p->basetime) / p->weight;
+    rtt = (tvSubMsec(ps->ping.start, currentTimeVal()) - p->basetime) / p->weight;
     if (rtt < 1)
 	rtt = 1;
     if (ps->first_parent_miss.sin_addr.s_addr == any_addr.s_addr ||
Index: src/pinger.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/pinger.cc,v
retrieving revision 1.48
diff -u -w -p -r1.48 pinger.cc
--- src/pinger.cc	13 Oct 2002 20:35:02 -0000	1.48
+++ src/pinger.cc	15 Dec 2002 13:43:45 -0000
@@ -169,7 +169,7 @@ pingerSendEcho(struct in_addr to, int op
     icmp->icmp_seq = (u_short) icmp_pkts_sent++;
     echo = (icmpEchoData *) (icmp + 1);
     echo->opcode = (unsigned char) opcode;
-    echo->tv = current_time;
+    echo->tv = currentTimeVal();
     icmp_pktsize += sizeof(icmpEchoData) - MAX_PAYLOAD;
     if (payload) {
 	if (len > MAX_PAYLOAD)
@@ -275,8 +275,8 @@ static void
 pingerLog(struct icmphdr *icmp, struct in_addr addr, int rtt, int hops)
 {
     debug(42, 2) ("pingerLog: %9d.%06d %-16s %d %-15.15s %dms %d hops\n",
-	(int) current_time.tv_sec,
-	(int) current_time.tv_usec,
+	(int) currentTimeVal().tv_sec,
+	(int) currentTimeVal().tv_usec,
 	inet_ntoa(addr),
 	(int) icmp->icmp_type,
 	icmpPktStr[icmp->icmp_type],
@@ -344,11 +344,11 @@ time_t
 getCurrentTime(void)
 {
 #if GETTIMEOFDAY_NO_TZP
-    gettimeofday(&current_time);
+    gettimeofday(&currentTimeVal());
 #else
-    gettimeofday(&current_time, NULL);
+    gettimeofday(&currentTimeVal(), NULL);
 #endif
-    return squid_curtime = current_time.tv_sec;
+    return currentTimeC() = currentTimeVal().tv_sec;
 }
 
 
@@ -392,10 +392,10 @@ main(int argc, char *argv[])
 	    }
 	if (FD_ISSET(icmp_sock, &R))
 	    pingerRecv();
-	if (10 + last_check_time < squid_curtime) {
+	if (10 + last_check_time < currentTimeC()) {
 	    if (send(1, (char *) &tv, 0, 0) < 0)
 		exit(1);
-	    last_check_time = squid_curtime;
+	    last_check_time = currentTimeC();
 	}
     }
     /* NOTREACHED */
Index: src/protos.h
===================================================================
RCS file: /cvsroot/squid/squid3/src/protos.h,v
retrieving revision 1.457
diff -u -w -p -r1.457 protos.h
--- src/protos.h	15 Nov 2002 13:29:20 -0000	1.457
+++ src/protos.h	15 Dec 2002 13:43:45 -0000
@@ -983,7 +983,6 @@ SQUIDCEXTERN void no_suid(void);
 SQUIDCEXTERN void writePidFile(void);
 SQUIDCEXTERN void setSocketShutdownLifetimes(int);
 SQUIDCEXTERN void setMaxFD(void);
-SQUIDCEXTERN time_t getCurrentTime(void);
 SQUIDCEXTERN int percent(int, int);
 SQUIDCEXTERN double dpercent(double, double);
 SQUIDCEXTERN void squid_signal(int sig, SIGHDLR *, int flags);
Index: src/referer.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/referer.cc,v
retrieving revision 1.5
diff -u -w -p -r1.5 referer.cc
--- src/referer.cc	18 Oct 2002 22:43:23 -0000	1.5
+++ src/referer.cc	15 Dec 2002 13:43:45 -0000
@@ -70,8 +70,8 @@ logReferer(const char *client, const cha
     if (NULL == refererlog)
 	return;
     logfilePrintf(refererlog, "%9d.%03d %s %s %s\n",
-	(int) current_time.tv_sec,
-	(int) current_time.tv_usec / 1000,
+	(int) currentTimeVal().tv_sec,
+	(int) currentTimeVal().tv_usec / 1000,
 	client,
 	referer,
 	uri ? uri : "-");
Index: src/refresh.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/refresh.cc,v
retrieving revision 1.58
diff -u -w -p -r1.58 refresh.cc
--- src/refresh.cc	13 Oct 2002 20:35:03 -0000	1.58
+++ src/refresh.cc	15 Dec 2002 13:43:45 -0000
@@ -215,7 +215,7 @@ refreshCheck(const StoreEntry * entry, r
     const refresh_t *R;
     const char *uri = NULL;
     time_t age = 0;
-    time_t check_time = squid_curtime + delta;
+    time_t check_time = currentTimeC() + delta;
     int staleness;
     stale_flags sf;
     if (entry->mem_obj)
Index: src/send-announce.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/send-announce.cc,v
retrieving revision 1.63
diff -u -w -p -r1.63 send-announce.cc
--- src/send-announce.cc	4 Apr 2002 21:33:27 -0000	1.63
+++ src/send-announce.cc	15 Dec 2002 13:43:45 -0000
@@ -80,8 +80,8 @@ send_announce(const ipcache_addrs * ia, 
 	strcat(sndbuf, tbuf);
     }
     snprintf(tbuf, 256, "generated %d [%s]\n",
-	(int) squid_curtime,
-	mkhttpdlogtime(&squid_curtime));
+	(int) currentTimeC(),
+	mkhttpdlogtime(currentTimeC()));
     strcat(sndbuf, tbuf);
     l = strlen(sndbuf);
     if ((file = Config.Announce.file) != NULL) {
Index: src/snmp_agent.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/snmp_agent.cc,v
retrieving revision 1.84
diff -u -w -p -r1.84 snmp_agent.cc
--- src/snmp_agent.cc	13 Oct 2002 20:35:03 -0000	1.84
+++ src/snmp_agent.cc	15 Dec 2002 13:43:45 -0000
@@ -64,7 +64,7 @@ snmp_sysFn(variable_list * Var, snint * 
 	break;
     case SYS_UPTIME:
 	Answer = snmp_var_new_integer(Var->name, Var->name_length,
-	    (int)(tvSubDsec(squid_start, current_time) * 100),
+	    (int)(tvSubDsec(squid_start, currentTimeVal()) * 100),
 	    SMI_TIMETICKS);
 	break;
     default:
@@ -268,7 +268,7 @@ snmp_prfSysFn(variable_list * Var, snint
     case PERF_SYS_CPUUSAGE:
 	squid_getrusage(&rusage);
 	Answer = snmp_var_new_integer(Var->name, Var->name_length,
-	    (snint) dpercent(rusage_cputime(&rusage), tvSubDsec(squid_start, current_time)),
+	    (snint) dpercent(rusage_cputime(&rusage), tvSubDsec(squid_start, currentTimeVal())),
 	    ASN_INTEGER);
 	break;
     case PERF_SYS_MAXRESSZ:
Index: src/stat.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/stat.cc,v
retrieving revision 1.363
diff -u -w -p -r1.363 stat.cc
--- src/stat.cc	25 Oct 2002 01:00:42 -0000	1.363
+++ src/stat.cc	15 Dec 2002 13:43:46 -0000
@@ -413,7 +413,7 @@ statFiledescriptors(StoreEntry * sentry)
 	storeAppendPrintf(sentry, "%4d %-6.6s %4d %7d%c %7d%c %-21s %s\n",
 	    i,
 	    fdTypeStr[f->type],
-	    f->timeout_handler ? (int) (f->timeout - squid_curtime) / 60 : 0,
+	    f->timeout_handler ? (int) (f->timeout - currentTimeC()) / 60 : 0,
 	    f->bytes_read,
 	    f->read_handler ? '*' : ' ',
 	    f->bytes_written,
@@ -436,7 +436,7 @@ info_get(StoreEntry * sentry)
     int t;
 #endif
 
-    runtime = tvSubDsec(squid_start, current_time);
+    runtime = tvSubDsec(squid_start, currentTimeVal());
     if (runtime == 0.0)
 	runtime = 1.0;
     storeAppendPrintf(sentry, "Squid Object Cache: Version %s\n",
@@ -444,7 +444,7 @@ info_get(StoreEntry * sentry)
     storeAppendPrintf(sentry, "Start Time:\t%s\n",
 	mkrfc1123(squid_start.tv_sec));
     storeAppendPrintf(sentry, "Current Time:\t%s\n",
-	mkrfc1123(current_time.tv_sec));
+	mkrfc1123(currentTimeVal().tv_sec));
     storeAppendPrintf(sentry, "Connection information for %s:\n",
 	appname);
     storeAppendPrintf(sentry, "\tNumber of clients accessing cache:\t%u\n",
@@ -624,8 +624,8 @@ info_get(StoreEntry * sentry)
 	n_disk_objects);
 
 #if XMALLOC_STATISTICS
-    xm_deltat = current_dtime - xm_time;
-    xm_time = current_dtime;
+    xm_deltat = currentDTime() - xm_time;
+    xm_time = currentDTime();
     storeAppendPrintf(sentry, "\nMemory allocation statistics\n");
     storeAppendPrintf(sentry, "Allocation Size\t Alloc Count\t Alloc Delta\t Allocs/sec \n");
     malloc_statistics(info_get_mallstat, sentry);
@@ -904,7 +904,7 @@ statAvgTick(void *notused)
     squid_getrusage(&rusage);
     c->page_faults = rusage_pagefaults(&rusage);
     c->cputime = rusage_cputime(&rusage);
-    c->timestamp = current_time;
+    c->timestamp = currentTimeVal();
     /* even if NCountHist is small, we already Init()ed the tail */
     statCountersClean(CountHist + N_COUNT_HIST - 1);
     xmemmove(p, t, (N_COUNT_HIST - 1) * sizeof(StatCounters));
@@ -954,7 +954,7 @@ statCountersInit(StatCounters * C)
 {
     assert(C);
     memset(C, 0, sizeof(*C));
-    C->timestamp = current_time;
+    C->timestamp = currentTimeVal();
     statCountersInitSpecial(C);
 }
 
@@ -1175,7 +1175,7 @@ statCountersDump(StoreEntry * sentry)
     storeAppendPrintf(sentry, "cpu_time = %f\n",
 	f->cputime);
     storeAppendPrintf(sentry, "wall_time = %f\n",
-	tvSubDsec(f->timestamp, current_time));
+	tvSubDsec(f->timestamp, currentTimeVal()));
     storeAppendPrintf(sentry, "swap.outs = %d\n",
 	f->swap.outs);
     storeAppendPrintf(sentry, "swap.ins = %d\n",
@@ -1434,7 +1434,7 @@ statClientRequests(StoreEntry * s)
 	storeAppendPrintf(s, "start %ld.%06d (%f seconds ago)\n",
 	    (long int) http->start.tv_sec,
 	    (int) http->start.tv_usec,
-	    tvSubDsec(http->start, current_time));
+	    tvSubDsec(http->start, currentTimeVal()));
 	storeAppendPrintf(s, "\n");
     }
 }
Index: src/store.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/store.cc,v
retrieving revision 1.551
diff -u -w -p -r1.551 store.cc
--- src/store.cc	15 Oct 2002 09:25:33 -0000	1.551
+++ src/store.cc	15 Dec 2002 13:43:46 -0000
@@ -307,7 +307,7 @@ storeLockObject(StoreEntry * e)
     e->lock_count++;
     debug(20, 3) ("storeLockObject: key '%s' count=%d\n",
 	e->getMD5Text(), (int) e->lock_count);
-    e->lastref = squid_curtime;
+    e->lastref = currentTimeC();
     storeEntryReferenced(e);
 }
 
@@ -507,7 +507,7 @@ storeSetPublicKey(StoreEntry * e)
 	    String vary;
 	    pe = storeCreateEntry(mem->url, mem->log_url, request->flags, request->method);
 	    httpBuildVersion(&version, 1, 0);
-	    httpReplySetHeaders(pe->mem_obj->reply, version, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, squid_curtime + 100000);
+	    httpReplySetHeaders(pe->mem_obj->reply, version, HTTP_OK, "Internal marker object", "x-squid-internal/vary", -1, -1, currentTimeC() + 100000);
 	    vary = httpHeaderGetList(&mem->reply->header, HDR_VARY);
 	    if (strBuf(vary)) {
 		httpHeaderPutStr(&pe->mem_obj->reply->header, HDR_VARY, strBuf(vary));
@@ -575,7 +575,7 @@ storeCreateEntry(const char *url, const 
     e->swap_filen = -1;
     e->swap_dirn = -1;
     e->refcount = 0;
-    e->lastref = squid_curtime;
+    e->lastref = currentTimeC();
     e->timestamp = -1;		/* set in storeTimestampsSet() */
     e->ping_status = PING_NONE;
     EBIT_SET(e->flags, ENTRY_VALIDATED);
@@ -587,7 +587,7 @@ void
 storeExpireNow(StoreEntry * e)
 {
     debug(20, 3) ("storeExpireNow: '%s'\n", e->getMD5Text());
-    e->expires = squid_curtime;
+    e->expires = currentTimeC();
 }
 
 /* Append incoming data from a primary server to an entry. */
@@ -799,7 +799,7 @@ storeComplete(StoreEntry * e)
     }
 #if USE_CACHE_DIGESTS
     if (e->mem_obj->request)
-	e->mem_obj->request->hier.store_complete_stop = current_time;
+	e->mem_obj->request->hier.store_complete_stop = currentTimeVal();
 #endif
     /*
      * We used to call InvokeHandlers, then storeSwapOut.  However,
@@ -860,9 +860,9 @@ storeGetMemSpace(int size)
     static time_t last_check = 0;
     int pages_needed;
     RemovalPurgeWalker *walker;
-    if (squid_curtime == last_check)
+    if (currentTimeC() == last_check)
 	return;
-    last_check = squid_curtime;
+    last_check = currentTimeC();
     pages_needed = (size / SM_PAGE_SIZE) + 1;
     if (memInUse(MEM_MEM_NODE) + pages_needed < store_pages_max)
 	return;
@@ -911,10 +911,10 @@ storeMaintainSwapSpace(void *datanotused
 	    SD->maintainfs(SD);
     }
     if (store_swap_size > Config.Swap.maxSize) {
-	if (squid_curtime - last_warn_time > 10) {
+	if (currentTimeC() - last_warn_time > 10) {
 	    debug(20, 0) ("WARNING: Disk space over limit: %ld KB > %ld KB\n",
 		(long int) store_swap_size, (long int) Config.Swap.maxSize);
-	    last_warn_time = squid_curtime;
+	    last_warn_time = currentTimeC();
 	}
     }
     /* Reregister a maintain event .. */
@@ -1130,7 +1130,7 @@ storeCheckNegativeHit(StoreEntry * e)
 {
     if (!EBIT_TEST(e->flags, ENTRY_NEGCACHED))
 	return 0;
-    if (e->expires <= squid_curtime)
+    if (e->expires <= currentTimeC())
 	return 0;
     if (e->store_status != STORE_OK)
 	return 0;
@@ -1140,7 +1140,7 @@ storeCheckNegativeHit(StoreEntry * e)
 void
 storeNegativeCache(StoreEntry * e)
 {
-    e->expires = squid_curtime + Config.negativeTtl;
+    e->expires = currentTimeC() + Config.negativeTtl;
     EBIT_SET(e->flags, ENTRY_NEGCACHED);
 }
 
@@ -1162,7 +1162,7 @@ expiresMoreThan(time_t expires, time_t w
 {
     if (expires < 0)		/* No Expires given */
 	return 1;
-    return (expires > (squid_curtime + when));
+    return (expires > (currentTimeC() + when));
 }
 
 int
@@ -1171,7 +1171,7 @@ storeEntryValidToSend(StoreEntry * e)
     if (EBIT_TEST(e->flags, RELEASE_REQUEST))
 	return 0;
     if (EBIT_TEST(e->flags, ENTRY_NEGCACHED))
-	if (e->expires <= squid_curtime)
+	if (e->expires <= currentTimeC())
 	    return 0;
     if (EBIT_TEST(e->flags, ENTRY_ABORTED))
 	return 0;
@@ -1192,18 +1192,18 @@ storeTimestampsSet(StoreEntry * entry)
      * not matter much as this is calculated immediately when the headers
      * are received, not when the whole response has been received.
      */
-    /* make sure that 0 <= served_date <= squid_curtime */
-    if (served_date < 0 || served_date > squid_curtime)
-	served_date = squid_curtime;
+    /* make sure that 0 <= served_date <= currentTimeC() */
+    if (served_date < 0 || served_date > currentTimeC())
+	served_date = currentTimeC();
     /*
      * Compensate with Age header if origin server clock is ahead
      * of us and there is a cache in between us and the origin
      * server.  But DONT compensate if the age value is larger than
-     * squid_curtime because it results in a negative served_date.
+     * currentTimeC() because it results in a negative served_date.
      */
-    if (age > squid_curtime - served_date)
-	if (squid_curtime > age)
-	    served_date = squid_curtime - age;
+    if (age > currentTimeC() - served_date)
+	if (currentTimeC() > age)
+	    served_date = currentTimeC() - age;
     entry->expires = reply->expires;
     entry->lastmod = reply->last_modified;
     entry->timestamp = served_date;
Index: src/store_digest.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/store_digest.cc,v
retrieving revision 1.54
diff -u -w -p -r1.54 store_digest.cc
--- src/store_digest.cc	25 Oct 2002 07:36:32 -0000	1.54
+++ src/store_digest.cc	15 Dec 2002 13:43:46 -0000
@@ -234,7 +234,7 @@ storeDigestAddable(const StoreEntry * e)
      * update.
      */
 #if OLD_UNUSED_CODE		/* This code isn't applicable anymore, we can't fix it atm either :( */
-    if ((squid_curtime + Config.digest.rebuild_period) - e->lastref > storeExpiredReferenceAge())
+    if ((currentTimeC() + Config.digest.rebuild_period) - e->lastref > storeExpiredReferenceAge())
 	return 0;
 #endif
     return 1;
@@ -383,9 +383,9 @@ storeDigestRewriteResume(void)
     httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(e->mem_obj->reply, version, HTTP_OK, "Cache Digest OK",
 	"application/cache-digest", store_digest->mask_size + sizeof(sd_state.cblock),
-	squid_curtime, squid_curtime + Config.digest.rewrite_period);
+	currentTimeC(), currentTimeC() + Config.digest.rewrite_period);
     debug(71, 3) ("storeDigestRewrite: entry expires on %ld (%+d)\n",
-	(long int) e->mem_obj->reply->expires, (int) (e->mem_obj->reply->expires - squid_curtime));
+	(long int) e->mem_obj->reply->expires, (int) (e->mem_obj->reply->expires - currentTimeC()));
     storeBuffer(e);
     httpReplySwapOut(e->mem_obj->reply, e);
     storeDigestCBlockSwapOut(e);
@@ -401,7 +401,7 @@ storeDigestRewriteFinish(StoreEntry * e)
     storeComplete(e);
     storeTimestampsSet(e);
     debug(71, 2) ("storeDigestRewriteFinish: digest expires at %ld (%+d)\n",
-	(long int) e->expires, (int) (e->expires - squid_curtime));
+	(long int) e->expires, (int) (e->expires - currentTimeC()));
     /* is this the write order? @?@ */
     requestUnlink(e->mem_obj->request);
     e->mem_obj->request = NULL;
Index: src/store_dir.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/store_dir.cc,v
retrieving revision 1.139
diff -u -w -p -r1.139 store_dir.cc
--- src/store_dir.cc	15 Oct 2002 08:03:30 -0000	1.139
+++ src/store_dir.cc	15 Dec 2002 13:43:46 -0000
@@ -395,7 +395,7 @@ storeDirWriteCleanLogs(int reopen)
     }
     debug(20, 1) ("storeDirWriteCleanLogs: Starting...\n");
     getCurrentTime();
-    start = current_time;
+    start = currentTimeVal();
     for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) {
 	sd = &Config.cacheSwap.swapDirs[dirn];
 	if (sd->log.clean.start(sd) < 0) {
@@ -440,7 +440,7 @@ storeDirWriteCleanLogs(int reopen)
     if (reopen)
 	storeDirOpenSwapLogs();
     getCurrentTime();
-    dt = tvSubDsec(start, current_time);
+    dt = tvSubDsec(start, currentTimeVal());
     debug(20, 1) ("  Finished.  Wrote %d entries.\n", n);
     debug(20, 1) ("  Took %3.1f seconds (%6.1f entries/sec).\n",
 	dt, (double) n / (dt > 0.0 ? dt : 1.0));
Index: src/store_log.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/store_log.cc,v
retrieving revision 1.25
diff -u -w -p -r1.25 store_log.cc
--- src/store_log.cc	15 Oct 2002 08:03:30 -0000	1.25
+++ src/store_log.cc	15 Dec 2002 13:43:46 -0000
@@ -71,8 +71,8 @@ storeLog(int tag, const StoreEntry * e)
 	 * the existing log format.
 	 */
 	logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %d/%d %s %s\n",
-	    (int) current_time.tv_sec,
-	    (int) current_time.tv_usec / 1000,
+	    (int) currentTimeVal().tv_sec,
+	    (int) currentTimeVal().tv_usec / 1000,
 	    storeLogTags[tag],
 	    e->swap_dirn,
 	    e->swap_filen,
@@ -89,8 +89,8 @@ storeLog(int tag, const StoreEntry * e)
     } else {
 	/* no mem object. Most RELEASE cases */
 	logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s   ?         ?         ?         ? ?/? ?/? ? ?\n",
-	    (int) current_time.tv_sec,
-	    (int) current_time.tv_usec / 1000,
+	    (int) currentTimeVal().tv_sec,
+	    (int) currentTimeVal().tv_usec / 1000,
 	    storeLogTags[tag],
 	    e->swap_dirn,
 	    e->swap_filen,
Index: src/store_rebuild.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/store_rebuild.cc,v
retrieving revision 1.78
diff -u -w -p -r1.78 store_rebuild.cc
--- src/store_rebuild.cc	13 Oct 2002 20:35:05 -0000	1.78
+++ src/store_rebuild.cc	15 Dec 2002 13:43:46 -0000
@@ -130,7 +130,7 @@ storeRebuildComplete(struct _store_rebui
      */
     if (store_dirs_rebuilding > 1)
 	return;
-    dt = tvSubDsec(rebuild_start, current_time);
+    dt = tvSubDsec(rebuild_start, currentTimeVal());
     debug(20, 1) ("Finished rebuilding storage from disk.\n");
     debug(20, 1) ("  %7d Entries scanned\n", counts.scancount);
     debug(20, 1) ("  %7d Invalid entries.\n", counts.invalid);
@@ -157,7 +157,7 @@ void
 storeRebuildStart(void)
 {
     memset(&counts, '\0', sizeof(counts));
-    rebuild_start = current_time;
+    rebuild_start = currentTimeVal();
     /*
      * Note: store_dirs_rebuilding is initialized to 1 in globals.c.
      * This prevents us from trying to write clean logs until we
@@ -186,12 +186,12 @@ storeRebuildProgress(int sd_index, int t
 	return;
     RebuildProgress[sd_index].total = total;
     RebuildProgress[sd_index].scanned = sofar;
-    if (squid_curtime - last_report < 15)
+    if (currentTimeC() - last_report < 15)
 	return;
     for (sd_index = 0; sd_index < Config.cacheSwap.n_configured; sd_index++) {
 	n += (double) RebuildProgress[sd_index].scanned;
 	d += (double) RebuildProgress[sd_index].total;
     }
     debug(20, 1) ("Store rebuilding is %4.1f%% complete\n", 100.0 * n / d);
-    last_report = squid_curtime;
+    last_report = currentTimeC();
 }
Index: src/tools.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/tools.cc,v
retrieving revision 1.227
diff -u -w -p -r1.227 tools.cc
--- src/tools.cc	22 Oct 2002 09:41:57 -0000	1.227
+++ src/tools.cc	15 Dec 2002 13:43:47 -0000
@@ -291,7 +291,7 @@ death(int sig)
     storeDirWriteCleanLogs(0);
     PrintRusage();
     dumpMallocStats();
-    if (squid_curtime - SQUID_RELEASE_TIME < 864000) {
+    if (currentTimeC() - SQUID_RELEASE_TIME < 864000) {
 	/* skip if more than 10 days old */
 	if (Config.adminEmail)
 	    mail_warranty();
@@ -696,19 +696,6 @@ setMaxFD(void)
 	}
     }
 #endif /* RLIMIT_VMEM */
-}
-
-time_t
-getCurrentTime(void)
-{
-#if GETTIMEOFDAY_NO_TZP
-    gettimeofday(&current_time);
-#else
-    gettimeofday(&current_time, NULL);
-#endif
-    current_dtime = (double) current_time.tv_sec +
-	(double) current_time.tv_usec / 1000000.0;
-    return squid_curtime = current_time.tv_sec;
 }
 
 int
Index: src/urn.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/urn.cc,v
retrieving revision 1.79
diff -u -w -p -r1.79 urn.cc
--- src/urn.cc	25 Oct 2002 07:36:32 -0000	1.79
+++ src/urn.cc	15 Dec 2002 13:43:47 -0000
@@ -374,7 +374,7 @@ urnHandleReply(void *data, StoreIOBuffer
     httpReplyReset(rep);
     httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL,
-	"text/html", mb.size, 0, squid_curtime);
+	"text/html", mb.size, 0, currentTimeC());
     if (urnState->flags.force_menu) {
 	debug(51, 3) ("urnHandleReply: forcing menu\n");
     } else if (min_u) {
Index: src/useragent.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/useragent.cc,v
retrieving revision 1.26
diff -u -w -p -r1.26 useragent.cc
--- src/useragent.cc	16 Jul 2001 21:35:05 -0000	1.26
+++ src/useragent.cc	15 Dec 2002 13:43:47 -0000
@@ -71,10 +71,10 @@ logUserAgent(const char *client, const c
     const char *s;
     if (NULL == useragentlog)
 	return;
-    if (squid_curtime != last_time) {
-	s = mkhttpdlogtime(&squid_curtime);
+    if (currentTimeC() != last_time) {
+	s = mkhttpdlogtime(currentTimeC());
 	strcpy(time_str, s);
-	last_time = squid_curtime;
+	last_time = currentTimeC();
     }
     logfilePrintf(useragentlog, "%s [%s] \"%s\"\n",
 	client,
Index: src/wais.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/wais.cc,v
retrieving revision 1.144
diff -u -w -p -r1.144 wais.cc
--- src/wais.cc	21 Oct 2002 14:00:03 -0000	1.144
+++ src/wais.cc	15 Dec 2002 13:43:47 -0000
@@ -149,7 +149,7 @@ waisReadReply(int fd, char *buf, size_t 
 	comm_close(fd);
     } else if (flag == COMM_OK && len == 0) {
 	/* Connection closed; retrieval done. */
-	entry->expires = squid_curtime;
+	entry->expires = currentTimeC();
 	fwdComplete(waisState->fwd);
 	comm_close(fd);
     } else {
Index: src/auth/basic/auth_basic.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/auth/basic/auth_basic.cc,v
retrieving revision 1.20
diff -u -w -p -r1.20 auth_basic.cc
--- src/auth/basic/auth_basic.cc	15 Oct 2002 09:25:34 -0000	1.20
+++ src/auth/basic/auth_basic.cc	15 Dec 2002 13:43:47 -0000
@@ -151,7 +151,7 @@ static int
 authenticateBasicAuthenticated(auth_user_request_t * auth_user_request)
 {
     basic_data *basic_auth = static_cast<basic_data *>(auth_user_request->auth_user->scheme_data);
-    if ((basic_auth->flags.credentials_ok == 1) && (basic_auth->credentials_checkedtime + basicConfig->credentialsTTL > squid_curtime))
+    if ((basic_auth->flags.credentials_ok == 1) && (basic_auth->credentials_checkedtime + basicConfig->credentialsTTL > currentTimeC()))
 	return 1;
     debug(29, 4) ("User not authenticated or credentials need rechecking.\n");
     return 0;
@@ -184,7 +184,7 @@ authenticateBasicAuthenticateUser(auth_u
 	return;
 
     /* are we about to recheck the credentials externally? */
-    if ((basic_auth->credentials_checkedtime + basicConfig->credentialsTTL) <= squid_curtime) {
+    if ((basic_auth->credentials_checkedtime + basicConfig->credentialsTTL) <= currentTimeC()) {
 	debug(29, 4) ("authBasicAuthenticate: credentials expired - rechecking\n");
 	return;
     }
@@ -194,7 +194,7 @@ authenticateBasicAuthenticateUser(auth_u
 
     /* Decode now takes care of finding the auth_user struct in the cache */
     /* after external auth occurs anyway */
-    auth_user->expiretime = current_time.tv_sec;
+    auth_user->expiretime = currentTimeVal().tv_sec;
     return;
 }
 
@@ -208,7 +208,7 @@ authenticateBasicDirection(auth_user_req
     case 0:			/* not checked */
 	return -1;
     case 1:			/* checked & ok */
-	if (basic_auth->credentials_checkedtime + basicConfig->credentialsTTL <= squid_curtime)
+	if (basic_auth->credentials_checkedtime + basicConfig->credentialsTTL <= currentTimeC())
 	    return -1;
 	return 0;
     case 2:			/* paused while waiting for a username:password check on another request */
@@ -280,7 +280,7 @@ authenticateBasicHandleReply(void *data,
 	basic_auth->flags.credentials_ok = 1;
     else
 	basic_auth->flags.credentials_ok = 3;
-    basic_auth->credentials_checkedtime = squid_curtime;
+    basic_auth->credentials_checkedtime = currentTimeC();
     if (cbdataReferenceValidDone(r->data, &cbdata))
 	r->handler(cbdata, NULL);
     cbdataReferenceDone(r->data);
@@ -497,7 +497,7 @@ authenticateBasicDecodeAuth(auth_user_re
 	/* set the auth_user type */
 	auth_user->auth_type = AUTH_BASIC;
 	/* current time for timeouts */
-	auth_user->expiretime = current_time.tv_sec;
+	auth_user->expiretime = currentTimeVal().tv_sec;
 
 	/* this auth_user struct is the 'lucky one' to get added to the username cache */
 	/* the requests after this link to the auth_user */
Index: src/auth/digest/auth_digest.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/auth/digest/auth_digest.cc,v
retrieving revision 1.17
diff -u -w -p -r1.17 auth_digest.cc
--- src/auth/digest/auth_digest.cc	15 Oct 2002 09:25:34 -0000	1.17
+++ src/auth/digest/auth_digest.cc	15 Dec 2002 13:43:47 -0000
@@ -175,7 +175,7 @@ authenticateDigestNonceNew(void)
     newnonce->nc = 0;
     newnonce->flags.valid = 1;
     newnonce->noncedata.self = newnonce;
-    newnonce->noncedata.creationtime = current_time.tv_sec;
+    newnonce->noncedata.creationtime = currentTimeVal().tv_sec;
     newnonce->noncedata.randomdata = squid_random();
 
     authDigestNonceEncode(newnonce);
@@ -262,7 +262,7 @@ authenticateDigestNonceCacheCleanup(void
     digest_nonce_h *nonce;
     debug(29, 3) ("authenticateDigestNonceCacheCleanup: Cleaning the nonce cache now\n");
     debug(29, 3) ("authenticateDigestNonceCacheCleanup: Current time: %ld\n",
-	(long int)current_time.tv_sec);
+	(long int)currentTimeVal().tv_sec);
     hash_first(digest_nonce_cache);
     while ((nonce = ((digest_nonce_h *) hash_next(digest_nonce_cache)))) {
 	debug(29, 3) ("authenticateDigestNonceCacheCleanup: nonce entry  : %p '%s'\n", nonce, (char *)nonce->key);
@@ -370,8 +370,8 @@ authDigestNonceIsStale(digest_nonce_h * 
     if (!nonce)
 	return -1;
     /* has it's max duration expired? */
-    if (nonce->noncedata.creationtime + digestConfig->noncemaxduration < current_time.tv_sec) {
-	debug(29, 4) ("authDigestNonceIsStale: Nonce is too old. %ld %d %ld\n", (long int)nonce->noncedata.creationtime, (int)digestConfig->noncemaxduration, (long int)current_time.tv_sec);
+    if (nonce->noncedata.creationtime + digestConfig->noncemaxduration < currentTimeVal().tv_sec) {
+	debug(29, 4) ("authDigestNonceIsStale: Nonce is too old. %ld %d %ld\n", (long int)nonce->noncedata.creationtime, (int)digestConfig->noncemaxduration, (long int)currentTimeVal().tv_sec);
 	nonce->flags.valid = 0;
 	return -1;
     }
@@ -708,7 +708,7 @@ authenticateDigestAuthenticateUser(auth_
 
     /* auth_user is now linked, we reset these values
      * after external auth occurs anyway */
-    auth_user->expiretime = current_time.tv_sec;
+    auth_user->expiretime = currentTimeVal().tv_sec;
     return;
 }
 
Index: src/auth/ntlm/auth_ntlm.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/auth/ntlm/auth_ntlm.cc,v
retrieving revision 1.24
diff -u -w -p -r1.24 auth_ntlm.cc
--- src/auth/ntlm/auth_ntlm.cc	15 Oct 2002 09:25:35 -0000	1.24
+++ src/auth/ntlm/auth_ntlm.cc	15 Dec 2002 13:43:48 -0000
@@ -459,7 +459,7 @@ authenticateNTLMHandleReply(void *data, 
 	    fatal("lost NTLM helper state! quitting\n");
 	helperstate->challenge = xstrndup(reply, NTLM_CHALLENGE_SZ + 5);
 	helperstate->challengeuses = 0;
-	helperstate->renewed = squid_curtime;
+	helperstate->renewed = currentTimeC();
 	/* and we satisfy the request that happended on the refresh boundary */
 	/* note this code is now in two places FIXME */
 	assert(r->auth_user_request != NULL);
@@ -641,8 +641,8 @@ authenticateNTLMChangeChallenge_p(ntlm_h
 	debug(29, 4) ("authenticateNTLMChangeChallenge_p: Challenge uses (%d) exceeded max uses (%d)\n", helperstate->challengeuses, ntlmConfig->challengeuses);
 	return 1;
     }
-    if (helperstate->renewed + ntlmConfig->challengelifetime < squid_curtime) {
-	debug(29, 4) ("authenticateNTLMChangeChallenge_p: Challenge exceeded max lifetime by %d seconds\n", (int) (squid_curtime - (helperstate->renewed + ntlmConfig->challengelifetime)));
+    if (helperstate->renewed + ntlmConfig->challengelifetime < currentTimeC()) {
+	debug(29, 4) ("authenticateNTLMChangeChallenge_p: Challenge exceeded max lifetime by %d seconds\n", (int) (currentTimeC() - (helperstate->renewed + ntlmConfig->challengelifetime)));
 	return 1;
     }
     debug(29, 9) ("Challenge is to be reused\n");
@@ -1016,7 +1016,7 @@ authenticateNTLMAuthenticateUser(auth_us
 	    debug(29, 9) ("Username to be used is %s\n", ntlm_user->username);
 	    /* on ntlm auth we do not unlock the auth_user until the
 	     * connection is dropped. Thank MS for this quirk */
-	    auth_user->expiretime = current_time.tv_sec;
+	    auth_user->expiretime = currentTimeVal().tv_sec;
 	}
 	return;
 	break;
@@ -1058,7 +1058,7 @@ authenticateNTLMAuthenticateUser(auth_us
 	}
 	/* set these to now because this is either a new login from an 
 	 * existing user or a new user */
-	auth_user->expiretime = current_time.tv_sec;
+	auth_user->expiretime = currentTimeVal().tv_sec;
 	return;
 	break;
     case AUTHENTICATE_STATE_DONE:
Index: src/fs/aufs/aiops.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/fs/aufs/aiops.cc,v
retrieving revision 1.18
diff -u -w -p -r1.18 aiops.cc
--- src/fs/aufs/aiops.cc	10 Nov 2002 02:29:58 -0000	1.18
+++ src/fs/aufs/aiops.cc	15 Dec 2002 13:43:48 -0000
@@ -443,7 +443,7 @@ squidaio_queue_request(squidaio_request_
 	static int last_warn = 0;
 	static int queue_high, queue_low;
 	if (high_start == 0) {
-	    high_start = squid_curtime;
+	    high_start = currentTimeC();
 	    queue_high = request_queue_len;
 	    queue_low = request_queue_len;
 	}
@@ -451,13 +451,13 @@ squidaio_queue_request(squidaio_request_
 	    queue_high = request_queue_len;
 	if (request_queue_len < queue_low)
 	    queue_low = request_queue_len;
-	if (squid_curtime >= (last_warn + 15) &&
-	    squid_curtime >= (high_start + 5)) {
+	if (currentTimeC() >= (last_warn + 15) &&
+	    currentTimeC() >= (high_start + 5)) {
 	    debug(43, 1) ("squidaio_queue_request: WARNING - Disk I/O overloading\n");
-	    if (squid_curtime >= (high_start + 15))
+	    if (currentTimeC() >= (high_start + 15))
 		debug(43, 1) ("squidaio_queue_request: Queue Length: current=%d, high=%d, low=%d, duration=%ld\n",
-		    request_queue_len, queue_high, queue_low, (long int) (squid_curtime - high_start));
-	    last_warn = squid_curtime;
+		    request_queue_len, queue_high, queue_low, (long int) (currentTimeC() - high_start));
+	    last_warn = currentTimeC();
 	}
     } else {
 	high_start = 0;
Index: src/fs/diskd/store_dir_diskd.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/fs/diskd/store_dir_diskd.cc,v
retrieving revision 1.73
diff -u -w -p -r1.73 store_dir_diskd.cc
--- src/fs/diskd/store_dir_diskd.cc	28 Oct 2002 08:53:37 -0000	1.73
+++ src/fs/diskd/store_dir_diskd.cc	15 Dec 2002 13:43:48 -0000
@@ -168,10 +168,10 @@ storeDiskdDirSync(SwapDir * SD)
     static time_t lastmsg = 0;
     diskdinfo_t *diskdinfo = (diskdinfo_t *)SD->fsdata;
     while (diskdinfo->away > 0) {
-	if (squid_curtime > lastmsg) {
+	if (currentTimeC() > lastmsg) {
 	    debug(47, 1) ("storeDiskdDirSync: %d messages away\n",
 		diskdinfo->away);
-	    lastmsg = squid_curtime;
+	    lastmsg = currentTimeC();
 	}
 	storeDiskdDirCallback(SD);
     }
Index: src/repl/heap/store_heap_replacement.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/repl/heap/store_heap_replacement.cc,v
retrieving revision 1.10
diff -u -w -p -r1.10 store_heap_replacement.cc
--- src/repl/heap/store_heap_replacement.cc	15 Oct 2002 08:03:36 -0000	1.10
+++ src/repl/heap/store_heap_replacement.cc	15 Dec 2002 13:43:48 -0000
@@ -74,10 +74,10 @@ HeapKeyGen_StoreEntry_LFUDA(void *entry,
     double tie;
     if (e->lastref <= 0)
 	tie = 0.0;
-    else if (squid_curtime <= e->lastref)
+    else if (currentTimeC() <= e->lastref)
 	tie = 0.0;
     else
-	tie = 1.0 - exp((double) (e->lastref - squid_curtime) / 86400.0);
+	tie = 1.0 - exp((double) (e->lastref - currentTimeC()) / 86400.0);
     key = heap_age + (double) e->refcount - tie;
     debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: %s refcnt=%d lastref=%ld heap_age=%f tie=%f -> %f\n",
 	e->getMD5Text(), (int)e->refcount, e->lastref, heap_age, tie, key);
Index: src/repl/lru/store_repl_lru.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/repl/lru/store_repl_lru.cc,v
retrieving revision 1.12
diff -u -w -p -r1.12 store_repl_lru.cc
--- src/repl/lru/store_repl_lru.cc	13 Oct 2002 20:35:29 -0000	1.12
+++ src/repl/lru/store_repl_lru.cc	15 Dec 2002 13:43:49 -0000
@@ -260,7 +260,7 @@ lru_stats(RemovalPolicy * policy, StoreE
 	    lru_node = (LruNode *) lru_node->node.next;
 	    goto again;
 	}
-	storeAppendPrintf(sentry, "LRU reference age: %.2f days\n", (double) (squid_curtime - entry->lastref) / (double) (24 * 60 * 60));
+	storeAppendPrintf(sentry, "LRU reference age: %.2f days\n", (double) (currentTimeC() - entry->lastref) / (double) (24 * 60 * 60));
     }
 }
 
