]> granicus.if.org Git - ejabberd/commitdiff
Fix OTP version detection to work with old supported R10 and R11
authorBadlop <badlop@process-one.net>
Sat, 16 Jan 2010 12:24:11 +0000 (12:24 +0000)
committerBadlop <badlop@process-one.net>
Sat, 16 Jan 2010 12:24:11 +0000 (12:24 +0000)
SVN Revision: 2906

src/ejabberd_listener.erl
src/ejabberd_s2s_out.erl

index 4888fd495f1353a126a014fd58c2b869246ab08c..a179dfda40ca020ea66a8f8afb7c99ff28bfd6bc 100644 (file)
@@ -128,10 +128,12 @@ init_udp(PortIP, Module, Opts, SockOpts, Port, IPS) ->
     end.
 
 init_tcp(PortIP, Module, Opts, SockOpts, Port, IPS) ->
-    SockOpts2 = case erlang:system_info(otp_release) >= "R13B" of
-       true -> [{send_timeout_close, true} | SockOpts];
-       false -> SockOpts
-    end,
+    SockOpts2 = try erlang:system_info(otp_release) >= "R13B" of
+                   true -> [{send_timeout_close, true} | SockOpts];
+                   false -> SockOpts
+               catch
+                   _:_ -> []
+               end,
     Res = gen_tcp:listen(Port, [binary,
                                {packet, 0},
                                {active, false},
index d36d149051ed59788f5d44418ee0ae8411372d5a..073c7996280f2f874ab05eae3284f08f3416c9f3 100644 (file)
@@ -265,10 +265,12 @@ open_socket1(Host, Port) ->
 open_socket2(Type, Addr, Port) ->
     ?DEBUG("s2s_out: connecting to ~p:~p~n", [Addr, Port]),
     Timeout = outgoing_s2s_timeout(),
-    SockOpts = case erlang:system_info(otp_release) >= "R13B" of
-       true -> [{send_timeout_close, true}];
-       false -> []
-    end,
+    SockOpts = try erlang:system_info(otp_release) >= "R13B" of
+                  true -> [{send_timeout_close, true}];
+                  false -> []
+              catch
+                  _:_ -> []
+              end,
     case (catch ejabberd_socket:connect(Addr, Port,
                                        [binary, {packet, 0},
                                         {send_timeout, ?TCP_SEND_TIMEOUT},