]> granicus.if.org Git - ejabberd/commitdiff
Don't overwrite listeners for different transports in config merging
authorPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 19 Aug 2015 08:14:09 +0000 (10:14 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 19 Aug 2015 08:14:39 +0000 (10:14 +0200)
Before this having listeners on same port for both tcp and udp would after
config merging step left only one of them.

Many thanks to Holger Weiß for noticing this.

src/ejabberd_config.erl

index abb295a75fb22047dc3f69cccc4ce7275d562068..89e1399fac09bbe77a3216c81942d9e5a6ae6eb0 100644 (file)
@@ -370,7 +370,10 @@ exit_or_halt(ExitText) ->
 
 get_config_option_key(Name, Val) ->
     if Name == listen ->
-            lists:keyfind(port, 1, Val);
+            case {lists:keyfind(port, 1, Val), lists:keyfind(transport, 1, Val)} of
+                {{_, Port}, false} -> {Port, tcp};
+                {{_, Port2}, {_, Trans}} -> {Port2, Trans}
+            end;
        is_tuple(Val) ->
             element(1, Val);
        true ->