s2smanager: Give reasons to destroy_session in more cases, including when DNS lookup...
authorMatthew Wild <mwild1@gmail.com>
Thu, 17 Dec 2009 21:50:02 +0000 (21:50 +0000)
committerMatthew Wild <mwild1@gmail.com>
Thu, 17 Dec 2009 21:50:02 +0000 (21:50 +0000)
core/s2smanager.lua

index 34efc2543bd6af826516de16dbd5ac9bbb4a6fc2..f444e8437ca64b54042ff3030c32785e825ad9df 100644 (file)
@@ -227,7 +227,7 @@ function attempt_connection(host_session, err)
                        if not ok then
                                if not attempt_connection(host_session, err) then
                                        -- No more attempts will be made
-                                       destroy_session(host_session);
+                                       destroy_session(host_session, err);
                                end
                        end
                end, "_xmpp-server._tcp."..connect_host..".", "SRV");
@@ -287,7 +287,7 @@ function try_connect(host_session, connect_host, connect_port)
                        log("debug", "DNS lookup failed to get a response for %s", connect_host);
                        if not attempt_connection(host_session, "name resolution failed") then -- Retry if we can
                                log("debug", "No other records to try for %s - destroying", host_session.to_host);
-                               destroy_session(host_session); -- End of the line, we can't
+                               destroy_session(host_session, "DNS resolution failed"); -- End of the line, we can't
                        end
                end
        end, connect_host, "A", "IN");