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

Added catches to reset_stream calls to avoid errors during a race condition (thanks to Aleksey Shchepin)

This commit is contained in:
Christophe Romain 2010-07-13 22:13:38 +02:00
parent 81d364a97a
commit de6675a433

View File

@ -593,7 +593,7 @@ wait_for_feature_request({xmlstreamelement, #xmlel{ns = NS, name = Name} = El},
Mech, Mech,
ClientIn) of ClientIn) of
{ok, Props} -> {ok, Props} ->
(StateData#state.sockmod):reset_stream( catch (StateData#state.sockmod):reset_stream(
StateData#state.socket), StateData#state.socket),
send_element(StateData, exmpp_server_sasl:success()), send_element(StateData, exmpp_server_sasl:success()),
U = proplists:get_value(username, Props), U = proplists:get_value(username, Props),
@ -712,7 +712,7 @@ wait_for_sasl_response({xmlstreamelement, #xmlel{ns = NS, name = Name} = El},
case cyrsasl:server_step(StateData#state.sasl_state, case cyrsasl:server_step(StateData#state.sasl_state,
ClientIn) of ClientIn) of
{ok, Props} -> {ok, Props} ->
(StateData#state.sockmod):reset_stream( catch (StateData#state.sockmod):reset_stream(
StateData#state.socket), StateData#state.socket),
send_element(StateData, exmpp_server_sasl:success()), send_element(StateData, exmpp_server_sasl:success()),
U = proplists:get_value(username, Props), U = proplists:get_value(username, Props),