]> code.citadel.org Git - citadel.git/commitdiff
* Don't try to directly spool to non-neighbor nodes
authorArt Cancro <ajc@citadel.org>
Tue, 2 Sep 2003 04:04:39 +0000 (04:04 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 2 Sep 2003 04:04:39 +0000 (04:04 +0000)
citadel/ChangeLog
citadel/serv_network.c

index 6a3298b444ad20f833ffad00fbfedbcce0a24ddf..5250a9d2c658df9e1791d40d9c69bbbd99144744 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 610.5  2003/09/02 04:04:39  ajc
+ * Don't try to directly spool to non-neighbor nodes
+
  Revision 610.4  2003/08/29 08:21:57  ajc
  * Do network runs more proactively.  The inbound queue is now scanned
    every minute instead of every poll frequency.
@@ -4983,3 +4986,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 4d9ed6bdcde0b64765d55b57a953440488198c54..1d564fc727401033b72584c68d7c36e2c37377f2 100644 (file)
@@ -1006,6 +1006,7 @@ void network_process_buffer(char *buffer, long size) {
        char filename[SIZ];
        FILE *fp;
        char buf[SIZ];
+       char nexthop[SIZ];
 
        /* Set default target room to trash */
        strcpy(target_room, TWITROOM);
@@ -1028,7 +1029,8 @@ void network_process_buffer(char *buffer, long size) {
                if (strcasecmp(msg->cm_fields['D'], config.c_nodename)) {
 
                        /* route the message */
-                       if (is_valid_node(NULL, NULL,
+                       strcpy(nexthop, "");
+                       if (is_valid_node(nexthop, NULL,
                           msg->cm_fields['D']) == 0) {
 
                                /* prepend our node to the path */
@@ -1049,9 +1051,11 @@ void network_process_buffer(char *buffer, long size) {
                                serialize_message(&sermsg, msg);
 
                                /* now send it */
+                               if (strlen(nexthop) == 0) {
+                                       strcpy(nexthop, msg->cm_fields['D']);
+                               }
                                snprintf(filename, sizeof filename,
-                                       "./network/spoolout/%s",
-                                       msg->cm_fields['D']);
+                                       "./network/spoolout/%s", nexthop);
                                fp = fopen(filename, "ab");
                                if (fp != NULL) {
                                        fwrite(sermsg.ser,