projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2506fdb
)
Add error handler for failing DNS requests; the Client should be able to take its...
author
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 16 Sep 2011 18:39:36 +0000
(18:39 +0000)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 16 Sep 2011 18:39:36 +0000
(18:39 +0000)
citadel/event_client.c
patch
|
blob
|
history
citadel/event_client.h
patch
|
blob
|
history
citadel/modules/pop3client/serv_pop3client.c
patch
|
blob
|
history
citadel/modules/smtp/serv_smtpeventclient.c
patch
|
blob
|
history
diff --git
a/citadel/event_client.c
b/citadel/event_client.c
index a265f30bedcc648530eb38469505a3def284c21c..f1abcbef7ff9396550809c03be7b3af22edec87e 100644
(file)
--- a/
citadel/event_client.c
+++ b/
citadel/event_client.c
@@
-591,11
+591,11
@@
IO_postdns_callback(struct ev_loop *loop, ev_idle *watcher, int revents)
AsyncIO *IO = watcher->data;
syslog(LOG_DEBUG, "event: %s\n", __FUNCTION__);
become_session(IO->CitContext);
AsyncIO *IO = watcher->data;
syslog(LOG_DEBUG, "event: %s\n", __FUNCTION__);
become_session(IO->CitContext);
-
+ assert(IO->DNSFail);
switch (IO->DNSQuery->PostDNS(IO))
{
case eAbort:
switch (IO->DNSQuery->PostDNS(IO))
{
case eAbort:
-
ShutDownCLient
(IO);
+
IO->DNSFail
(IO);
default:
break;
}
default:
break;
}
diff --git
a/citadel/event_client.h
b/citadel/event_client.h
index de36f29ed126b31c3c82d4ec0ffb6bf2984961ad..b2c368db2400c7d6bacd93b8df58a9271ff36c49 100644
(file)
--- a/
citadel/event_client.h
+++ b/
citadel/event_client.h
@@
-102,6
+102,7
@@
struct AsyncIO {
Terminate, /* shutting down... */
Timeout, /* Timeout handler; may also be connection timeout */
ConnFail, /* What to do when one connection failed? */
Terminate, /* shutting down... */
Timeout, /* Timeout handler; may also be connection timeout */
ConnFail, /* What to do when one connection failed? */
+ DNSFail, /* the dns lookup didn't work out. */
ShutdownAbort,/* we're going down. make your piece. */
NextDBOperation; /* Perform Database IO */
ShutdownAbort,/* we're going down. make your piece. */
NextDBOperation; /* Perform Database IO */
diff --git
a/citadel/modules/pop3client/serv_pop3client.c
b/citadel/modules/pop3client/serv_pop3client.c
index ef811b7ed826847e435da7cb15f47c280d6685cd..18e4bdf8b550a5eae0bbd43c09062966ea3a5129 100644
(file)
--- a/
citadel/modules/pop3client/serv_pop3client.c
+++ b/
citadel/modules/pop3client/serv_pop3client.c
@@
-145,6
+145,7
@@
typedef eNextState(*Pop3ClientHandler)(pop3aggr* RecvMsg);
eNextState POP3_C_Shutdown(AsyncIO *IO);
eNextState POP3_C_Timeout(AsyncIO *IO);
eNextState POP3_C_ConnFail(AsyncIO *IO);
eNextState POP3_C_Shutdown(AsyncIO *IO);
eNextState POP3_C_Timeout(AsyncIO *IO);
eNextState POP3_C_ConnFail(AsyncIO *IO);
+eNextState POP3_C_DNSFail(AsyncIO *IO);
eNextState POP3_C_DispatchReadDone(AsyncIO *IO);
eNextState POP3_C_DispatchWriteDone(AsyncIO *IO);
eNextState POP3_C_Terminate(AsyncIO *IO);
eNextState POP3_C_DispatchReadDone(AsyncIO *IO);
eNextState POP3_C_DispatchWriteDone(AsyncIO *IO);
eNextState POP3_C_Terminate(AsyncIO *IO);
@@
-680,6
+681,14
@@
eNextState POP3_C_ConnFail(AsyncIO *IO)
StrBufPlain(IO->ErrMsg, CKEY(POP3C_ReadErrors[pMsg->State]));
return FailAggregationRun(IO);
}
StrBufPlain(IO->ErrMsg, CKEY(POP3C_ReadErrors[pMsg->State]));
return FailAggregationRun(IO);
}
+eNextState POP3_C_DNSFail(AsyncIO *IO)
+{
+ pop3aggr *pMsg = (pop3aggr *)IO->Data;
+
+ syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
+ StrBufPlain(IO->ErrMsg, CKEY(POP3C_ReadErrors[pMsg->State]));
+ return FailAggregationRun(IO);
+}
eNextState POP3_C_Shutdown(AsyncIO *IO)
{
syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
eNextState POP3_C_Shutdown(AsyncIO *IO)
{
syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);
@@
-836,6
+845,7
@@
int pop3_do_fetching(pop3aggr *cpptr)
cpptr->IO.Terminate = POP3_C_Terminate;
cpptr->IO.LineReader = POP3_C_ReadServerStatus;
cpptr->IO.ConnFail = POP3_C_ConnFail;
cpptr->IO.Terminate = POP3_C_Terminate;
cpptr->IO.LineReader = POP3_C_ReadServerStatus;
cpptr->IO.ConnFail = POP3_C_ConnFail;
+ cpptr->IO.DNSFail = POP3_C_DNSFail;
cpptr->IO.Timeout = POP3_C_Timeout;
cpptr->IO.ShutdownAbort = POP3_C_Shutdown;
cpptr->IO.Timeout = POP3_C_Timeout;
cpptr->IO.ShutdownAbort = POP3_C_Shutdown;
diff --git
a/citadel/modules/smtp/serv_smtpeventclient.c
b/citadel/modules/smtp/serv_smtpeventclient.c
index 22c18628a455b694d210e43299b016c2a745085d..0dbbf359c3291dca4707593091e91bf9313d7c18 100644
(file)
--- a/
citadel/modules/smtp/serv_smtpeventclient.c
+++ b/
citadel/modules/smtp/serv_smtpeventclient.c
@@
-110,6
+110,7
@@
eNextState SMTP_C_Timeout(AsyncIO *IO);
eNextState SMTP_C_ConnFail(AsyncIO *IO);
eNextState SMTP_C_DispatchReadDone(AsyncIO *IO);
eNextState SMTP_C_DispatchWriteDone(AsyncIO *IO);
eNextState SMTP_C_ConnFail(AsyncIO *IO);
eNextState SMTP_C_DispatchReadDone(AsyncIO *IO);
eNextState SMTP_C_DispatchWriteDone(AsyncIO *IO);
+eNextState SMTP_C_DNSFail(AsyncIO *IO);
eNextState SMTP_C_Terminate(AsyncIO *IO);
eReadState SMTP_C_ReadServerStatus(AsyncIO *IO);
eNextState SMTP_C_Terminate(AsyncIO *IO);
eReadState SMTP_C_ReadServerStatus(AsyncIO *IO);
@@
-435,6
+436,7
@@
SmtpOutMsg *new_smtp_outmsg(OneQueItem *MyQItem,
SendMsg->IO.Terminate = SMTP_C_Terminate;
SendMsg->IO.LineReader = SMTP_C_ReadServerStatus;
SendMsg->IO.ConnFail = SMTP_C_ConnFail;
SendMsg->IO.Terminate = SMTP_C_Terminate;
SendMsg->IO.LineReader = SMTP_C_ReadServerStatus;
SendMsg->IO.ConnFail = SMTP_C_ConnFail;
+ SendMsg->IO.DNSFail = SMTP_C_DNSFail;
SendMsg->IO.Timeout = SMTP_C_Timeout;
SendMsg->IO.ShutdownAbort = SMTP_C_Shutdown;
SendMsg->IO.Timeout = SMTP_C_Timeout;
SendMsg->IO.ShutdownAbort = SMTP_C_Shutdown;
@@
-589,6
+591,14
@@
eNextState SMTP_C_ConnFail(AsyncIO *IO)
StrBufPlain(IO->ErrMsg, CKEY(ReadErrors[pMsg->State]));
return FailOneAttempt(IO);
}
StrBufPlain(IO->ErrMsg, CKEY(ReadErrors[pMsg->State]));
return FailOneAttempt(IO);
}
+eNextState SMTP_C_DNSFail(AsyncIO *IO)
+{
+ SmtpOutMsg *pMsg = IO->Data;
+
+ syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
+ StrBufPlain(IO->ErrMsg, CKEY(ReadErrors[pMsg->State]));
+ return FailOneAttempt(IO);
+}
eNextState SMTP_C_Shutdown(AsyncIO *IO)
{
syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
eNextState SMTP_C_Shutdown(AsyncIO *IO)
{
syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);