]> granicus.if.org Git - ejabberd/commitdiff
Fix previous commit
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Tue, 2 Apr 2019 06:58:12 +0000 (09:58 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Tue, 2 Apr 2019 06:58:12 +0000 (09:58 +0300)
Fixes #2847

src/ejabberd_listener.erl

index 7413ee048cc8867cc78679d76b90ad5a4f7943f7..73baf3142dfffd603cdd0b62600df7ebaa781429 100644 (file)
@@ -280,12 +280,14 @@ udp_recv(Socket, Module, Opts) ->
                      {ok, pid()} | {error, any()} | ignore.
 start_connection(Module, Arity, Socket, Opts, Sup) ->
     Res = case Sup of
+             undefined when Arity == 3 ->
+                 Module:start(gen_tcp, Socket, Opts);
              undefined ->
-                 case Arity of
-                     3 -> Module:start(gen_tcp, Socket, Opts);
-                     2 -> Module:start({gen_tcp, Socket}, Opts)
-                 end;
-             _ -> supervisor:start_child(Sup, [{gen_tcp, Socket}, Opts])
+                 Module:start({gen_tcp, Socket}, Opts);
+             _ when Arity == 3 ->
+                 supervisor:start_child(Sup, [gen_tcp, Socket, Opts]);
+             _ ->
+                 supervisor:start_child(Sup, [{gen_tcp, Socket}, Opts])
          end,
     case Res of
        {ok, Pid} ->