Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen_iq_handler.erl')
-rw-r--r--src/gen_iq_handler.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl
index fedd72c49..e9ba01470 100644
--- a/src/gen_iq_handler.erl
+++ b/src/gen_iq_handler.erl
@@ -27,7 +27,10 @@
-author('alexey@process-one.net').
--behaviour(gen_server).
+-ifndef(GEN_SERVER).
+-define(GEN_SERVER, gen_server).
+-endif.
+-behaviour(?GEN_SERVER).
%% API
-export([start_link/3, add_iq_handler/6,
@@ -57,7 +60,7 @@
%% Description: Starts the server
%%--------------------------------------------------------------------
start_link(Host, Module, Function) ->
- gen_server:start_link(?MODULE, [Host, Module, Function],
+ ?GEN_SERVER:start_link(?MODULE, [Host, Module, Function],
[]).
-spec add_iq_handler(module(), binary(), binary(), module(), atom(), type()) -> ok.
@@ -98,10 +101,10 @@ remove_iq_handler(Component, Host, NS) ->
stop_iq_handler(_Module, _Function, Opts) ->
case Opts of
- {one_queue, Pid} -> gen_server:call(Pid, stop);
+ {one_queue, Pid} -> ?GEN_SERVER:call(Pid, stop);
{queues, Pids} ->
lists:foreach(fun (Pid) ->
- catch gen_server:call(Pid, stop)
+ catch ?GEN_SERVER:call(Pid, stop)
end,
Pids);
_ -> ok