diff -Naur wwwoffle-2.5c/README wwwoffle-2.5c.patched/README --- wwwoffle-2.5c/README Wed Sep 1 21:21:09 1999 +++ wwwoffle-2.5c.patched/README Sat Jan 29 11:33:53 2000 @@ -389,6 +389,9 @@ time. Or if a maximum size is specified then delete the oldest pages until the maximum size is not exceeded. +wwwoffle -cycle This tells the demon to cycle the URLs from the + lasttime directory down to the prevtime directories. + wwwoffle -kill Causes the demon to exit cleanly at a convenient point. diff -Naur wwwoffle-2.5c/audit-usage.pl wwwoffle-2.5c.patched/audit-usage.pl --- wwwoffle-2.5c/audit-usage.pl Mon Jul 26 20:00:51 1999 +++ wwwoffle-2.5c.patched/audit-usage.pl Sat Jan 29 11:35:09 2000 @@ -23,7 +23,7 @@ "Offline","-offline", "In Autodial Mode","-autodial", "Re-Reading Configuration File","-config", - "Purge","-purge", + "Cycle","-cycle", "Kill","-kill"); %modes=("-spool","S", @@ -88,7 +88,7 @@ $mode{$2}=$mode; } } - elsif(/WWWOFFLE (Online|Fetch|Offline|In Autodial Mode|Re-Reading Configuration File|Purge|Kill)\./) + elsif(/WWWOFFLE (Online|Fetch|Offline|In Autodial Mode|Re-Reading Configuration File|Purge|Cycle|Kill)\./) { $command=$commands{$1}; printf("W %16s %12s %8s WWWOFFLE %s\n",$host,$ip,"",$command); diff -Naur wwwoffle-2.5c/connect.c wwwoffle-2.5c.patched/connect.c --- wwwoffle-2.5c/connect.c Sun Aug 8 12:27:45 1999 +++ wwwoffle-2.5c.patched/connect.c Fri Jan 28 16:26:23 2000 @@ -123,7 +123,7 @@ write_string(client,"WWWOFFLE Now Online\n"); PrintMessage(Important,"WWWOFFLE Online."); /* Used in audit-usage.pl */ - CycleLastTimeSpoolFile(); + /* CycleLastTimeSpoolFile(); */ ForkRunModeScript(RunOnline,"online",client); } @@ -216,6 +216,31 @@ write_string(client,"WWWOFFLE Purge Finished.\n"); PrintMessage(Important,"WWWOFFLE Purge finished."); + + exit(0); + } + } + else if(!strncmp(&line[9],"CYCLE",5)) + { + pid_t pid; + + if((pid=fork())==-1) + {PrintMessage(Warning,"Cannot fork to do a cycle [%!s].");return;} + else if(!pid) + { + if(fetch_fd!=-1) + CloseSocket(fetch_fd); + + CloseSocket(http_fd); + CloseSocket(wwwoffle_fd); + + write_string(client,"WWWOFFLE Cycle Starting.\n"); + PrintMessage(Important,"WWWOFFLE Cycle."); /* Used in audit-usage.pl */ + + CycleLastTimeSpoolFile(); + + write_string(client,"WWWOFFLE Cycle Finished.\n"); + PrintMessage(Important,"WWWOFFLE Cycle finished."); exit(0); } diff -Naur wwwoffle-2.5c/control.c wwwoffle-2.5c.patched/control.c --- wwwoffle-2.5c/control.c Fri Oct 15 11:08:22 1999 +++ wwwoffle-2.5c.patched/control.c Sat Jan 29 11:43:21 2000 @@ -36,6 +36,7 @@ Fetch, /*+ Tell the server to fetch the requested pages. +*/ Config, /*+ Tell the server to re-read the configuration file. +*/ Purge, /*+ Tell the server to purge pages. +*/ + CycleLasttime, /*+ Tell the server to cycle the URLs from the lasttime directory down to the prevtime directories +*/ Delete, /*+ Delete a page from the cache or a request from the outgoing directory. +*/ DeleteMultiple, /*+ Delete mulitple pages from the cache or requests from the outgoing directory. +*/ ConfigEdit, /*+ Edit the config file. +*/ @@ -86,6 +87,8 @@ {action=Config;command="-config";} else if(!strcmp(newpath,"purge")) {action=Purge;command="-purge";} + else if(!strcmp(newpath,"cycle")) + {action=CycleLasttime;command="-cycle";} else if(!strncmp(newpath,"delete-multiple",15)) action=DeleteMultiple; else if(!strncmp(newpath,"delete",6)) @@ -201,6 +204,8 @@ write_string(socket,"WWWOFFLE CONFIG\r\n"); else if(action==Purge) write_string(socket,"WWWOFFLE PURGE\r\n"); + else if(action==CycleLasttime) + write_string(socket,"WWWOFFLE CYCLE\r\n"); while((buffer=read_line(socket,buffer))) write_string(fd,buffer); diff -Naur wwwoffle-2.5c/html/messages/ControlPage.html wwwoffle-2.5c.patched/html/messages/ControlPage.html --- wwwoffle-2.5c/html/messages/ControlPage.html Sun Aug 29 13:07:13 1999 +++ wwwoffle-2.5c.patched/html/messages/ControlPage.html Sat Jan 29 11:00:49 2000 @@ -65,6 +65,11 @@ Force the wwwoffled cache to be purged. +
+ + Cycle the URLs from the lasttime directory down to the prevtime directories. +
+

The Configuration File

The configuration file wwwoffle.conf can be edited on the following page. diff -Naur wwwoffle-2.5c/wwwoffle.c wwwoffle-2.5c.patched/wwwoffle.c --- wwwoffle-2.5c/wwwoffle.c Fri Oct 15 11:26:54 1999 +++ wwwoffle-2.5c.patched/wwwoffle.c Sat Jan 29 11:11:26 2000 @@ -49,6 +49,8 @@ Purge, /*+ Tell the server to purge pages. +*/ + CycleLasttime, /*+ Tell the server to cycle the URLs from the lasttime directory down to the prevtime directories +*/ + Kill, /*+ Tell the server to exit. +*/ Get, /*+ Tell the server to GET pages. +*/ @@ -339,6 +341,15 @@ continue; } + if(!strcmp(argv[i],"-cycle")) + { + if(action!=None) + {fprintf(stderr,"wwwoffle: Only one command at a time.\n\n");usage(0);} + action=CycleLasttime; + argv[i]=NULL; + continue; + } + if(!strcmp(argv[i],"-kill")) { if(action!=None) @@ -439,6 +450,8 @@ write_string(socket,"WWWOFFLE CONFIG\r\n"); else if(action==Purge) write_string(socket,"WWWOFFLE PURGE\r\n"); + else if(action==CycleLasttime) + write_string(socket,"WWWOFFLE CYCLE\r\n"); else if(action==Kill) write_string(socket,"WWWOFFLE KILL\r\n"); else @@ -798,7 +811,7 @@ fprintf(stderr, "Usage: wwwoffle -h\n" " wwwoffle -online | -autodial | -offline | -fetch\n" - " wwwoffle -config | -purge | -kill\n" + " wwwoffle -config | -purge | -cycle | -kill\n" " wwwoffle [-o|-O] \n" " wwwoffle [-g[Sisfo]] [-F] [-(d|r|R)[]] ...\n" " wwwoffle [-g[Sisfo]] [-F] [-(d|r|R)[]] [|-] ...\n" @@ -827,6 +840,8 @@ "wwwoffle -config : Force the server to re-read the configuration file.\n" "\n" "wwwoffle -purge : Force the server to purge pages from the cache.\n" + "\n" + "wwwoffle -cycle : Force the server to cycle the lasttime index and the prevtime indexes.\n" "\n" "wwwoffle -kill : Force the server to exit cleanly.\n" "\n" diff -Naur wwwoffle-2.5c/wwwoffle.man wwwoffle-2.5c.patched/wwwoffle.man --- wwwoffle-2.5c/wwwoffle.man Sat Oct 2 23:50:50 1999 +++ wwwoffle-2.5c.patched/wwwoffle.man Sat Jan 29 11:38:24 2000 @@ -47,6 +47,10 @@ .B [\-p [:] | \-c ] .P .B wwwoffle +.B \-cycle +.B [\-p [:] | \-c ] +.P +.B wwwoffle .B \-kill .B [\-p [:] | \-c ] .P @@ -127,6 +131,10 @@ configuration file wwwoffle.conf(5) specifies the maximum age of the pages to keep. If a maximum cache size is specified then the oldest pages are deleted until the size is not exceeded. +.TP +.B \-cycle +Tell the wwwoffled proxy server to cycle the URLs from the lasttime directory +down to the prevtime directories. .TP .B \-kill Tell the wwwoffled proxy server to exit cleanly at the next convenient point.