mod_s2s/s2sout: Keep SRV lookup response around even if it's empty
authorKim Alvefur <zash@zash.se>
Thu, 5 Nov 2015 12:54:35 +0000 (13:54 +0100)
committerKim Alvefur <zash@zash.se>
Thu, 5 Nov 2015 12:54:35 +0000 (13:54 +0100)
plugins/mod_s2s/s2sout.lib.lua

index 7c6033a36f5bbfbb1014ee92f8aa513eaff5093d..395406cd69494a2b175c24855bb7431ef18ffdb7 100644 (file)
@@ -103,11 +103,12 @@ function s2sout.attempt_connection(host_session, err)
                local handle;
                handle = adns.lookup(function (answer)
                        handle = nil;
+                       local srv_hosts = { answer = answer };
+                       host_session.srv_hosts = srv_hosts;
+                       host_session.srv_choice = 0;
                        host_session.connecting = nil;
                        if answer and #answer > 0 then
                                log("debug", "%s has SRV records, handling...", to_host);
-                               local srv_hosts = { answer = answer };
-                               host_session.srv_hosts = srv_hosts;
                                for _, record in ipairs(answer) do
                                        t_insert(srv_hosts, record.srv);
                                end