projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8115920
)
SMTP-Client: move the client-shutdown procedure into the DB-Thread; we musn't block...
author
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 6 Apr 2012 15:36:29 +0000
(17:36 +0200)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 6 Apr 2012 15:36:29 +0000
(17:36 +0200)
citadel/event_client.c
patch
|
blob
|
history
citadel/event_client.h
patch
|
blob
|
history
citadel/modules/extnotify/funambol65.c
patch
|
blob
|
history
citadel/modules/network/serv_networkclient.c
patch
|
blob
|
history
citadel/modules/pop3client/serv_pop3client.c
patch
|
blob
|
history
citadel/modules/rssclient/serv_rssclient.c
patch
|
blob
|
history
citadel/modules/smtp/serv_smtpeventclient.c
patch
|
blob
|
history
citadel/modules/smtp/smtp_clienthandlers.h
patch
|
blob
|
history
citadel/modules/urldeshortener/serv_expand_shorter_urls.c
patch
|
blob
|
history
diff --git
a/citadel/event_client.c
b/citadel/event_client.c
index 5087dd9ebda758bfe9285480be52aad464bf06aa..e2b3ba69a84d2f7597aa05f3f80fc329aff5e5bb 100644
(file)
--- a/
citadel/event_client.c
+++ b/
citadel/event_client.c
@@
-127,8
+127,8
@@
void ShutDownDBCLient(AsyncIO *IO)
EVM_syslog(LOG_DEBUG, "DBEVENT Terminating.\n");
ev_cleanup_stop(event_db, &IO->db_abort_by_shutdown);
EVM_syslog(LOG_DEBUG, "DBEVENT Terminating.\n");
ev_cleanup_stop(event_db, &IO->db_abort_by_shutdown);
- assert(IO->Terminate);
- IO->Terminate(IO);
+ assert(IO->
DB
Terminate);
+ IO->
DB
Terminate(IO);
}
void
}
void
@@
-906,6
+906,7
@@
void InitIOStruct(AsyncIO *IO,
IO_CallBack SendDone,
IO_CallBack ReadDone,
IO_CallBack Terminate,
IO_CallBack SendDone,
IO_CallBack ReadDone,
IO_CallBack Terminate,
+ IO_CallBack DBTerminate,
IO_CallBack ConnFail,
IO_CallBack Timeout,
IO_CallBack ShutdownAbort)
IO_CallBack ConnFail,
IO_CallBack Timeout,
IO_CallBack ShutdownAbort)
@@
-920,6
+921,7
@@
void InitIOStruct(AsyncIO *IO,
IO->SendDone = SendDone;
IO->ReadDone = ReadDone;
IO->Terminate = Terminate;
IO->SendDone = SendDone;
IO->ReadDone = ReadDone;
IO->Terminate = Terminate;
+ IO->DBTerminate = DBTerminate;
IO->LineReader = LineReader;
IO->ConnFail = ConnFail;
IO->Timeout = Timeout;
IO->LineReader = LineReader;
IO->ConnFail = ConnFail;
IO->Timeout = Timeout;
@@
-943,6
+945,7
@@
int InitcURLIOStruct(AsyncIO *IO,
const char* Desc,
IO_CallBack SendDone,
IO_CallBack Terminate,
const char* Desc,
IO_CallBack SendDone,
IO_CallBack Terminate,
+ IO_CallBack DBTerminate,
IO_CallBack ShutdownAbort)
{
IO->Data = Data;
IO_CallBack ShutdownAbort)
{
IO->Data = Data;
@@
-950,8
+953,9
@@
int InitcURLIOStruct(AsyncIO *IO,
IO->CitContext = CloneContext(CC);
((CitContext *)IO->CitContext)->session_specific_data = (char*) Data;
IO->CitContext = CloneContext(CC);
((CitContext *)IO->CitContext)->session_specific_data = (char*) Data;
- IO->SendDone = SendDone;
- IO->Terminate = Terminate;
+ IO->SendDone = SendDone;
+ IO->Terminate = Terminate;
+ IO->DBTerminate = DBTerminate;
IO->ShutdownAbort = ShutdownAbort;
strcpy(IO->HttpReq.errdesc, Desc);
IO->ShutdownAbort = ShutdownAbort;
strcpy(IO->HttpReq.errdesc, Desc);
diff --git
a/citadel/event_client.h
b/citadel/event_client.h
index 217ffc26e372ef3d57b303caf57763cff23e8e07..6ae8b27d3b740aa5d06e7556ccda0a87f4e550ec 100644
(file)
--- a/
citadel/event_client.h
+++ b/
citadel/event_client.h
@@
-146,6
+146,7
@@
struct AsyncIO {
IO_CallBack ReadDone, /* Theres new data to read... */
SendDone, /* we may send more data */
Terminate, /* shutting down... */
IO_CallBack ReadDone, /* Theres new data to read... */
SendDone, /* we may send more data */
Terminate, /* shutting down... */
+ DBTerminate, /* shutting down... */
Timeout, /* Timeout handler;may also be conn. timeout */
ConnFail, /* What to do when one connection failed? */
ShutdownAbort,/* we're going down. make your piece. */
Timeout, /* Timeout handler;may also be conn. timeout */
ConnFail, /* What to do when one connection failed? */
ShutdownAbort,/* we're going down. make your piece. */
@@
-274,6
+275,7
@@
void InitIOStruct(AsyncIO *IO,
IO_CallBack SendDone,
IO_CallBack ReadDone,
IO_CallBack Terminate,
IO_CallBack SendDone,
IO_CallBack ReadDone,
IO_CallBack Terminate,
+ IO_CallBack DBTerminate,
IO_CallBack ConnFail,
IO_CallBack Timeout,
IO_CallBack ShutdownAbort);
IO_CallBack ConnFail,
IO_CallBack Timeout,
IO_CallBack ShutdownAbort);
@@
-283,6
+285,7
@@
int InitcURLIOStruct(AsyncIO *IO,
const char* Desc,
IO_CallBack SendDone,
IO_CallBack Terminate,
const char* Desc,
IO_CallBack SendDone,
IO_CallBack Terminate,
+ IO_CallBack DBTerminate,
IO_CallBack ShutdownAbort);
eNextState ReAttachIO(AsyncIO *IO,
IO_CallBack ShutdownAbort);
eNextState ReAttachIO(AsyncIO *IO,
diff --git
a/citadel/modules/extnotify/funambol65.c
b/citadel/modules/extnotify/funambol65.c
index 03f478ca6ab6ae2cb3a1aac7c79de6577c65d9f5..f4b0d8d38fc9b8943de839e903e1d08e9773c2bf 100644
(file)
--- a/
citadel/modules/extnotify/funambol65.c
+++ b/
citadel/modules/extnotify/funambol65.c
@@
-49,6
+49,7
@@
eNextState EvaluateResult(AsyncIO *IO);
eNextState ExtNotifyTerminate(AsyncIO *IO);
eNextState EvaluateResult(AsyncIO *IO);
eNextState ExtNotifyTerminate(AsyncIO *IO);
+eNextState ExtNotifyTerminateDB(AsyncIO *IO);
eNextState ExtNotifyShutdownAbort(AsyncIO *IO);
/*
eNextState ExtNotifyShutdownAbort(AsyncIO *IO);
/*
@@
-81,6
+82,7
@@
int notify_http_server(char *remoteurl,
"Citadel ExtNotify",
EvaluateResult,
ExtNotifyTerminate,
"Citadel ExtNotify",
EvaluateResult,
ExtNotifyTerminate,
+ ExtNotifyTerminateDB,
ExtNotifyShutdownAbort))
{
syslog(LOG_ALERT, "Unable to initialize libcurl.\n");
ExtNotifyShutdownAbort))
{
syslog(LOG_ALERT, "Unable to initialize libcurl.\n");
@@
-295,6
+297,11
@@
eNextState EvaluateResult(AsyncIO *IO)
return 0;
}
return 0;
}
+eNextState ExtNotifyTerminateDB(AsyncIO *IO)
+{
+ free(IO);
+ return eAbort;
+}
eNextState ExtNotifyTerminate(AsyncIO *IO)
{
free(IO);
eNextState ExtNotifyTerminate(AsyncIO *IO)
{
free(IO);
diff --git
a/citadel/modules/network/serv_networkclient.c
b/citadel/modules/network/serv_networkclient.c
index 0023d83631904b0dfa1eb5dbe2d359e3c2fa84a8..51db451989d96192576a3a7aad7998fdb11687c1 100644
(file)
--- a/
citadel/modules/network/serv_networkclient.c
+++ b/
citadel/modules/network/serv_networkclient.c
@@
-157,6
+157,7
@@
void DeleteNetworker(void *vptr)
FreeStrBuf(&NW->port);
FreeStrBuf(&NW->secret);
FreeStrBuf(&NW->Url);
FreeStrBuf(&NW->port);
FreeStrBuf(&NW->secret);
FreeStrBuf(&NW->Url);
+ FreeStrBuf(&NW->IO.ErrMsg);
FreeAsyncIOContents(&NW->IO);
free(NW);
}
FreeAsyncIOContents(&NW->IO);
free(NW);
}
@@
-808,6
+809,13
@@
eNextState NWC_Terminate(AsyncIO *IO)
return eAbort;
}
return eAbort;
}
+eNextState NWC_TerminateDB(AsyncIO *IO)
+{
+ EVN_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
+ FinalizeNetworker(IO);
+ return eAbort;
+}
+
eNextState NWC_Timeout(AsyncIO *IO)
{
AsyncNetworker *NW = IO->Data;
eNextState NWC_Timeout(AsyncIO *IO)
{
AsyncNetworker *NW = IO->Data;
@@
-881,6
+889,7
@@
void RunNetworker(AsyncNetworker *NW)
NWC_DispatchWriteDone,
NWC_DispatchReadDone,
NWC_Terminate,
NWC_DispatchWriteDone,
NWC_DispatchReadDone,
NWC_Terminate,
+ NWC_TerminateDB,
NWC_ConnFail,
NWC_Timeout,
NWC_Shutdown);
NWC_ConnFail,
NWC_Timeout,
NWC_Shutdown);
diff --git
a/citadel/modules/pop3client/serv_pop3client.c
b/citadel/modules/pop3client/serv_pop3client.c
index 0a97df2cc971b402c431c4b6daf5a54dbe9ae3c6..fa151f6694707e9fbae3c8f9ca883ba957be8c04 100644
(file)
--- a/
citadel/modules/pop3client/serv_pop3client.c
+++ b/
citadel/modules/pop3client/serv_pop3client.c
@@
-706,6
+706,14
@@
eNextState POP3_C_Terminate(AsyncIO *IO)
FinalizePOP3AggrRun(IO);
return eAbort;
}
FinalizePOP3AggrRun(IO);
return eAbort;
}
+eNextState POP3_C_TerminateDB(AsyncIO *IO)
+{
+/// pop3aggr *pMsg = (pop3aggr *)IO->Data;
+
+ syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+ FinalizePOP3AggrRun(IO);
+ return eAbort;
+}
eNextState POP3_C_Timeout(AsyncIO *IO)
{
pop3aggr *pMsg = IO->Data;
eNextState POP3_C_Timeout(AsyncIO *IO)
{
pop3aggr *pMsg = IO->Data;
@@
-883,6
+891,7
@@
int pop3_do_fetching(pop3aggr *cpptr)
POP3_C_DispatchWriteDone,
POP3_C_DispatchReadDone,
POP3_C_Terminate,
POP3_C_DispatchWriteDone,
POP3_C_DispatchReadDone,
POP3_C_Terminate,
+ POP3_C_TerminateDB,
POP3_C_ConnFail,
POP3_C_Timeout,
POP3_C_Shutdown);
POP3_C_ConnFail,
POP3_C_Timeout,
POP3_C_Shutdown);
diff --git
a/citadel/modules/rssclient/serv_rssclient.c
b/citadel/modules/rssclient/serv_rssclient.c
index 8a3ba63549a5aadacfa2bfd88d0cc25138541a01..6d4392393610785433efc3caad7f91067519afa5 100644
(file)
--- a/
citadel/modules/rssclient/serv_rssclient.c
+++ b/
citadel/modules/rssclient/serv_rssclient.c
@@
-69,6
+69,7
@@
HashList *RSSQueueRooms = NULL; /* rss_room_counter */
HashList *RSSFetchUrls = NULL; /*->rss_aggregator;->RefCount access locked*/
eNextState RSSAggregator_Terminate(AsyncIO *IO);
HashList *RSSFetchUrls = NULL; /*->rss_aggregator;->RefCount access locked*/
eNextState RSSAggregator_Terminate(AsyncIO *IO);
+eNextState RSSAggregator_TerminateDB(AsyncIO *IO);
eNextState RSSAggregator_ShutdownAbort(AsyncIO *IO);
struct CitContext rss_CC;
eNextState RSSAggregator_ShutdownAbort(AsyncIO *IO);
struct CitContext rss_CC;
@@
-180,6
+181,17
@@
eNextState RSSAggregator_Terminate(AsyncIO *IO)
return eAbort;
}
return eAbort;
}
+eNextState RSSAggregator_TerminateDB(AsyncIO *IO)
+{
+ rss_aggregator *RSSAggr = (rss_aggregator *)IO->Data;
+
+ EVM_syslog(LOG_DEBUG, "RSS: Terminating.\n");
+
+
+ UnlinkRSSAggregator(RSSAggr);
+ return eAbort;
+}
+
eNextState RSSAggregator_ShutdownAbort(AsyncIO *IO)
{
const char *pUrl;
eNextState RSSAggregator_ShutdownAbort(AsyncIO *IO)
{
const char *pUrl;
@@
-294,6
+306,7
@@
int rss_do_fetching(rss_aggregator *Cfg)
"Citadel RSS Client",
RSSAggregator_ParseReply,
RSSAggregator_Terminate,
"Citadel RSS Client",
RSSAggregator_ParseReply,
RSSAggregator_Terminate,
+ RSSAggregator_TerminateDB,
RSSAggregator_ShutdownAbort))
{
syslog(LOG_ALERT, "Unable to initialize libcurl.\n");
RSSAggregator_ShutdownAbort))
{
syslog(LOG_ALERT, "Unable to initialize libcurl.\n");
diff --git
a/citadel/modules/smtp/serv_smtpeventclient.c
b/citadel/modules/smtp/serv_smtpeventclient.c
index 90a36b23539f6582b823bd1ec4ce023b834b9562..e5c1cee00931f84c887addfcbdb51002b8eab444 100644
(file)
--- a/
citadel/modules/smtp/serv_smtpeventclient.c
+++ b/
citadel/modules/smtp/serv_smtpeventclient.c
@@
-117,10
+117,15
@@
eNextState SMTP_C_DispatchReadDone(AsyncIO *IO);
eNextState SMTP_C_DispatchWriteDone(AsyncIO *IO);
eNextState SMTP_C_DNSFail(AsyncIO *IO);
eNextState SMTP_C_Terminate(AsyncIO *IO);
eNextState SMTP_C_DispatchWriteDone(AsyncIO *IO);
eNextState SMTP_C_DNSFail(AsyncIO *IO);
eNextState SMTP_C_Terminate(AsyncIO *IO);
+eNextState SMTP_C_TerminateDB(AsyncIO *IO);
eReadState SMTP_C_ReadServerStatus(AsyncIO *IO);
eNextState mx_connect_ip(AsyncIO *IO);
eNextState get_one_mx_host_ip(AsyncIO *IO);
eReadState SMTP_C_ReadServerStatus(AsyncIO *IO);
eNextState mx_connect_ip(AsyncIO *IO);
eNextState get_one_mx_host_ip(AsyncIO *IO);
+eNextState FinalizeMessageSendDB(AsyncIO *IO);
+eNextState FinalizeMessageSend_DB1(AsyncIO *IO);
+eNextState FinalizeMessageSend_DB2(AsyncIO *IO);
+eNextState FinalizeMessageSend_DB3(AsyncIO *IO);
/******************************************************************************
* So, we're finished with sending (regardless of success or failure) *
/******************************************************************************
* So, we're finished with sending (regardless of success or failure) *
@@
-128,16
+133,12
@@
eNextState get_one_mx_host_ip(AsyncIO *IO);
* we need to free the memory and send bounce messages (on terminal failure) *
* else we just free our SMTP-Message struct. *
******************************************************************************/
* we need to free the memory and send bounce messages (on terminal failure) *
* else we just free our SMTP-Message struct. *
******************************************************************************/
-
void FinalizeMessageSend(SmtpOutMsg *Msg
)
+
inline void FinalizeMessageSend_1(AsyncIO *IO
)
{
{
- int IDestructQueItem;
- int nRemain;
- StrBuf *MsgData;
- AsyncIO *IO = &Msg->IO;
-
- IDestructQueItem = DecreaseQReference(Msg->MyQItem);
+ SmtpOutMsg *Msg = IO->Data;
+ Msg->IDestructQueItem = DecreaseQReference(Msg->MyQItem);
- nRemain = CountActiveQueueEntries(Msg->MyQItem);
+
Msg->
nRemain = CountActiveQueueEntries(Msg->MyQItem);
if (Msg->MyQEntry->Active &&
CheckQEntryIsBounce(Msg->MyQEntry))
if (Msg->MyQEntry->Active &&
CheckQEntryIsBounce(Msg->MyQEntry))
@@
-146,10
+147,19
@@
void FinalizeMessageSend(SmtpOutMsg *Msg)
Msg->MyQItem->SendBounceMail |= (1<<Msg->MyQEntry->Status);
}
Msg->MyQItem->SendBounceMail |= (1<<Msg->MyQEntry->Status);
}
- if ((
nRemain > 0) ||
IDestructQueItem)
- MsgData = SerializeQueueItem(Msg->MyQItem);
+ if ((
Msg->nRemain > 0) || Msg->
IDestructQueItem)
+ Msg
->QMsg
Data = SerializeQueueItem(Msg->MyQItem);
else
else
- MsgData = NULL;
+ Msg->QMsgData = NULL;
+}
+eNextState FinalizeMessageSend(SmtpOutMsg *Msg)
+{
+ return QueueDBOperation(&Msg->IO, FinalizeMessageSend_DB1);
+}
+
+inline void FinalizeMessageSend_DB_1(AsyncIO *IO)
+{
+ SmtpOutMsg *Msg = IO->Data;
/*
* Uncompleted delivery instructions remain, so delete the old
/*
* Uncompleted delivery instructions remain, so delete the old
@@
-157,11
+167,35
@@
void FinalizeMessageSend(SmtpOutMsg *Msg)
*/
EVS_syslog(LOG_DEBUG, "SMTPQD: %ld", Msg->MyQItem->QueMsgID);
CtdlDeleteMessages(SMTP_SPOOLOUT_ROOM, &Msg->MyQItem->QueMsgID, 1, "");
*/
EVS_syslog(LOG_DEBUG, "SMTPQD: %ld", Msg->MyQItem->QueMsgID);
CtdlDeleteMessages(SMTP_SPOOLOUT_ROOM, &Msg->MyQItem->QueMsgID, 1, "");
+}
+eNextState FinalizeMessageSend_DB1(AsyncIO *IO)
+{
+ FinalizeMessageSend_1(IO);
+ FinalizeMessageSend_DB_1(IO);
+ return NextDBOperation(IO, FinalizeMessageSend_DB2);
+}
+
- if (IDestructQueItem)
+inline void FinalizeMessageSend_DB_2(AsyncIO *IO)
+{
+ SmtpOutMsg *Msg = IO->Data;
+
+ if (Msg->IDestructQueItem)
smtpq_do_bounce(Msg->MyQItem, Msg->msgtext);
smtpq_do_bounce(Msg->MyQItem, Msg->msgtext);
+}
+eNextState FinalizeMessageSend_DB2(AsyncIO *IO)
+{
+ FinalizeMessageSend_DB_2(IO);
+
+ return NextDBOperation(IO, FinalizeMessageSend_DB3);
+}
+
+
+inline void FinalizeMessageSend_DB_3(AsyncIO *IO)
+{
+ SmtpOutMsg *Msg = IO->Data;
- if (nRemain > 0)
+ if (
Msg->
nRemain > 0)
{
struct CtdlMessage *msg;
msg = malloc(sizeof(struct CtdlMessage));
{
struct CtdlMessage *msg;
msg = malloc(sizeof(struct CtdlMessage));
@@
-169,7
+203,7
@@
void FinalizeMessageSend(SmtpOutMsg *Msg)
msg->cm_magic = CTDLMESSAGE_MAGIC;
msg->cm_anon_type = MES_NORMAL;
msg->cm_format_type = FMT_RFC822;
msg->cm_magic = CTDLMESSAGE_MAGIC;
msg->cm_anon_type = MES_NORMAL;
msg->cm_format_type = FMT_RFC822;
- msg->cm_fields['M'] = SmashStrBuf(&MsgData);
+ msg->cm_fields['M'] = SmashStrBuf(&Msg
->QMsg
Data);
msg->cm_fields['U'] = strdup("QMSG");
Msg->MyQItem->QueMsgID =
CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM, QP_EADDR);
msg->cm_fields['U'] = strdup("QMSG");
Msg->MyQItem->QueMsgID =
CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM, QP_EADDR);
@@
-181,12
+215,24
@@
void FinalizeMessageSend(SmtpOutMsg *Msg)
&Msg->MyQItem->MessageID,
1,
"");
&Msg->MyQItem->MessageID,
1,
"");
- FreeStrBuf(&MsgData);
+ FreeStrBuf(&Msg
->QMsg
Data);
}
}
+}
+eNextState FinalizeMessageSend_DB3(AsyncIO *IO)
+{
+ FinalizeMessageSend_DB_3(IO);
+ return eAbort;
+}
+
+eNextState FinalizeMessageSend_DB(AsyncIO *IO)
+{
+ SmtpOutMsg *Msg = IO->Data;
+
RemoveContext(Msg->IO.CitContext);
RemoveContext(Msg->IO.CitContext);
- if (IDestructQueItem)
+ if (
Msg->
IDestructQueItem)
RemoveQItem(Msg->MyQItem);
DeleteSmtpOutMsg(Msg);
RemoveQItem(Msg->MyQItem);
DeleteSmtpOutMsg(Msg);
+ return eAbort;
}
eNextState FailOneAttempt(AsyncIO *IO)
}
eNextState FailOneAttempt(AsyncIO *IO)
@@
-502,6
+548,7
@@
SmtpOutMsg *new_smtp_outmsg(OneQueItem *MyQItem,
SMTP_C_DispatchWriteDone,
SMTP_C_DispatchReadDone,
SMTP_C_Terminate,
SMTP_C_DispatchWriteDone,
SMTP_C_DispatchReadDone,
SMTP_C_Terminate,
+ SMTP_C_TerminateDB,
SMTP_C_ConnFail,
SMTP_C_Timeout,
SMTP_C_Shutdown);
SMTP_C_ConnFail,
SMTP_C_Timeout,
SMTP_C_Shutdown);
@@
-562,7
+609,11
@@
void smtp_try_one_queue_entry(OneQueItem *MyQItem,
StrBufPlain(Msg->MyQEntry->StatusMessage,
HKEY("Invalid Recipient!"));
}
StrBufPlain(Msg->MyQEntry->StatusMessage,
HKEY("Invalid Recipient!"));
}
- FinalizeMessageSend(Msg);
+ FinalizeMessageSend_1(&Msg->IO);
+ FinalizeMessageSend_DB_1(&Msg->IO);
+ FinalizeMessageSend_DB_2(&Msg->IO);
+ FinalizeMessageSend_DB_3(&Msg->IO);
+ FinalizeMessageSend_DB(&Msg->IO);
}
}
}
}
@@
-651,8
+702,12
@@
eNextState SMTP_C_Terminate(AsyncIO *IO)
SmtpOutMsg *Msg = IO->Data;
EVS_syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
SmtpOutMsg *Msg = IO->Data;
EVS_syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
- FinalizeMessageSend(Msg);
- return eAbort;
+ return FinalizeMessageSend(Msg);
+}
+eNextState SMTP_C_TerminateDB(AsyncIO *IO)
+{
+ EVS_syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
+ return FinalizeMessageSend_DB(IO);
}
eNextState SMTP_C_Timeout(AsyncIO *IO)
{
}
eNextState SMTP_C_Timeout(AsyncIO *IO)
{
@@
-690,8
+745,7
@@
eNextState SMTP_C_Shutdown(AsyncIO *IO)
Msg->MyQEntry->Status = 3;
StrBufPlain(Msg->MyQEntry->StatusMessage,
HKEY("server shutdown during message submit."));
Msg->MyQEntry->Status = 3;
StrBufPlain(Msg->MyQEntry->StatusMessage,
HKEY("server shutdown during message submit."));
- FinalizeMessageSend(Msg);
- return eAbort;
+ return FinalizeMessageSend(Msg);
}
}
diff --git
a/citadel/modules/smtp/smtp_clienthandlers.h
b/citadel/modules/smtp/smtp_clienthandlers.h
index 02b84e75fb213fa8e864885c2f457205e2f39fc8..38a7f58f4490795fc987ee98b8baeeb0b59e31b7 100644
(file)
--- a/
citadel/modules/smtp/smtp_clienthandlers.h
+++ b/
citadel/modules/smtp/smtp_clienthandlers.h
@@
-38,6
+38,8
@@
typedef struct _stmp_out_msg {
long n;
AsyncIO IO;
long CXFlags;
long n;
AsyncIO IO;
long CXFlags;
+ int IDestructQueItem;
+ int nRemain;
eSMTP_C_States State;
eSMTP_C_States State;
@@
-57,11
+59,14
@@
typedef struct _stmp_out_msg {
ParsedURL *Relay;
ParsedURL *pCurrRelay;
StrBuf *msgtext;
ParsedURL *Relay;
ParsedURL *pCurrRelay;
StrBuf *msgtext;
+ StrBuf *QMsgData;
const char *envelope_from;
const char *envelope_from;
+
char user[1024];
char node[1024];
char name[1024];
char mailfrom[1024];
char user[1024];
char node[1024];
char name[1024];
char mailfrom[1024];
+
long Flags;
} SmtpOutMsg;
long Flags;
} SmtpOutMsg;
diff --git
a/citadel/modules/urldeshortener/serv_expand_shorter_urls.c
b/citadel/modules/urldeshortener/serv_expand_shorter_urls.c
index bb6d1734a5170bde6f5f740480d56e86cac53264..ef08b677506d0cf4b16ab7b51be6aa03a996e922 100644
(file)
--- a/
citadel/modules/urldeshortener/serv_expand_shorter_urls.c
+++ b/
citadel/modules/urldeshortener/serv_expand_shorter_urls.c
@@
-103,6
+103,11
@@
eNextState TerminateLookupUrl(AsyncIO *IO)
//TOOD
return eAbort;
}
//TOOD
return eAbort;
}
+eNextState TerminateLookupUrlDB(AsyncIO *IO)
+{
+//TOOD
+ return eAbort;
+}
eNextState LookupUrlResult(AsyncIO *IO)
{
return eTerminateConnection; /// /TODO
eNextState LookupUrlResult(AsyncIO *IO)
{
return eTerminateConnection; /// /TODO
@@
-128,6
+133,7
@@
int LookupUrl(StrBuf *ShorterUrlStr)
"Citadel RSS ShorterURL Expander",
LookupUrlResult,
TerminateLookupUrl,
"Citadel RSS ShorterURL Expander",
LookupUrlResult,
TerminateLookupUrl,
+ TerminateLookupUrlDB,
ShutdownLookuUrl))
{
syslog(LOG_ALERT, "Unable to initialize libcurl.\n");
ShutdownLookuUrl))
{
syslog(LOG_ALERT, "Unable to initialize libcurl.\n");