From: Wilfried Goesgens Date: Sat, 15 Jan 2011 18:10:48 +0000 (+0100) Subject: libev migration; cleanup bounce; use libev to get the current time. X-Git-Tag: v8.11~1106 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=f18c6af07cd1d5d8cb7bf868c4757683922357f7 libev migration; cleanup bounce; use libev to get the current time. --- 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 }