From 19a8b793427bf2d3bcb5a63774b34044c153b9e9 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 18 Jun 2010 11:52:36 +0200 Subject: [PATCH] Improve handle of inet:gethostbyname return --- src/ejabberd_s2s_out.erl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index 37b45d390..e2e721549 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -1018,10 +1018,7 @@ get_addr_port(Server) -> {ok, HEnt} -> ?DEBUG("srv lookup of '~s': ~p~n", [Server, HEnt#hostent.h_addr_list]), - case HEnt#hostent.h_addr_list of - [] -> - [{Server, outgoing_s2s_port()}]; - AddrList -> + AddrList = HEnt#hostent.h_addr_list, %% Probabilities are not exactly proportional to weights %% for simplicity (higher weigths are overvalued) {A1, A2, A3} = now(), @@ -1043,7 +1040,6 @@ get_addr_port(Server) -> end, lists:keysort(1, SortedList)), ?DEBUG("srv lookup of '~s': ~p~n", [Server, List]), List - end end end.