25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +01:00

* src/ejabberd_c2s.erl: Bugfix: added a missing catch and fixed

the error code used on unknown namespace.
* src/ejabberd_s2s_out.erl: Improved s2s connection negociation
(dialback namespace usage) when using tls.
* src/ejabberd_sm.erl: Fixed the error code used on unknown
namespace.
* src/mod_register.erl: ejabberd now sends iq result and stream
end on user remove.

SVN Revision: 590
This commit is contained in:
Mickaël Rémond 2006-07-28 16:18:50 +00:00
parent e965aae60a
commit 9b8dcac5a7
5 changed files with 35 additions and 14 deletions

View File

@ -1,3 +1,13 @@
2006-07-28 Mickael Remond <mickael.remond@process-one.net>
* src/ejabberd_c2s.erl: Bugfix: added a missing catch and fixed the
error code used on unknown namespace.
* src/ejabberd_s2s_out.erl: Improved s2s connection negociation
(dialback namespace usage) when using tls.
* src/ejabberd_sm.erl: Fixed the error code used on unknown namespace.
* src/mod_register.erl: ejabberd now sends iq result and stream end on
user remove.
2006-07-16 Mickael Remond <mickael.remond@process-one.net>
* src/acl.erl: The server does not crash anymore on wrong acl rule. Add

View File

@ -1109,6 +1109,7 @@ handle_info({route, From, To, Packet}, StateName, StateData) ->
end,
if
Pass == exit ->
catch send_text(StateData, ?STREAM_TRAILER),
{stop, normal, StateData};
Pass ->
Attrs2 = jlib:replace_from_to_attrs(jlib:jid_to_string(From),
@ -1768,7 +1769,7 @@ process_unauthenticated_stanza(StateData, El) ->
% The only reasonable IQ's here are auth and register IQ's
% They contain secrets, so don't include subelements to response
ResIQ = IQ#iq{type = error,
sub_el = [?ERR_FEATURE_NOT_IMPLEMENTED]},
sub_el = [?ERR_SERVICE_UNAVAILABLE]},
Res1 = jlib:replace_from_to(
jlib:make_jid("", StateData#state.server, ""),
jlib:make_jid("", "", ""),

View File

@ -8,7 +8,6 @@
-module(ejabberd_s2s_out).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-behaviour(gen_fsm).
@ -46,6 +45,7 @@
tls_enabled = false,
tls_options = [],
authenticated = false,
db_enabled = true,
try_auth = true,
myname, server, queue,
new = false, verify = false,
@ -224,12 +224,7 @@ wait_for_stream({xmlstreamstart, Name, Attrs}, StateData) ->
StateData#state.use_v10 ->
{next_state, wait_for_features, StateData};
{"jabber:server", "", true} when StateData#state.use_v10 ->
?INFO_MSG("restarted: ~p", [{StateData#state.myname,
StateData#state.server}]),
% TODO: clear message queue
ejabberd_receiver:close(StateData#state.receiver),
{next_state, reopen_socket, StateData#state{socket = undefined,
use_v10 = false}};
{next_state, wait_for_features, StateData#state{db_enabled = false}};
_ ->
send_text(StateData, ?INVALID_NAMESPACE_ERR),
{stop, normal, StateData}
@ -372,8 +367,15 @@ wait_for_features({xmlstreamelement, El}, StateData) ->
{next_state, reopen_socket,
StateData#state{socket = undefined,
use_v10 = false}};
StateData#state.db_enabled ->
send_db_request(StateData);
true ->
send_db_request(StateData)
?INFO_MSG("restarted: ~p", [{StateData#state.myname,
StateData#state.server}]),
% TODO: clear message queue
ejabberd_receiver:close(StateData#state.receiver),
{next_state, reopen_socket, StateData#state{socket = undefined,
use_v10 = false}}
end;
_ ->
send_text(StateData,

View File

@ -555,7 +555,7 @@ process_iq(From, To, Packet) ->
From, To, IQ);
[] ->
Err = jlib:make_error_reply(
Packet, ?ERR_FEATURE_NOT_IMPLEMENTED),
Packet, ?ERR_SERVICE_UNAVAILABLE),
ejabberd_router:route(To, From, Err)
end;
reply ->

View File

@ -8,7 +8,6 @@
-module(mod_register).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-behaviour(gen_mod).
@ -59,7 +58,7 @@ unauthenticated_iq_register(Acc, _Server, _IQ) ->
Acc.
process_iq(From, To,
#iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
#iq{type = Type, lang = Lang, sub_el = SubEl, id = ID} = IQ) ->
case Type of
set ->
UTag = xml:get_subtag(SubEl, "username"),
@ -104,9 +103,18 @@ process_iq(From, To,
end;
(UTag == false) and (RTag /= false) ->
case From of
#jid{user = User, lserver = Server} ->
#jid{user = User,
lserver = Server,
resource = Resource} ->
ResIQ = #iq{type = result, xmlns = ?NS_REGISTER,
id = ID,
sub_el = [SubEl]},
ejabberd_router:route(
jlib:make_jid(User, Server, Resource),
jlib:make_jid(User, Server, Resource),
jlib:iq_to_xml(ResIQ)),
ejabberd_auth:remove_user(User, Server),
IQ#iq{type = result, sub_el = [SubEl]};
ignore;
_ ->
IQ#iq{type = error,
sub_el = [SubEl, ?ERR_NOT_ALLOWED]}