Patch by Sergei Golovan increases timeouts in S2S and removes horrible 5-minute
delay between remote server connection attempts after a falure (in case of
server is down it would be reasonable, but what happens much more often is a
network split when the delay is inadmissible).
Index: src/ejabberd_s2s_in.erl
===================================================================
--- src/ejabberd_s2s_in.erl 2009-04-01 17:23:52.000000000 +0200
+++ src/ejabberd_s2s_in.erl 2009-04-05 22:51:20.000000000 +0200
@@ -352,7 +352,7 @@
case {ejabberd_s2s:allow_host(To, From),
lists:member(LTo, ejabberd_router:dirty_get_all_domains())} of
{true, true} ->
- ejabberd_s2s_out:terminate_if_waiting_delay(To, From),
+ %%ejabberd_s2s_out:terminate_if_waiting_delay(To, From),
ejabberd_s2s_out:start(To, From,
{verify, self(),
Key, StateData#state.streamid}),
Index: src/ejabberd_s2s_out.erl
===================================================================
--- src/ejabberd_s2s_out.erl 2009-04-01 17:23:51.000000000 +0200
+++ src/ejabberd_s2s_out.erl 2009-04-05 22:51:20.000000000 +0200
@@ -93,7 +93,7 @@
%% Only change this value if you now what your are doing:
-define(FSMLIMITS,[]).
%% -define(FSMLIMITS, [{max_queue, 2000}]).
--define(FSMTIMEOUT, 30000).
+-define(FSMTIMEOUT, 60000).
%% We do not block on send anymore.
-define(TCP_SEND_TIMEOUT, 15000).
@@ -227,8 +227,8 @@
{error, _Reason} ->
?INFO_MSG("s2s connection: ~s -> ~s (remote server not found)",
[StateData#state.myname, StateData#state.server]),
- wait_before_reconnect(StateData)
- %%{stop, normal, StateData}
+ %%wait_before_reconnect(StateData)
+ {stop, normal, StateData}
end;
open_socket(stop, StateData) ->
?INFO_MSG("s2s connection: ~s -> ~s (stopped in open socket)",