#include "clientsocket.h"
#include "file_ops.h"
#include "citadel_dirs.h"
+#include "threads.h"
#ifndef HAVE_SNPRINTF
#include "snprintf.h"
}
/* Now submit the message */
- valid = validate_recipients(recps);
+ valid = validate_recipients(recps, NULL, 0);
free(recps);
CtdlSubmitMsg(msg, valid, NULL);
CtdlFreeMessage(msg);
}
/* Now submit the message */
- valid = validate_recipients(recps);
+ valid = validate_recipients(recps, NULL, 0);
free(recps);
CtdlSubmitMsg(msg, valid, NULL);
free_recipients(valid);
}
msg->cm_fields['R'] = strdup(nptr->name);
- valid = validate_recipients(nptr->name);
+ valid = validate_recipients(nptr->name, NULL, 0);
CtdlSubmitMsg(msg, valid, "");
free_recipients(valid);
}
}
return 1;
}
-int is_recipient(SpoolControl *sc, char *Name)
+int is_recipient(SpoolControl *sc, const char *Name)
{
namelist *nptr;
+ size_t len;
+ len = strlen(Name);
nptr = sc->listrecps;
while (nptr != NULL) {
- if (strcmp(Name, nptr->name)==0)
+ if (strncmp(Name, nptr->name, len)==0)
return 1;
nptr = nptr->next;
}
/* Do the same for digestrecps */
nptr = sc->digestrecps;
while (nptr != NULL) {
- if (strcmp(Name, nptr->name)==0)
+ if (strncmp(Name, nptr->name, len)==0)
return 1;
nptr = nptr->next;
}
/* Do the same for participates */
nptr = sc->participates;
while (nptr != NULL) {
- if (strcmp(Name, nptr->name)==0)
+ if (strncmp(Name, nptr->name, len)==0)
return 1;
nptr = nptr->next;
}
free(oldpath);
/* Now submit the message */
- valid = validate_recipients(recipient);
+ valid = validate_recipients(recipient, NULL, 0);
if (valid != NULL) if (valid->num_error != 0) {
free_recipients(valid);
valid = NULL;
/* Otherwise, does it have a recipient? If so, validate it... */
else if (msg->cm_fields['R'] != NULL) {
- recp = validate_recipients(msg->cm_fields['R']);
+ recp = validate_recipients(msg->cm_fields['R'], NULL, 0);
if (recp != NULL) if (recp->num_error != 0) {
network_bounce(msg,
"A message you sent could not be delivered due to an invalid address.\n"
*
* Run through the rooms doing various types of network stuff.
*/
-void network_do_queue(void) {
+void *network_do_queue(void *args) {
static time_t last_run = 0L;
struct RoomProcList *ptr;
int full_processing = 1;
*/
if ( (time(NULL) - last_run) < config.c_net_freq ) {
full_processing = 0;
+ CtdlLogPrintf(CTDL_DEBUG, "Network full processing in %ld seconds.\n", config.c_net_freq - (time(NULL)- last_run));
}
/*
* don't really require extremely fine granularity here, we'll do it
* with a static variable instead.
*/
- if (doing_queue) return;
+ if (doing_queue) return NULL;
doing_queue = 1;
/* Load the IGnet Configuration into memory */
}
doing_queue = 0;
+ CtdlThreadSchedule("IGnet Network", CTDLTHREAD_BIGSTACK, network_do_queue, NULL, time(NULL) + 60);
+ return NULL;
}
CtdlRegisterProtoHook(cmd_snet, "SNET", "Set network config");
CtdlRegisterProtoHook(cmd_netp, "NETP", "Identify as network poller");
CtdlRegisterProtoHook(cmd_nsyn, "NSYN", "Synchronize room to node");
- CtdlRegisterSessionHook(network_do_queue, EVT_TIMER);
+// CtdlRegisterSessionHook(network_do_queue, EVT_TIMER);
CtdlRegisterRoomHook(network_room_handler);
CtdlRegisterCleanupHook(destroy_network_queue_room);
}
-
+ else
+ CtdlThreadSchedule("IGnet Network", CTDLTHREAD_BIGSTACK, network_do_queue, NULL, 0);
/* return our Subversion id for the Log */
return "$Id$";
}