]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Added client_db.c; keeps stats on clients, use cachemgr
authorwessels <>
Tue, 15 Oct 1996 05:45:19 +0000 (05:45 +0000)
committerwessels <>
Tue, 15 Oct 1996 05:45:19 +0000 (05:45 +0000)
          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).

ChangeLog
src/Makefile.in
src/cachemgr.cc
src/main.cc
src/squid.h
src/stat.cc

index 2c4ce8e00763ff00303144d363973bcca30178a1..e2e56d7dba93e33bfb555747b9b452f65557ece8 100644 (file)
--- 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.
index 193466c844fbcca9f46753a70f8d0655ebb79fe3..a8e0048b9a570a038310dfe56ba3b40d76593be4 100644 (file)
@@ -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 \
index fb25b9798dfcc6fceb98bace8d988094d16bcb63..94c5479e8eba1d3ed0e2ea95e81f5265b726e973 100644 (file)
@@ -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:
index 3e82296b5b9a851da1bf628f534cb058d9f47f96..9ba0aa336e172c4933f6d57fdc969e550ac6f97f 100644 (file)
@@ -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();
index 9b8bfcb33926301e90cf80fd79fbaca8c99b0759..2a5722be9610bbaee52c0526fb7ad580109f206c 100644 (file)
@@ -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"
index 755045d3c6aab872f58aa5baf67e7c73ccbcf0e0..b7c4e8e9fe1ecab401fb3261c6d2d3e9d7162e0c 100644 (file)
@@ -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",