]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
-Added background processing for rebuilding store
authorwessels <>
Tue, 16 Apr 1996 04:50:00 +0000 (04:50 +0000)
committerwessels <>
Tue, 16 Apr 1996 04:50:00 +0000 (04:50 +0000)
src/Makefile.in
src/main.cc
src/squid.h

index 9185c2f2f19b060f95c749166d7f6c6ca04169cc..f5de7f4a6e8611e68de0ae0053ce5260663b8bd8 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Harvest Object Cache server
 #
-#  $Id: Makefile.in,v 1.17 1996/04/12 00:11:02 wessels Exp $
+#  $Id: Makefile.in,v 1.18 1996/04/15 22:50:00 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -50,7 +50,7 @@ CLIENT_LIBS   = -L../lib -lutil $(XTRA_LIBS)
 PROGS          = cached 
 UTILS          = client dnsserver ftpget
 CGIPROGS       = cachemgr.cgi
-OBJS           = acl.o cache_cf.o cached_error.o comm.o \
+OBJS           = acl.o background.o cache_cf.o cached_error.o comm.o \
                connect.o debug.o disk.o dynamic_array.o \
                fdstat.o filemap.o ftp.o gopher.o \
                hash.o http.o icp.o ipcache.o \
index 322753c2e72c7082275a1f7b8fecc5822e80e857..16875009781f92d4d8cbed1e31cafa3238555e40 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: main.cc,v 1.32 1996/04/15 18:01:04 wessels Exp $ */
+/* $Id: main.cc,v 1.33 1996/04/15 22:53:35 wessels Exp $ */
 
 /* DEBUG: Section 1             main: startup and main loop */
 
@@ -250,6 +250,7 @@ int main(argc, argv)
     int n;                     /* # of GC'd objects */
     time_t last_maintain = 0;
     time_t last_announce = 0;
+    time_t loop_delay;
 
     errorInitialize();
 
@@ -302,12 +303,16 @@ int main(argc, argv)
     if (getCleanRate() > 0)
        next_cleaning = time(0L) + getCleanRate();
     while (1) {
+       loop_delay = (time_t) 60;
        /* maintain cache storage */
        if (cached_curtime > last_maintain) {
            storeMaintainSwapSpace();
            last_maintain = cached_curtime;
        }
-       switch (comm_select((time_t) 60, next_cleaning)) {
+       /* do background processing */
+       if (doBackgroundProcessing())
+           loop_delay = (time_t) 0;
+       switch (comm_select(loop_delay, next_cleaning)) {
        case COMM_OK:
            /* do nothing */
            break;
index 0faf1172dff60748bd7d083ed63d5cd56034895d..fda965f61ae4996fc9aa48169786ae30da12234a 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: squid.h,v 1.15 1996/04/11 22:52:30 wessels Exp $ */
+/* $Id: squid.h,v 1.16 1996/04/15 22:54:07 wessels Exp $ */
 
 #include "config.h"
 #include "autoconf.h"
@@ -119,6 +119,7 @@ typedef unsigned long u_num32;
 #include "send-announce.h"
 #include "acl.h"
 #include "util.h"
+#include "background.h"
 
 extern time_t cached_starttime;        /* main.c */
 extern time_t next_cleaning;   /* main.c */