mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-02 21:17:12 +02:00
Fix OTP version detection to work with old supported R10 and R11
SVN Revision: 2906
This commit is contained in:
parent
3e4858f348
commit
86794b1d23
|
@ -128,10 +128,12 @@ init_udp(PortIP, Module, Opts, SockOpts, Port, IPS) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
init_tcp(PortIP, Module, Opts, SockOpts, Port, IPS) ->
|
init_tcp(PortIP, Module, Opts, SockOpts, Port, IPS) ->
|
||||||
SockOpts2 = case erlang:system_info(otp_release) >= "R13B" of
|
SockOpts2 = try erlang:system_info(otp_release) >= "R13B" of
|
||||||
true -> [{send_timeout_close, true} | SockOpts];
|
true -> [{send_timeout_close, true} | SockOpts];
|
||||||
false -> SockOpts
|
false -> SockOpts
|
||||||
end,
|
catch
|
||||||
|
_:_ -> []
|
||||||
|
end,
|
||||||
Res = gen_tcp:listen(Port, [binary,
|
Res = gen_tcp:listen(Port, [binary,
|
||||||
{packet, 0},
|
{packet, 0},
|
||||||
{active, false},
|
{active, false},
|
||||||
|
|
|
@ -265,10 +265,12 @@ open_socket1(Host, Port) ->
|
||||||
open_socket2(Type, Addr, Port) ->
|
open_socket2(Type, Addr, Port) ->
|
||||||
?DEBUG("s2s_out: connecting to ~p:~p~n", [Addr, Port]),
|
?DEBUG("s2s_out: connecting to ~p:~p~n", [Addr, Port]),
|
||||||
Timeout = outgoing_s2s_timeout(),
|
Timeout = outgoing_s2s_timeout(),
|
||||||
SockOpts = case erlang:system_info(otp_release) >= "R13B" of
|
SockOpts = try erlang:system_info(otp_release) >= "R13B" of
|
||||||
true -> [{send_timeout_close, true}];
|
true -> [{send_timeout_close, true}];
|
||||||
false -> []
|
false -> []
|
||||||
end,
|
catch
|
||||||
|
_:_ -> []
|
||||||
|
end,
|
||||||
case (catch ejabberd_socket:connect(Addr, Port,
|
case (catch ejabberd_socket:connect(Addr, Port,
|
||||||
[binary, {packet, 0},
|
[binary, {packet, 0},
|
||||||
{send_timeout, ?TCP_SEND_TIMEOUT},
|
{send_timeout, ?TCP_SEND_TIMEOUT},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user