aboutsummaryrefslogtreecommitdiff
path: root/src/web/mod_http_bind.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2009-06-16 17:43:39 +0000
committerBadlop <badlop@process-one.net>2009-06-16 17:43:39 +0000
commit7ed7ca6e1e95a22b7a7d43247fed9b6f9608f62e (patch)
tree53e1d2624d1ca641b5c5c70f2bc2843ef11b352d /src/web/mod_http_bind.erl
parentInitial commit of HTTP-Bind source code (thanks to Stefan Striegler) (diff)
Make use of new api for plugable http based services (thanks to Stefan Strigler)
SVN Revision: 2199
Diffstat (limited to 'src/web/mod_http_bind.erl')
-rw-r--r--src/web/mod_http_bind.erl30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/web/mod_http_bind.erl b/src/web/mod_http_bind.erl
index 1cebd0f5e..c57624e36 100644
--- a/src/web/mod_http_bind.erl
+++ b/src/web/mod_http_bind.erl
@@ -17,8 +17,7 @@
-define(MOD_HTTP_BIND_VERSION, "1.0").
-vsn(?MOD_HTTP_BIND_VERSION).
-
-%%-define(ejabberd_debug, true).
+-define(ejabberd_debug, true).
-behaviour(gen_mod).
@@ -44,7 +43,7 @@ process([], #request{method = 'POST',
[{xmlcdata, "400 Bad Request"}]}};
process([], #request{method = 'POST',
data = Data}) ->
- ?DEBUG("Incoming data: ~s", [Data]),
+ ?DEBUG("Data: '~p'", [Data]),
ejabberd_http_bind:process_request(Data);
process([], #request{method = 'GET',
data = []}) ->
@@ -75,28 +74,9 @@ process(_Path, _Request) ->
%%%----------------------------------------------------------------------
%%% BEHAVIOUR CALLBACKS
%%%----------------------------------------------------------------------
+
start(_Host, _Opts) ->
- HTTPBindSupervisor =
- {ejabberd_http_bind_sup,
- {ejabberd_tmp_sup, start_link,
- [ejabberd_http_bind_sup, ejabberd_http_bind]},
- permanent,
- infinity,
- supervisor,
- [ejabberd_tmp_sup]},
- case supervisor:start_child(ejabberd_sup, HTTPBindSupervisor) of
- {ok, _Pid} ->
- ok;
- {ok, _Pid, _Info} ->
- ok;
- {error, Error} ->
- {'EXIT', {start_child_error, Error}}
- end.
+ ok.
stop(_Host) ->
- case supervisor:terminate_child(ejabberd_sup, ejabberd_http_bind_sup) of
- ok ->
- ok;
- {error, Error} ->
- {'EXIT', {terminate_child_error, Error}}
- end.
+ ok.