From: wessels <> Date: Tue, 15 Oct 1996 05:45:19 +0000 (+0000) Subject: - Added client_db.c; keeps stats on clients, use cachemgr X-Git-Tag: SQUID_3_0_PRE1~5657 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ecceaa4cdebec59ba451d132ce107d9b5e69c36;p=thirdparty%2Fsquid.git - Added client_db.c; keeps stats on clients, use cachemgr to view client list. - Stop sending ICP_OP_DENIED to clients if 95% of their queries are denied (then they'll think we're dead). --- diff --git a/ChangeLog b/ChangeLog index 2c4ce8e007..e2e56d7dba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,13 @@ TODO LIST before official squid-1.1: - Write Perl script to convert squid-1.0 store to squid-1.1 structure. +Changes to squid-1.1.beta8 (): + + - Added client_db.c; keeps stats on clients, use cachemgr + to view client list. + - Stop sending ICP_OP_DENIED to clients if 95% of their + queries are denied (then they'll think we're dead). + Changes to squid-1.1.beta7 (October 14, 1996): - Combined and renamed comm_set_select_handler() functions. diff --git a/src/Makefile.in b/src/Makefile.in index 193466c844..a8e0048b9a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.46 1996/10/13 10:04:21 wessels Exp $ +# $Id: Makefile.in,v 1.47 1996/10/14 23:45:24 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -59,7 +59,8 @@ CLIENT_LIBS = -L../lib -lmiscutil $(XTRA_LIBS) PROGS = squid client UTILS = dnsserver ftpget pinger CGIPROGS = cachemgr.cgi -OBJS = acl.o async_io.o background.o cache_cf.o errorpage.o \ +OBJS = acl.o async_io.o background.o cache_cf.o \ + client_db.o errorpage.o \ client_side.o comm.o debug.o disk.o dns.o \ fdstat.o filemap.o ftp.o fqdncache.o gopher.o \ hash.o http.o icmp.o icp.o ident.o ipcache.o \ diff --git a/src/cachemgr.cc b/src/cachemgr.cc index fb25b9798d..94c5479e8e 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.34 1996/10/09 15:34:21 wessels Exp $ + * $Id: cachemgr.cc,v 1.35 1996/10/14 23:45:25 wessels Exp $ * * DEBUG: Section 0 CGI Cache Manager * AUTHOR: Harvest Derived @@ -220,6 +220,7 @@ typedef enum { INFO, CACHED, SERVER, + CLIENTS, LOG, PARAM, STATS_I, @@ -245,6 +246,7 @@ static char *op_cmds[] = "info", "squid.conf", "server_list", + "client_list", "log", "parameter", "stats/ipcache", @@ -270,6 +272,7 @@ static char *op_cmds_descr[] = "Cache Information", "Cache Configuration File", "Cache Server List", + "Cache Client List", "Cache Log", "Cache Parameters", "IP Cache Contents", @@ -367,6 +370,7 @@ noargs_html(char *host, int port, char *url) print_option(op, STATS_O); print_option(op, STATS_VM); print_option(op, SERVER); + print_option(op, CLIENTS); print_option(op, STATS_I); print_option(op, STATS_F); print_option(op, STATS_D); @@ -680,6 +684,7 @@ main(int argc, char *argv[]) case INFO: case CACHED: case SERVER: + case CLIENTS: case LOG: case PARAM: case STATS_I: @@ -737,6 +742,7 @@ main(int argc, char *argv[]) print_option(op, STATS_O); print_option(op, STATS_VM); print_option(op, SERVER); + print_option(op, CLIENTS); print_option(op, STATS_I); print_option(op, STATS_F); print_option(op, STATS_D); @@ -777,6 +783,7 @@ main(int argc, char *argv[]) case INFO: case CACHED: case SERVER: + case CLIENTS: case LOG: case STATS_I: case STATS_F: @@ -849,6 +856,7 @@ main(int argc, char *argv[]) case INFO: case CACHED: case SERVER: + case CLIENTS: case LOG: case STATS_I: case STATS_F: diff --git a/src/main.cc b/src/main.cc index 3e82296b5b..9ba0aa336e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $Id: main.cc,v 1.94 1996/10/13 09:17:13 wessels Exp $ + * $Id: main.cc,v 1.95 1996/10/14 23:45:29 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -391,6 +391,7 @@ serverConnectionsOpen(void) } } } + clientdbInit(); #if USE_ICMP icmpOpen(); netdbInit(); diff --git a/src/squid.h b/src/squid.h index 9b8bfcb339..2a5722be96 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.59 1996/10/13 06:19:50 wessels Exp $ + * $Id: squid.h,v 1.60 1996/10/14 23:45:30 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -254,6 +254,7 @@ typedef int (*QS) (const void *, const void *); #include "client_side.h" #include "icmp.h" #include "net_db.h" +#include "client_db.h" #if !HAVE_TEMPNAM #include "tempnam.h" diff --git a/src/stat.cc b/src/stat.cc index 755045d3c6..b7c4e8e9fe 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.85 1996/10/14 21:29:32 wessels Exp $ + * $Id: stat.cc,v 1.86 1996/10/14 23:45:31 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -648,6 +648,7 @@ memoryAccounted(void) meta_data.netdb_addrs * sizeof(netdbEntry) + meta_data.netdb_hosts * sizeof(struct _net_db_name) + #endif + meta_data.client_info * client_info_sz + meta_data.misc; } @@ -853,6 +854,11 @@ info_get(cacheinfo * obj, StoreEntry * sentry) (int) sizeof(struct _net_db_name), (int) (meta_data.netdb_hosts * sizeof(struct _net_db_name) >> 10)); #endif + storeAppendPrintf(sentry, "{\t%-25.25s %7d x %4d bytes = %6d KB}\n", + "ClientDB Entries", + meta_data.client_info, + client_info_sz, + (int) (meta_data.client_info * client_info_sz >> 10)); storeAppendPrintf(sentry, "{\t%-25.25s = %6d KB}\n", "Miscellaneous",