summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-28 16:43:13 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-28 16:43:13 +0400
commitc62e1b2350180d131f4dfbf73a3e3cd2b86d1f9b (patch)
treee7f260fe695047c38f16a86f0a5826b1c8d3be15 /src
parentd4944acc204d3cd9d03fe41f39afbd740ebc00c2 (diff)
downloadrspamd-c62e1b2350180d131f4dfbf73a3e3cd2b86d1f9b.tar.gz
rspamd-c62e1b2350180d131f4dfbf73a3e3cd2b86d1f9b.zip
* Remove events in handlers
Diffstat (limited to 'src')
-rw-r--r--src/smtp.c7
-rw-r--r--src/smtp.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/smtp.c b/src/smtp.c
index fd22f4080..a94630ea4 100644
--- a/src/smtp.c
+++ b/src/smtp.c
@@ -622,7 +622,8 @@ static void
smtp_delay_handler (int fd, short what, void *arg)
{
struct smtp_session *session = arg;
-
+
+ remove_normal_event (session->s, (event_finalizer_t)event_del, session->delay_timer);
if (session->state == SMTP_STATE_DELAY) {
session->state = SMTP_STATE_GREETING;
write_smtp_greeting (session);
@@ -659,6 +660,7 @@ smtp_make_delay (struct smtp_session *session)
evtimer_set (tev, smtp_delay_handler, session);
evtimer_add (tev, tv);
register_async_event (session->s, (event_finalizer_t)event_del, tev, FALSE);
+ session->delay_timer = tev;
}
else if (session->state == SMTP_STATE_DELAY) {
session->state = SMTP_STATE_GREETING;
@@ -674,7 +676,8 @@ smtp_dns_cb (int result, char type, int count, int ttl, void *addresses, void *a
{
struct smtp_session *session = arg;
int i, res = 0;
-
+
+ remove_forced_event (session->s, (event_finalizer_t)smtp_dns_cb);
switch (session->state) {
case SMTP_STATE_RESOLVE_REVERSE:
/* Parse reverse reply and start resolve of this ip */
diff --git a/src/smtp.h b/src/smtp.h
index f8aaaeb84..a986b2853 100644
--- a/src/smtp.h
+++ b/src/smtp.h
@@ -88,6 +88,8 @@ struct smtp_session {
struct smtp_upstream *upstream;
+ struct event *delay_timer;
+
gboolean resolved;
gboolean esmtp;
};