]> code.citadel.org Git - citadel.git/commitdiff
* Fixed a bug in the loopzapper that was corrupting the use table saved copy.
authorArt Cancro <ajc@citadel.org>
Mon, 15 Oct 2001 19:50:50 +0000 (19:50 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 15 Oct 2001 19:50:50 +0000 (19:50 +0000)
* Post notification in Aide> when the loopzapper catches a message.

citadel/ChangeLog
citadel/serv_network.c

index 4a82342b7e73fcd5877bd44c06811b2b97388ec7..2d494e41d16718b0b764ecd5ceac3c5602135cba 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 580.57  2001/10/15 19:50:50  ajc
+ * Fixed a bug in the loopzapper that was corrupting the use table saved copy.
+ * Post notification in Aide> when the loopzapper catches a message.
+
  Revision 580.56  2001/10/12 22:41:11  ajc
  * Wrote the rest of the use table code.  Finished except for a bug.
 
@@ -2791,4 +2795,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 68348937d1c1ffdb19951750bcc3388da851e7c0..2dd370bc3bfb4e62f78966f55b7886bb51578b61 100644 (file)
@@ -12,7 +12,6 @@
 /*
  * FIXME
  * Don't allow polls during network processing
- * Use table isn't saving properly across sessions
  */
 
 #include "sysdep.h"
@@ -159,9 +158,12 @@ int network_usetable(int operation, struct CtdlMessage *msg) {
                                stlen = stlen + strlen(uptr->message_id) + 20;
                        }
                        serialized_table = mallok(stlen);
+                       memset(serialized_table, 0, stlen);
 
                        while (ut != NULL) {
-                               if (serialized_table != NULL) {
+                               if ( (serialized_table != NULL) 
+                                  && ( (ut->timestamp - time(NULL)) <
+                                     USETABLE_RETAIN) ) {
                                        sprintf(&serialized_table[strlen(
                                          serialized_table)], "%s|%ld\n",
                                            ut->message_id,
@@ -825,6 +827,7 @@ void network_process_buffer(char *buffer, long size) {
        char *oldpath = NULL;
        char filename[SIZ];
        FILE *fp;
+       char buf[SIZ];
 
        /* Set default target room to trash */
        strcpy(target_room, TWITROOM);
@@ -898,7 +901,9 @@ void network_process_buffer(char *buffer, long size) {
         * Check to see if we already have a copy of this message
         */
        if (network_usetable(UT_INSERT, msg) != 0) {
-               /* FIXME - post a msg in Aide> telling us what happened */
+               sprintf(buf, "Loopzapper rejected message <%s>\n",
+                       msg->cm_fields['I']);
+               aide_message(buf);
                CtdlFreeMessage(msg);
                msg = NULL;
                return;