mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
get rid of queue:filter/2 to keep compatibility with older Erlang versions
This commit is contained in:
parent
62ad40b1e4
commit
9890cc89b6
@ -197,11 +197,10 @@ connecting(connect, #state{host = Host} = State) ->
|
|||||||
case ConnectRes of
|
case ConnectRes of
|
||||||
{ok, Ref} ->
|
{ok, Ref} ->
|
||||||
erlang:monitor(process, Ref),
|
erlang:monitor(process, Ref),
|
||||||
queue:filter(
|
lists:foreach(
|
||||||
fun(Req) ->
|
fun(Req) ->
|
||||||
?GEN_FSM:send_event(self(), Req),
|
?GEN_FSM:send_event(self(), Req)
|
||||||
false
|
end, queue:to_list(PendingRequests)),
|
||||||
end, PendingRequests),
|
|
||||||
{next_state, session_established,
|
{next_state, session_established,
|
||||||
State#state{db_ref = Ref,
|
State#state{db_ref = Ref,
|
||||||
pending_requests = {0, queue:new()}}};
|
pending_requests = {0, queue:new()}}};
|
||||||
@ -229,12 +228,11 @@ connecting({sql_cmd, Command} = Req, From, State) ->
|
|||||||
if Len < State#state.max_pending_requests_len ->
|
if Len < State#state.max_pending_requests_len ->
|
||||||
{Len + 1, queue:in({sql_cmd, Command, From}, PendingRequests)};
|
{Len + 1, queue:in({sql_cmd, Command, From}, PendingRequests)};
|
||||||
true ->
|
true ->
|
||||||
queue:filter(
|
lists:foreach(
|
||||||
fun({sql_cmd, _, To}) ->
|
fun({sql_cmd, _, To}) ->
|
||||||
?GEN_FSM:reply(To,
|
?GEN_FSM:reply(
|
||||||
{error, "SQL connection failed"}),
|
To, {error, "SQL connection failed"})
|
||||||
false
|
end, queue:to_list(PendingRequests)),
|
||||||
end, PendingRequests),
|
|
||||||
{1, queue:from_list([{sql_cmd, Command, From}])}
|
{1, queue:from_list([{sql_cmd, Command, From}])}
|
||||||
end,
|
end,
|
||||||
{next_state, connecting,
|
{next_state, connecting,
|
||||||
|
Loading…
Reference in New Issue
Block a user