From f18c6af07cd1d5d8cb7bf868c4757683922357f7 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sat, 15 Jan 2011 19:10:48 +0100 Subject: [PATCH] libev migration; cleanup bounce; use libev to get the current time. --- citadel/modules/smtp/serv_smtpqueue.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/citadel/modules/smtp/serv_smtpqueue.c b/citadel/modules/smtp/serv_smtpqueue.c index c9cfbecbd..eb4d3f17b 100644 --- a/citadel/modules/smtp/serv_smtpqueue.c +++ b/citadel/modules/smtp/serv_smtpqueue.c @@ -427,22 +427,26 @@ StrBuf *smtp_load_msg(OneQueItem *MyQItem, int n) */ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt) { - StrBuf *boundary, *Msg = NULL; - int num_bounces = 0; - struct CtdlMessage *bmsg = NULL; - int give_up = 0; - struct recptypes *valid; - int successful_bounce = 0; static int seq = 0; + + struct CtdlMessage *bmsg = NULL; + StrBuf *boundary; + StrBuf *Msg = NULL; StrBuf *BounceMB; - HashPos *It; + struct recptypes *valid; + + HashPos *It; void *vQE; long len; const char *Key; + int successful_bounce = 0; + int num_bounces = 0; + int give_up = 0; + CtdlLogPrintf(CTDL_DEBUG, "smtp_do_bounce() called\n"); - - if ( (time(NULL) - MyQItem->Submitted) > SMTP_GIVE_UP ) { + + if ( (ev_time() - MyQItem->Submitted) > SMTP_GIVE_UP ) { give_up = 1;/// TODO: replace time by libevq timer get } -- 2.30.2