$Log$
+ Revision 610.11 2003/09/07 03:29:25 ajc
+ * serv_network.c: aggressively poll any node for which we have data
+
Revision 610.10 2003/09/06 02:04:54 ajc
* Don't reset "last poll" time when not doing the "full" net processing
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
/*
* Poll other Citadel nodes and transfer inbound/outbound network data.
+ * Set "full" to nonzero to force a poll of every node, or to zero to poll
+ * only nodes to which we have data to send.
*/
-void network_poll_other_citadel_nodes(void) {
+void network_poll_other_citadel_nodes(int full_poll) {
char *ignetcfg = NULL;
int i;
char linebuf[SIZ];
char host[SIZ];
char port[SIZ];
char secret[SIZ];
+ int poll = 0;
+ char spoolfile[SIZ];
ignetcfg = CtdlGetSysConfig(IGNETCFG);
if (ignetcfg == NULL) return; /* no nodes defined */
extract(port, linebuf, 3);
if ( (strlen(node) > 0) && (strlen(secret) > 0)
&& (strlen(host) > 0) && strlen(port) > 0) {
- network_poll_node(node, secret, host, port);
+ poll = full_poll;
+ if (poll == 0) {
+ sprintf(spoolfile, "./network/spoolout/%s",
+ node);
+ if (access(spoolfile, R_OK) == 0) {
+ poll = 1;
+ }
+ }
+ if (poll) {
+ network_poll_node(node, secret, host, port);
+ }
}
}
doing_queue = 1;
/*
- * Poll other Citadel nodes.
+ * Poll other Citadel nodes. Maybe. If "full_processing" is set
+ * then we poll everyone. Otherwise we only poll nodes we have stuff
+ * to send to.
*/
- if (full_processing) {
- network_poll_other_citadel_nodes();
- }
+ network_poll_other_citadel_nodes(full_processing);
/*
* Load the network map and filter list into memory.