]> code.citadel.org Git - citadel.git/commitdiff
* serv_network.c: aggressively poll any node for which we have data
authorArt Cancro <ajc@citadel.org>
Sun, 7 Sep 2003 03:29:25 +0000 (03:29 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 7 Sep 2003 03:29:25 +0000 (03:29 +0000)
citadel/ChangeLog
citadel/serv_network.c

index e62eefcc078556337de6f052b9e70ac1e1c2ce63..56796f57832e02bb05e828c4d37e85b86cd8d6fb 100644 (file)
@@ -1,4 +1,7 @@
  $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
 
@@ -5004,3 +5007,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 1be06c8bee19bd97e527869930c15cdef72b0230..776bd009d9820baa6a457d4b0de342ba5db15478 100644 (file)
@@ -1424,8 +1424,10 @@ bail:    sock_close(sock);
 
 /*
  * 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];
@@ -1433,6 +1435,8 @@ void network_poll_other_citadel_nodes(void) {
        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 */
@@ -1446,7 +1450,17 @@ void network_poll_other_citadel_nodes(void) {
                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);
+                       }
                }
        }
 
@@ -1487,11 +1501,11 @@ void network_do_queue(void) {
        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.