From: wessels <> Date: Tue, 24 Mar 1998 05:37:10 +0000 (+0000) Subject: added event list to cachemgr outputs X-Git-Tag: SQUID_3_0_PRE1~3760 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ba559965a3e4c1e4ee2e37b7b2bce78e07b8ad5;p=thirdparty%2Fsquid.git added event list to cachemgr outputs --- diff --git a/src/event.cc b/src/event.cc index 979c83987e..1bb98b0d55 100644 --- a/src/event.cc +++ b/src/event.cc @@ -1,6 +1,6 @@ /* - * $Id: event.cc,v 1.9 1997/11/05 05:29:23 wessels Exp $ + * $Id: event.cc,v 1.10 1998/03/23 22:37:10 wessels Exp $ * * DEBUG: section 41 Event Processing * AUTHOR: Henrik Nordstrom @@ -41,6 +41,7 @@ struct ev_entry { }; static struct ev_entry *tasks = NULL; +static OBJH eventDump; void eventAdd(const char *name, EVH * func, void *arg, time_t when) @@ -105,3 +106,25 @@ eventNextTime(void) return (time_t) 10; return tasks->when - squid_curtime; } + +void +eventInit(void) +{ + cachemgrRegister("events", + "Event Queue", + eventDump, 0); +} + +static void +eventDump(StoreEntry * sentry) +{ + struct ev_entry *e = tasks; + storeAppendPrintf(sentry, "%s\t%s\n", + "Operation", + "Next Execution"); + while (e != NULL) { + storeAppendPrintf(sentry, "%s\t%d seconds\n", + e->name, e->when - squid_curtime); + e = e->next; + } +} diff --git a/src/main.cc b/src/main.cc index 2d92e090d8..7f1dfee480 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.237 1998/03/17 05:12:36 wessels Exp $ + * $Id: main.cc,v 1.238 1998/03/23 22:37:11 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -480,6 +480,7 @@ mainInitialize(void) do_mallinfo = 1; mimeInit(Config.mimeTablePathname); pconnInit(); + eventInit(); } serverConnectionsOpen(); if (theOutIcpConnection >= 0 && (!Config2.Accel.on || Config.onoff.accel_with_proxy)) diff --git a/src/protos.h b/src/protos.h index 0c7b9d4b2f..beece5e6d8 100644 --- a/src/protos.h +++ b/src/protos.h @@ -158,6 +158,7 @@ extern void eventAdd(const char *name, EVH * func, void *arg, time_t when); extern void eventRun(void); extern time_t eventNextTime(void); extern void eventDelete(EVH * func, void *arg); +extern void eventInit(void); extern void fd_close(int fd); extern void fd_open(int fd, unsigned int type, const char *);