diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-03 00:27:13 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-03 00:27:13 +0000 |
commit | e9ef523d5ee730c7d93a0bcc97ebfe04c98d3a60 (patch) | |
tree | dbabf1bf2b30774f39bf373bad602cadad48a9b2 /contrib/librdns/util.c | |
parent | 3aec3589a45dd71191f47da93656b6b5614903de (diff) | |
download | rspamd-e9ef523d5ee730c7d93a0bcc97ebfe04c98d3a60.tar.gz rspamd-e9ef523d5ee730c7d93a0bcc97ebfe04c98d3a60.zip |
[Project] Rdns: Fix TCP connection mess
Diffstat (limited to 'contrib/librdns/util.c')
-rw-r--r-- | contrib/librdns/util.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/librdns/util.c b/contrib/librdns/util.c index 61c244199..fd71179e9 100644 --- a/contrib/librdns/util.c +++ b/contrib/librdns/util.c @@ -548,6 +548,9 @@ rdns_ioc_new (struct rdns_server *serv, } nioc->struct_magic = RDNS_IO_CHANNEL_TAG; + nioc->srv = serv; + nioc->resolver = resolver; + nioc->sock = rdns_make_client_socket (serv->name, serv->port, is_tcp ? SOCK_STREAM : SOCK_DGRAM, &nioc->saddr, &nioc->slen); if (nioc->sock == -1) { @@ -570,12 +573,7 @@ rdns_ioc_new (struct rdns_server *serv, nioc->flags |= RDNS_CHANNEL_TCP; } - - nioc->srv = serv; - nioc->resolver = resolver; - - /* If it is not NULL then we are in a delayed connection state */ - if (!is_tcp) { + else { nioc->flags |= RDNS_CHANNEL_ACTIVE; nioc->async_io = resolver->async->add_read(resolver->async->data, nioc->sock, nioc); |