]> granicus.if.org Git - ejabberd/commitdiff
Get rid of a workaround against old Erlang bug
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sun, 21 May 2017 10:30:46 +0000 (13:30 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sun, 21 May 2017 10:30:46 +0000 (13:30 +0300)
src/ejabberd_receiver.erl

index 24eb92fadc7b914e77c67bd7667591dbc7912d7b..44c29680cf7ff6b0da29a4bd89a0d13ba772eea8 100644 (file)
@@ -248,17 +248,15 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}.
 
 activate_socket(#state{socket = Socket,
                       sock_mod = SockMod}) ->
-    PeerName = case SockMod of
-                gen_tcp ->
-                    inet:setopts(Socket, [{active, once}]),
-                    inet:peername(Socket);
-                _ ->
-                    SockMod:setopts(Socket, [{active, once}]),
-                    SockMod:peername(Socket)
-              end,
-    case PeerName of
+    Res = case SockMod of
+             gen_tcp ->
+                 inet:setopts(Socket, [{active, once}]);
+             _ ->
+                 SockMod:setopts(Socket, [{active, once}])
+         end,
+    case Res of
       {error, _Reason} -> self() ! {tcp_closed, Socket};
-      {ok, _} -> ok
+      ok -> ok
     end.
 
 %% Data processing for connectors directly generating xmlelement in