mod_s2s: Check that an SRV reply isn't empty.
authorKim Alvefur <zash@zash.se>
Mon, 3 Sep 2012 02:22:40 +0000 (04:22 +0200)
committerKim Alvefur <zash@zash.se>
Mon, 3 Sep 2012 02:22:40 +0000 (04:22 +0200)
plugins/mod_s2s/s2sout.lib.lua

index 17978b39afde8645ea444b386cd6a27177e4b421..076239680f41b7d6a69f6017780672d23d9417b0 100644 (file)
@@ -94,7 +94,7 @@ function s2sout.attempt_connection(host_session, err)
                handle = adns.lookup(function (answer)
                        handle = nil;
                        host_session.connecting = nil;
-                       if answer then
+                       if answer and #answer > 0 then
                                log("debug", "%s has SRV records, handling...", to_host);
                                local srv_hosts = {};
                                host_session.srv_hosts = srv_hosts;