25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

* src/ejabberd_s2s.erl: Only trigger s2s_connect_hook on successful connection (EJAB-566)

* src/ejabberd_s2s_out.erl: Likewise

SVN Revision: 1235
This commit is contained in:
Mickaël Rémond 2008-03-17 10:16:21 +00:00
parent 4cf68c2f9f
commit 320c266276
3 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-03-17 Mickael Remond <mremond@process-one.net>
* src/ejabberd_s2s.erl: Only trigger s2s_connect_hook on
successful connection (EJAB-566)
* src/ejabberd_s2s_out.erl: Likewise
2008-03-15 Mickael Remond <mremond@process-one.net> 2008-03-15 Mickael Remond <mremond@process-one.net>
* src/ejabberd_ctl.erl: API improvement: Added * src/ejabberd_ctl.erl: API improvement: Added

View File

@ -359,7 +359,6 @@ new_connection(MyServer, Server, From, FromTo,
TRes = mnesia:transaction(F), TRes = mnesia:transaction(F),
case TRes of case TRes of
{atomic, Pid} -> {atomic, Pid} ->
ejabberd_hooks:run(s2s_connect_hook, [MyServer, Server]),
ejabberd_s2s_out:start_connection(Pid); ejabberd_s2s_out:start_connection(Pid);
_ -> _ ->
ejabberd_s2s_out:stop_connection(Pid) ejabberd_s2s_out:stop_connection(Pid)

View File

@ -312,6 +312,9 @@ wait_for_validation({xmlstreamelement, El}, StateData) ->
send_queue(StateData, StateData#state.queue), send_queue(StateData, StateData#state.queue),
?INFO_MSG("Connection established: ~s -> ~s", ?INFO_MSG("Connection established: ~s -> ~s",
[StateData#state.myname, StateData#state.server]), [StateData#state.myname, StateData#state.server]),
ejabberd_hooks:run(s2s_connect_hook,
[StateData#state.myname,
StateData#state.server]),
{next_state, stream_established, {next_state, stream_established,
StateData#state{queue = queue:new()}}; StateData#state{queue = queue:new()}};
_ -> _ ->
@ -420,6 +423,9 @@ wait_for_features({xmlstreamelement, El}, StateData) ->
send_queue(StateData, StateData#state.queue), send_queue(StateData, StateData#state.queue),
?INFO_MSG("Connection established: ~s -> ~s", ?INFO_MSG("Connection established: ~s -> ~s",
[StateData#state.myname, StateData#state.server]), [StateData#state.myname, StateData#state.server]),
ejabberd_hooks:run(s2s_connect_hook,
[StateData#state.myname,
StateData#state.server]),
{next_state, stream_established, {next_state, stream_established,
StateData#state{queue = queue:new()}}; StateData#state{queue = queue:new()}};
SASLEXT and StateData#state.try_auth and SASLEXT and StateData#state.try_auth and