24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-07-04 23:15:31 +02:00

Do not close session with an item-not-found error when

receiving duplicate request with same rid as the currently
active one (EJABS-1844) (thanks to Pawel Chmielowski)

Conflicts:

	src/web/ejabberd_bosh.erl
This commit is contained in:
Evgeniy Khramtsov 2012-06-04 18:11:59 +10:00
parent 10f10a2fd3
commit 6b7d70adf6

View File

@ -463,19 +463,17 @@ active1(#body{attrs = Attrs} = Req, From, State) ->
{next_state, active, {next_state, active,
State1#state{receivers = Receivers}}; State1#state{receivers = Receivers}};
RID =< State#state.prev_rid -> RID =< State#state.prev_rid ->
%% TODO: do we need to check 'key' here? It seems so...
case gb_trees:lookup(RID, State#state.responses) of case gb_trees:lookup(RID, State#state.responses) of
{value, PrevBody} -> {value, PrevBody} ->
{next_state, active, {next_state, active,
do_reply(State, From, PrevBody, RID)}; do_reply(State, From, PrevBody, RID)};
none -> none ->
reply_stop(State, State1 = drop_holding_receiver(State),
#body{http_reason = State2 = restart_inactivity_timer(State1),
<<"Request ID is out of range">>, Receivers = gb_trees:insert(RID, {From, Req},
attrs = State2#state.receivers),
[{<<"type">>, <<"terminate">>}, {next_state, active, State2#state{receivers = Receivers}}
{<<"condition">>,
<<"item-not-found">>}]},
From, RID)
end; end;
not IsValidKey -> not IsValidKey ->
reply_stop(State, reply_stop(State,