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:
parent
e965aae60a
commit
9b8dcac5a7
10
ChangeLog
10
ChangeLog
@ -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>
|
2006-07-16 Mickael Remond <mickael.remond@process-one.net>
|
||||||
|
|
||||||
* src/acl.erl: The server does not crash anymore on wrong acl rule. Add
|
* src/acl.erl: The server does not crash anymore on wrong acl rule. Add
|
||||||
|
@ -1109,6 +1109,7 @@ handle_info({route, From, To, Packet}, StateName, StateData) ->
|
|||||||
end,
|
end,
|
||||||
if
|
if
|
||||||
Pass == exit ->
|
Pass == exit ->
|
||||||
|
catch send_text(StateData, ?STREAM_TRAILER),
|
||||||
{stop, normal, StateData};
|
{stop, normal, StateData};
|
||||||
Pass ->
|
Pass ->
|
||||||
Attrs2 = jlib:replace_from_to_attrs(jlib:jid_to_string(From),
|
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
|
% The only reasonable IQ's here are auth and register IQ's
|
||||||
% They contain secrets, so don't include subelements to response
|
% They contain secrets, so don't include subelements to response
|
||||||
ResIQ = IQ#iq{type = error,
|
ResIQ = IQ#iq{type = error,
|
||||||
sub_el = [?ERR_FEATURE_NOT_IMPLEMENTED]},
|
sub_el = [?ERR_SERVICE_UNAVAILABLE]},
|
||||||
Res1 = jlib:replace_from_to(
|
Res1 = jlib:replace_from_to(
|
||||||
jlib:make_jid("", StateData#state.server, ""),
|
jlib:make_jid("", StateData#state.server, ""),
|
||||||
jlib:make_jid("", "", ""),
|
jlib:make_jid("", "", ""),
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
-module(ejabberd_s2s_out).
|
-module(ejabberd_s2s_out).
|
||||||
-author('alexey@sevcom.net').
|
-author('alexey@sevcom.net').
|
||||||
-vsn('$Revision$ ').
|
|
||||||
|
|
||||||
-behaviour(gen_fsm).
|
-behaviour(gen_fsm).
|
||||||
|
|
||||||
@ -46,6 +45,7 @@
|
|||||||
tls_enabled = false,
|
tls_enabled = false,
|
||||||
tls_options = [],
|
tls_options = [],
|
||||||
authenticated = false,
|
authenticated = false,
|
||||||
|
db_enabled = true,
|
||||||
try_auth = true,
|
try_auth = true,
|
||||||
myname, server, queue,
|
myname, server, queue,
|
||||||
new = false, verify = false,
|
new = false, verify = false,
|
||||||
@ -224,12 +224,7 @@ wait_for_stream({xmlstreamstart, Name, Attrs}, StateData) ->
|
|||||||
StateData#state.use_v10 ->
|
StateData#state.use_v10 ->
|
||||||
{next_state, wait_for_features, StateData};
|
{next_state, wait_for_features, StateData};
|
||||||
{"jabber:server", "", true} when StateData#state.use_v10 ->
|
{"jabber:server", "", true} when StateData#state.use_v10 ->
|
||||||
?INFO_MSG("restarted: ~p", [{StateData#state.myname,
|
{next_state, wait_for_features, StateData#state{db_enabled = false}};
|
||||||
StateData#state.server}]),
|
|
||||||
% TODO: clear message queue
|
|
||||||
ejabberd_receiver:close(StateData#state.receiver),
|
|
||||||
{next_state, reopen_socket, StateData#state{socket = undefined,
|
|
||||||
use_v10 = false}};
|
|
||||||
_ ->
|
_ ->
|
||||||
send_text(StateData, ?INVALID_NAMESPACE_ERR),
|
send_text(StateData, ?INVALID_NAMESPACE_ERR),
|
||||||
{stop, normal, StateData}
|
{stop, normal, StateData}
|
||||||
@ -372,8 +367,15 @@ wait_for_features({xmlstreamelement, El}, StateData) ->
|
|||||||
{next_state, reopen_socket,
|
{next_state, reopen_socket,
|
||||||
StateData#state{socket = undefined,
|
StateData#state{socket = undefined,
|
||||||
use_v10 = false}};
|
use_v10 = false}};
|
||||||
|
StateData#state.db_enabled ->
|
||||||
|
send_db_request(StateData);
|
||||||
true ->
|
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;
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
send_text(StateData,
|
send_text(StateData,
|
||||||
|
@ -555,7 +555,7 @@ process_iq(From, To, Packet) ->
|
|||||||
From, To, IQ);
|
From, To, IQ);
|
||||||
[] ->
|
[] ->
|
||||||
Err = jlib:make_error_reply(
|
Err = jlib:make_error_reply(
|
||||||
Packet, ?ERR_FEATURE_NOT_IMPLEMENTED),
|
Packet, ?ERR_SERVICE_UNAVAILABLE),
|
||||||
ejabberd_router:route(To, From, Err)
|
ejabberd_router:route(To, From, Err)
|
||||||
end;
|
end;
|
||||||
reply ->
|
reply ->
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
-module(mod_register).
|
-module(mod_register).
|
||||||
-author('alexey@sevcom.net').
|
-author('alexey@sevcom.net').
|
||||||
-vsn('$Revision$ ').
|
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
-behaviour(gen_mod).
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ unauthenticated_iq_register(Acc, _Server, _IQ) ->
|
|||||||
Acc.
|
Acc.
|
||||||
|
|
||||||
process_iq(From, To,
|
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
|
case Type of
|
||||||
set ->
|
set ->
|
||||||
UTag = xml:get_subtag(SubEl, "username"),
|
UTag = xml:get_subtag(SubEl, "username"),
|
||||||
@ -104,9 +103,18 @@ process_iq(From, To,
|
|||||||
end;
|
end;
|
||||||
(UTag == false) and (RTag /= false) ->
|
(UTag == false) and (RTag /= false) ->
|
||||||
case From of
|
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),
|
ejabberd_auth:remove_user(User, Server),
|
||||||
IQ#iq{type = result, sub_el = [SubEl]};
|
ignore;
|
||||||
_ ->
|
_ ->
|
||||||
IQ#iq{type = error,
|
IQ#iq{type = error,
|
||||||
sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
|
sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
|
||||||
|
Loading…
Reference in New Issue
Block a user