# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1446728075 -3600
# Node ID 65344c3bae7a220a9280810384b265ad1a799666
# Parent  d0ab0069145fa99cebbdd3b50126fb60ed43d5db
mod_s2s/s2sout: Keep SRV lookup response around even if it's empty

diff -r d0ab0069145f -r 65344c3bae7a plugins/mod_s2s/s2sout.lib.lua
--- a/plugins/mod_s2s/s2sout.lib.lua	Thu Nov 05 13:35:16 2015 +0100
+++ b/plugins/mod_s2s/s2sout.lib.lua	Thu Nov 05 13:54:35 2015 +0100
@@ -103,11 +103,12 @@
 		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