From: Vsevolod Stakhov Date: Mon, 28 Jun 2010 12:25:06 +0000 (+0400) Subject: * Register dns requests in session too X-Git-Tag: 0.3.1~77 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=88f24f93e91941bb063e2fdc315e12a8227aa48f;p=rspamd.git * Register dns requests in session too --- diff --git a/src/smtp.c b/src/smtp.c index 23361fc5f..0d3f4c63b 100644 --- a/src/smtp.c +++ b/src/smtp.c @@ -695,6 +695,8 @@ smtp_dns_cb (int result, char type, int count, int ttl, void *addresses, void *a session->hostname = memory_pool_strdup (session->pool, * ((const char**)addresses)); session->state = SMTP_STATE_RESOLVE_NORMAL; evdns_resolve_ipv4 (session->hostname, DNS_QUERY_NO_SEARCH, smtp_dns_cb, (void *)session); + register_async_event (session->s, (event_finalizer_t)smtp_dns_cb, NULL, TRUE); + } } break; @@ -789,6 +791,10 @@ accept_socket (int fd, short what, void *arg) msg_err ("cannot resolve %s", inet_ntoa (session->client_addr)); g_free (session); close (nfd); + return; + } + else { + register_async_event (session->s, (event_finalizer_t)smtp_dns_cb, NULL, TRUE); } /* Set up dispatcher */