/*
* FIXME
* Don't allow polls during network processing
- * Use table isn't saving properly across sessions
*/
#include "sysdep.h"
#include "clientsocket.h"
#include "file_ops.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
+
/*
* When we do network processing, it's accomplished in two passes; one to
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,
- ut->timestamp);
+ (long)ut->timestamp);
}
/* Now free the memory */
sprintf(&serialized_map[strlen(serialized_map)],
"%s|%ld|%s\n",
nmptr->nodename,
- nmptr->lastcontact,
+ (long)nmptr->lastcontact,
nmptr->nexthop);
}
}
sprintf(instr,
"Content-type: %s\n\nmsgid|%ld\nsubmitted|%ld\n"
"bounceto|postmaster@%s\n" ,
- SPOOLMIME, msgnum, time(NULL), config.c_fqdn );
+ SPOOLMIME, msgnum, (long)time(NULL), config.c_fqdn );
/* Generate delivery instructions for each recipient */
for (nptr = sc->listrecps; nptr != NULL; nptr = nptr->next) {
phree(msg->cm_fields['I']);
}
sprintf(buf, "%ld.%04x.%04x@%s",
- time(NULL), getpid(), ++serialnum, config.c_fqdn);
+ (long)time(NULL), getpid(), ++serialnum, config.c_fqdn);
msg->cm_fields['I'] = strdoop(buf);
/*
char *oldpath = NULL;
char filename[SIZ];
FILE *fp;
+ char buf[SIZ];
/* Set default target room to trash */
strcpy(target_room, TWITROOM);
* 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;