25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Minor changes (thanks to Stefan Strigler)

SVN Revision: 2206
This commit is contained in:
Badlop 2009-06-16 17:44:08 +00:00
parent 673a7aad55
commit 2e402c27f4
2 changed files with 469 additions and 501 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,6 @@
%%% Author : Stefan Strigler <steve@zeank.in-berlin.de> %%% Author : Stefan Strigler <steve@zeank.in-berlin.de>
%%% Purpose : Implementation of XMPP over BOSH (XEP-0206) %%% Purpose : Implementation of XMPP over BOSH (XEP-0206)
%%% Created : Tue Feb 20 13:15:52 CET 2007 %%% Created : Tue Feb 20 13:15:52 CET 2007
%%% Id : $Id: $
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
@ -15,7 +14,7 @@
-module(mod_http_bind). -module(mod_http_bind).
-author('steve@zeank.in-berlin.de'). -author('steve@zeank.in-berlin.de').
-define(MOD_HTTP_BIND_VERSION, "1.0"). -define(MOD_HTTP_BIND_VERSION, '1.0').
-vsn(?MOD_HTTP_BIND_VERSION). -vsn(?MOD_HTTP_BIND_VERSION).
%%-define(ejabberd_debug, true). %%-define(ejabberd_debug, true).
@ -48,7 +47,7 @@ process([], #request{method = 'POST',
ejabberd_http_bind:process_request(Data); ejabberd_http_bind:process_request(Data);
process([], #request{method = 'GET', process([], #request{method = 'GET',
data = []}) -> data = []}) ->
Heading = "Ejabberd " ++ atom_to_list(?MODULE) ++ " v" ++ ?MOD_HTTP_BIND_VERSION, Heading = "Ejabberd " ++ atom_to_list(?MODULE) ++ " v" ++ lists:concat([?MOD_HTTP_BIND_VERSION]),
{xmlelement, "html", [{"xmlns", "http://www.w3.org/1999/xhtml"}], {xmlelement, "html", [{"xmlns", "http://www.w3.org/1999/xhtml"}],
[{xmlelement, "head", [], [{xmlelement, "head", [],
[{xmlelement, "title", [], [{xmlcdata, Heading}]}]}, [{xmlelement, "title", [], [{xmlcdata, Heading}]}]},
@ -57,21 +56,16 @@ process([], #request{method = 'GET',
{xmlelement, "p", [], {xmlelement, "p", [],
[{xmlcdata, "An implementation of "}, [{xmlcdata, "An implementation of "},
{xmlelement, "a", [{"href", "http://www.xmpp.org/extensions/xep-0206.html"}], {xmlelement, "a", [{"href", "http://www.xmpp.org/extensions/xep-0206.html"}],
[{xmlcdata, "XMPP over BOSH (XEP-0206)"}]}]}, [{xmlcdata, "XMPP over BOSH (XEP-0206)"}]},
{xmlcdata, "."}]},
{xmlelement, "p", [], {xmlelement, "p", [],
[{xmlcdata, integer_to_list(mnesia:table_info(http_bind, size)) ++ " sessions found."}]}, [{xmlcdata, integer_to_list(mnesia:table_info(http_bind, size)) ++ " sessions found."}]}
{xmlelement, "p", [], ]}]};
[{xmlcdata, "Sponsored by "},
{xmlelement, "a", [{"href", "http://mabber.com"}],
[{xmlcdata, "mabber"}]},
{xmlcdata, "."}]}
]}]};
process(_Path, _Request) -> process(_Path, _Request) ->
?DEBUG("Bad Request: ~p", [_Request]), ?DEBUG("Bad Request: ~p", [_Request]),
{400, [], {xmlelement, "h1", [], {400, [], {xmlelement, "h1", [],
[{xmlcdata, "400 Bad Request"}]}}. [{xmlcdata, "400 Bad Request"}]}}.
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
%%% BEHAVIOUR CALLBACKS %%% BEHAVIOUR CALLBACKS
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------