25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Merge branch 'master' of git+ssh://git@gitorious.process-one.net/ejabberd/mainline

This commit is contained in:
Pablo Polvorin 2010-11-29 16:56:32 -03:00
commit c9db1f691c
4 changed files with 25 additions and 12 deletions

View File

@ -1499,6 +1499,10 @@ change_shaper(StateData, JID) ->
StateData#state.shaper, JID), StateData#state.shaper, JID),
(StateData#state.sockmod):change_shaper(StateData#state.socket, Shaper). (StateData#state.sockmod):change_shaper(StateData#state.socket, Shaper).
send_text(StateData, Text) when StateData#state.xml_socket ->
?DEBUG("Send Text on stream = ~p", [lists:flatten(Text)]),
(StateData#state.sockmod):send_xml(StateData#state.socket,
{xmlstreamraw, Text});
send_text(StateData, Text) -> send_text(StateData, Text) ->
?DEBUG("Send XML on stream = ~s", [Text]), ?DEBUG("Send XML on stream = ~s", [Text]),
(StateData#state.sockmod):send(StateData#state.socket, Text). (StateData#state.sockmod):send(StateData#state.socket, Text).

View File

@ -37,6 +37,7 @@
get_connections_pids/1, get_connections_pids/1,
try_register/1, try_register/1,
remove_connection/3, remove_connection/3,
find_connection/2,
dirty_get_connections/0, dirty_get_connections/0,
allow_host/2, allow_host/2,
incoming_s2s_number/0, incoming_s2s_number/0,

View File

@ -992,6 +992,7 @@ prepare_response(Sess, Rid, OutputEls, StreamStart) ->
prepare_outpacket_response(Sess, _Rid, OutPacket, false) -> prepare_outpacket_response(Sess, _Rid, OutPacket, false) ->
case catch send_outpacket(Sess, OutPacket) of case catch send_outpacket(Sess, OutPacket) of
{'EXIT', _Reason} -> {'EXIT', _Reason} ->
?DEBUG("Error in sending packet ~p ", [_Reason]),
{200, ?HEADER, {200, ?HEADER,
"<body type='terminate' xmlns='"++ "<body type='terminate' xmlns='"++
?NS_HTTP_BIND_s++"'/>"}; ?NS_HTTP_BIND_s++"'/>"};
@ -1135,20 +1136,25 @@ send_outpacket(#http_bind{pid = FsmRef}, OutPacket) ->
declared_ns = [{undefined, ?NS_XMPP_pfx}]}}) -> false; declared_ns = [{undefined, ?NS_XMPP_pfx}]}}) -> false;
% {xmlelement, "stream:error", _, _}}) -> false; % {xmlelement, "stream:error", _, _}}) -> false;
({xmlstreamelement, _}) -> true; ({xmlstreamelement, _}) -> true;
({xmlstreamraw, _}) -> true;
(_) -> false (_) -> false
end, OutPacket), end, OutPacket),
case AllElements of case AllElements of
true -> true ->
TypedEls = [check_default_xmlns(OEl) || TypedEls = lists:foldr(fun({xmlstreamelement, El}, Acc) ->
{xmlstreamelement, OEl} <- OutPacket], Acc ++
Body = exmpp_xml:document_to_list( [exmpp_xml:document_to_list(
#xmlel{name = 'body', check_default_xmlns(El)
ns = ?NS_HTTP_BIND_s, )];
children = TypedEls}), ({xmlstreamraw, R}, Acc) ->
% {xmlelement,"body", Acc ++ [R]
% [{"xmlns", end,
% ?NS_HTTP_BIND_s}], [],
% TypedEls}), OutPacket),
Body = "<body xmlns='"++?NS_HTTP_BIND_s++"'>"
++ TypedEls ++
"</body>",
?DEBUG(" --- outgoing data --- ~n~s~n --- END --- ~n", ?DEBUG(" --- outgoing data --- ~n~s~n --- END --- ~n",
[Body]), [Body]),
{200, ?HEADER, Body}; {200, ?HEADER, Body};
@ -1345,7 +1351,9 @@ check_default_xmlns(#xmlel{name = Name, ns = Xmlns, attrs = Attrs, children = El
"" -> #xmlel{name = Name, ns = ?NS_JABBER_CLIENT_s, attrs = Attrs, children = Els}; "" -> #xmlel{name = Name, ns = ?NS_JABBER_CLIENT_s, attrs = Attrs, children = Els};
% "" -> {xmlelement, Name, [{"xmlns", ?NS_JABBER_CLIENT_s} | Attrs], Els}; % "" -> {xmlelement, Name, [{"xmlns", ?NS_JABBER_CLIENT_s} | Attrs], Els};
_ -> El _ -> El
end. end;
check_default_xmlns(El) ->
El.
%% Check that mod_http_bind has been defined in config file. %% Check that mod_http_bind has been defined in config file.
%% Print a warning in log file if this is not the case. %% Print a warning in log file if this is not the case.

View File

@ -215,7 +215,7 @@ form_new_get(Host, Lang) ->
?BR, ?BR,
?XE('ul', [ ?XE('ul', [
?XCT('li', "This is case insensitive: macbeth is the same that MacBeth and Macbeth."), ?XCT('li', "This is case insensitive: macbeth is the same that MacBeth and Macbeth."),
?XCT('li', "Characters not allowed: @ : ' \" < > &") ?XC('li', ?T("Characters not allowed:") ++ " \" & ' / : < > @ ")
]) ])
]), ]),
?XE('li', [ ?XE('li', [