239 if handle then |
239 if handle then |
240 adns.cancel(handle, true); |
240 adns.cancel(handle, true); |
241 end |
241 end |
242 end); |
242 end); |
243 |
243 |
244 log("debug", "DNS lookup for %s sent, waiting for response before we can connect", to_host); |
|
245 return true; -- Attempt in progress |
244 return true; -- Attempt in progress |
246 elseif host_session.srv_hosts and #host_session.srv_hosts > host_session.srv_choice then -- Not our first attempt, and we also have SRV |
245 elseif host_session.srv_hosts and #host_session.srv_hosts > host_session.srv_choice then -- Not our first attempt, and we also have SRV |
247 host_session.srv_choice = host_session.srv_choice + 1; |
246 host_session.srv_choice = host_session.srv_choice + 1; |
248 local srv_choice = host_session.srv_hosts[host_session.srv_choice]; |
247 local srv_choice = host_session.srv_hosts[host_session.srv_choice]; |
249 connect_host, connect_port = srv_choice.target or to_host, srv_choice.port or connect_port; |
248 connect_host, connect_port = srv_choice.target or to_host, srv_choice.port or connect_port; |