- hook in libevent into shutdown mechanism, so we can cleanly shutdown citserver again.
int QueueEventContext(void *Ctx, AsyncIO *IO, EventContextAttach CB)
{
citthread_mutex_lock(&EventQueueMutex);
+ if (event_add_pipe[1] == -1) {
+ citthread_mutex_unlock(&EventQueueMutex);
+
+ return -1;
+ }
QueueEventAddPtr = Ctx;
EventContextAttachPtr = CB;
int ShutDownEventQueue(void)
{
+ citthread_mutex_lock(&EventQueueMutex);
+ if (event_add_pipe[1] == -1) {
+ citthread_mutex_unlock(&EventQueueMutex);
+
+ return -1;
+ }
write(event_add_pipe[1], "x_", 1);
close(event_add_pipe[1]);
+ event_add_pipe[1] = -1;
+ citthread_mutex_unlock(&EventQueueMutex);
return 0;
}
void FreeAsyncIOContents(AsyncIO *IO);
int QueueEventContext(void *Ctx, AsyncIO *IO, EventContextAttach CB);
+int ShutDownEventQueue(void);
void InitEventIO(AsyncIO *IO,
void *pData,
/*
- * This module is an SMTP and ESMTP implementation for the Citadel system.
- * It is compliant with all of the following:
- *
- * RFC 821 - Simple Mail Transfer Protocol
- * RFC 876 - Survey of SMTP Implementations
- * RFC 1047 - Duplicate messages and SMTP
- * RFC 1652 - 8 bit MIME
- * RFC 1869 - Extended Simple Mail Transfer Protocol
- * RFC 1870 - SMTP Service Extension for Message Size Declaration
- * RFC 2033 - Local Mail Transfer Protocol
- * RFC 2197 - SMTP Service Extension for Command Pipelining
- * RFC 2476 - Message Submission
- * RFC 2487 - SMTP Service Extension for Secure SMTP over TLS
- * RFC 2554 - SMTP Service Extension for Authentication
- * RFC 2821 - Simple Mail Transfer Protocol
- * RFC 2822 - Internet Message Format
- * RFC 2920 - SMTP Service Extension for Command Pipelining
- *
- * The VRFY and EXPN commands have been removed from this implementation
- * because nobody uses these commands anymore, except for spammers.
- *
* Copyright (c) 1998-2009 by the citadel.org team
*
* This program is free software; you can redistribute it and/or modify
#include "citserver.h"
#include "sysdep_decls.h"
#include "context.h"
+#include "event_client.h"
/*
* define this to use the new worker_thread method of handling connections
//FIXME: The signalling of the condition should not be in the critical_section
// We need to build a list of threads we are going to signal and then signal them afterwards
+ ShutDownEventQueue();
+
CtdlThreadNode *this_thread;
begin_critical_section(S_THREAD_LIST);