From de6675a433a92eff1b31399d842f41cac718f6ed Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Tue, 13 Jul 2010 22:13:38 +0200 Subject: [PATCH] Added catches to reset_stream calls to avoid errors during a race condition (thanks to Aleksey Shchepin) --- src/ejabberd_c2s.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 90d85e845..af0f34c97 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -593,8 +593,8 @@ wait_for_feature_request({xmlstreamelement, #xmlel{ns = NS, name = Name} = El}, Mech, ClientIn) of {ok, Props} -> - (StateData#state.sockmod):reset_stream( - StateData#state.socket), + catch (StateData#state.sockmod):reset_stream( + StateData#state.socket), send_element(StateData, exmpp_server_sasl:success()), U = proplists:get_value(username, Props), AuthModule = proplists:get_value(auth_module, Props), @@ -712,8 +712,8 @@ wait_for_sasl_response({xmlstreamelement, #xmlel{ns = NS, name = Name} = El}, case cyrsasl:server_step(StateData#state.sasl_state, ClientIn) of {ok, Props} -> - (StateData#state.sockmod):reset_stream( - StateData#state.socket), + catch (StateData#state.sockmod):reset_stream( + StateData#state.socket), send_element(StateData, exmpp_server_sasl:success()), U = proplists:get_value(username, Props), AuthModule = proplists:get_value(auth_module, Props),