mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-24 22:25:47 +02:00
* src/ejabberd_s2s_out.erl: Bugfix
SVN Revision: 700
This commit is contained in:
parent
c2f3d4f9a6
commit
56f01cfe6e
|
@ -1,3 +1,7 @@
|
||||||
|
2006-12-31 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/ejabberd_s2s_out.erl: Bugfix
|
||||||
|
|
||||||
2006-12-21 Mickael Remond <mickael.remond@process-one.net>
|
2006-12-21 Mickael Remond <mickael.remond@process-one.net>
|
||||||
|
|
||||||
* src/mod_private_odbc: Bugfix: an internal error was returned
|
* src/mod_private_odbc: Bugfix: an internal error was returned
|
||||||
|
|
|
@ -141,7 +141,11 @@ init([From, Server, Type]) ->
|
||||||
%% {stop, Reason, NewStateData}
|
%% {stop, Reason, NewStateData}
|
||||||
%%----------------------------------------------------------------------
|
%%----------------------------------------------------------------------
|
||||||
open_socket(init, StateData) ->
|
open_socket(init, StateData) ->
|
||||||
AddrList = get_addr_port(StateData#state.server),
|
AddrList = case idna:domain_utf8_to_ascii(StateData#state.server) of
|
||||||
|
false -> [];
|
||||||
|
ASCIIAddr ->
|
||||||
|
get_addr_port(ASCIIAddr)
|
||||||
|
end,
|
||||||
case lists:foldl(fun({Addr, Port}, Acc) ->
|
case lists:foldl(fun({Addr, Port}, Acc) ->
|
||||||
case Acc of
|
case Acc of
|
||||||
{ok, Socket} ->
|
{ok, Socket} ->
|
||||||
|
@ -174,12 +178,9 @@ open_socket(_, StateData) ->
|
||||||
|
|
||||||
%%----------------------------------------------------------------------
|
%%----------------------------------------------------------------------
|
||||||
open_socket1(Addr, Port) ->
|
open_socket1(Addr, Port) ->
|
||||||
Res = case idna:domain_utf8_to_ascii(Addr) of
|
?DEBUG("s2s_out: connecting to ~s:~p~n", [Addr, Port]),
|
||||||
false -> {error, badarg};
|
Res = case catch ejabberd_socket:connect(
|
||||||
ASCIIAddr ->
|
Addr, Port,
|
||||||
?DEBUG("s2s_out: connecting to ~s:~p~n", [ASCIIAddr, Port]),
|
|
||||||
case catch ejabberd_socket:connect(
|
|
||||||
ASCIIAddr, Port,
|
|
||||||
[binary, {packet, 0},
|
[binary, {packet, 0},
|
||||||
{active, false}]) of
|
{active, false}]) of
|
||||||
{ok, _Socket} = R -> R;
|
{ok, _Socket} = R -> R;
|
||||||
|
@ -195,7 +196,6 @@ open_socket1(Addr, Port) ->
|
||||||
Addr, Port,
|
Addr, Port,
|
||||||
[binary, {packet, 0},
|
[binary, {packet, 0},
|
||||||
{active, false}, inet6])
|
{active, false}, inet6])
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
case Res of
|
case Res of
|
||||||
{ok, Socket} ->
|
{ok, Socket} ->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user