$Log$
+ Revision 614.22 2004/02/07 05:28:10 ajc
+ * Automatically purge files from ./network/spoolout which were intended
+ for nodes which no longer exist
+
Revision 614.21 2004/02/07 04:59:21 ajc
* Cache the IGnet config in memory, avoiding a db fetch for every single
operation which references it. Invalidate the cache when a new config
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
}
+/*
+ * Delete any files in the outbound queue that were intended
+ * to be sent to nodes which no nlonger exist.
+ */
+void network_purge_spoolout(void) {
+ DIR *dp;
+ struct dirent *d;
+ char filename[SIZ];
+ char nexthop[SIZ];
+ int i;
+
+ dp = opendir("./network/spoolout");
+ if (dp == NULL) return;
+
+ while (d = readdir(dp), d != NULL) {
+ snprintf(filename, sizeof filename,
+ "./network/spoolout/%s", d->d_name);
+
+ strcpy(nexthop, "");
+ i = is_valid_node(nexthop, NULL, d->d_name);
+
+ if ( (i != 0) || (strlen(nexthop) > 0) ) {
+ unlink(filename);
+ }
+ }
+
+
+ closedir(dp);
+}
free_filter_list(filterlist);
filterlist = NULL;
+ network_purge_spoolout();
+
lprintf(7, "network: queue run completed\n");
if (full_processing) {