mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Improve handle of inet:gethostbyname return
This commit is contained in:
parent
be111b6749
commit
19a8b79342
@ -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(),
|
||||
@ -1044,7 +1041,6 @@ get_addr_port(Server) ->
|
||||
?DEBUG("srv lookup of '~s': ~p~n", [Server, List]),
|
||||
List
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
||||
srv_lookup(Server) ->
|
||||
|
Loading…
Reference in New Issue
Block a user