diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-01-27 16:12:27 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-01-27 16:12:27 +0000 |
commit | 9bb4dcceadb7f78efe946946ccf7742a8c6e4f50 (patch) | |
tree | 70c25bfdf8bffbb6ac5eb424a20f9bba871612ee /src/smtp_proxy.c | |
parent | 15b1bddab547189e5fbdcb4441b2d64e4c8f10aa (diff) | |
download | rspamd-9bb4dcceadb7f78efe946946ccf7742a8c6e4f50.tar.gz rspamd-9bb4dcceadb7f78efe946946ccf7742a8c6e4f50.zip |
Rework resolver library.
Diffstat (limited to 'src/smtp_proxy.c')
-rw-r--r-- | src/smtp_proxy.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/smtp_proxy.c b/src/smtp_proxy.c index e468086b4..423a9b0bd 100644 --- a/src/smtp_proxy.c +++ b/src/smtp_proxy.c @@ -652,7 +652,7 @@ smtp_dns_cb (struct rspamd_dns_reply *reply, void *arg) { struct smtp_proxy_session *session = arg; gint res = 0; - union rspamd_reply_element *elt; + struct rspamd_reply_entry *elt; GList *cur; switch (session->state) @@ -676,10 +676,10 @@ smtp_dns_cb (struct rspamd_dns_reply *reply, void *arg) smtp_make_delay (session); } else { - if (reply->elements) { - elt = reply->elements->data; + if (reply->entries) { + elt = reply->entries; session->hostname = memory_pool_strdup (session->pool, - elt->ptr.name); + elt->content.ptr.name); session->state = SMTP_PROXY_STATE_RESOLVE_NORMAL; make_dns_request (session->resolver, session->s, session->pool, smtp_dns_cb, session, DNS_REQUEST_A, session->hostname); @@ -706,10 +706,8 @@ smtp_dns_cb (struct rspamd_dns_reply *reply, void *arg) } else { res = 0; - cur = reply->elements; - while (cur) { - elt = cur->data; - if (memcmp (&session->client_addr, &elt->a.addr[0], + LL_FOREACH (reply->entries, elt) { + if (memcmp (&session->client_addr, &elt->content.a.addr, sizeof(struct in_addr)) == 0) { res = 1; session->resolved = TRUE; |