]> code.citadel.org Git - citadel.git/commitdiff
* Support for IGnet routing (not tested)
authorArt Cancro <ajc@citadel.org>
Mon, 17 Sep 2001 23:55:45 +0000 (23:55 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 17 Sep 2001 23:55:45 +0000 (23:55 +0000)
citadel/ChangeLog
citadel/serv_network.c

index 663d75a1cfb756ba6837e55c7ddace04d86da3fa..c14bea3b6e542d2a1da281c54a3645fb5afe2992 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 580.43  2001/09/17 23:55:45  ajc
+ * Support for IGnet routing (not tested)
+
  Revision 580.42  2001/09/16 05:44:51  ajc
  * serv_smtp.c: instead of doubling delivery retry times unbounded, set a
    maximum retry time of SMTP_RETRY_MAX (currently set to 12 hours)
@@ -2745,4 +2748,3 @@ 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 c663e988f7b51ae75892f6138f556fdcdec7d30f..30dc7fe378a74a0a1d04d93ac80288d136c50585 100644 (file)
@@ -434,6 +434,7 @@ void network_spool_msg(long msgnum, void *userdata) {
                                        }
                                }
                        }
+                       phree(sermsg.ser);
                }
        }
 
@@ -604,6 +605,10 @@ void network_process_buffer(char *buffer, long size) {
        struct usersupp tempUS;
        char recp[SIZ];
        char target_room[ROOMNAMELEN];
+       struct ser_ret sermsg;
+       char *oldpath = NULL;
+       char filename[SIZ];
+       FILE *fp;
 
        /* Set default target room to trash */
        strcpy(target_room, TWITROOM);
@@ -625,11 +630,39 @@ void network_process_buffer(char *buffer, long size) {
        if (msg->cm_fields['D'] != NULL) {
                if (strcasecmp(msg->cm_fields['D'], config.c_nodename)) {
 
+                       /* route the message */
                        if (is_valid_node(NULL, msg->cm_fields['D']) == 0) {
 
-                               /* FIXME route the message, stupid */
-
-
+                               /* prepend our node to the path */
+                               if (msg->cm_fields['P'] != NULL) {
+                                       oldpath = msg->cm_fields['P'];
+                                       msg->cm_fields['P'] = NULL;
+                               }
+                               else {
+                                       oldpath = strdoop("unknown_user");
+                               }
+                               msg->cm_fields['P'] =
+                                       mallok(strlen(oldpath) + SIZ);
+                               sprintf(msg->cm_fields['P'], "%s!%s",
+                                       config.c_nodename, oldpath);
+                               phree(oldpath);
+
+                               /* serialize the message */
+                               serialize_message(&sermsg, msg);
+
+                               /* now send it */
+                               sprintf(filename,
+                                       "./network/spoolout/%s",
+                                       msg->cm_fields['D']);
+                               fp = fopen(filename, "ab");
+                               if (fp != NULL) {
+                                       fwrite(sermsg.ser,
+                                               sermsg.len, 1, fp);
+                                       fclose(fp);
+                               }
+                               phree(sermsg.ser);
+                               CtdlFreeMessage(msg);
+                               return;
                        }
                        
                        else {  /* invalid destination node name */