+2003-09-03 Alexey Shchepin <alexey@sevcom.net>
+
+ * src/ejabberd_s2s_in.erl: Fixed "id" attribute processing
+ * src/ejabberd_s2s_out.erl: Likewise
+
+ * src/ejabberd_c2s.erl: Added sending of empty <stream:features/>
+ element after opening of authentificated stream
+
2003-09-02 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_s2s_in.erl: Temporary hack for "id" attribute
2003-07-05 Alexey Shchepin <alexey@sevcom.net>
- * src/jlib.hrl: Added pub/sub nemaspaces
+ * src/jlib.hrl: Added pub/sub namespaces
2003-07-03 Alexey Shchepin <alexey@sevcom.net>
2003-05-08 Alexey Shchepin <alexey@sevcom.net>
- * src/mod_muc/mod_muc.erl: Denied using of empty nick
+ * src/mod_muc/mod_muc.erl: Denied usage of empty nick
2003-05-07 Alexey Shchepin <alexey@sevcom.net>
backup management
S2S:
- * rewrite S2S key validation
+ rewrite S2S key validation
+ check "id" attributes in db:verify packets
more correctly work with SRV DNS records (priority, weight, etc...)
TLS
?MYNAME,
" version='1.0'"]),
send_text(StateData, Header),
- SASLState = cyrsasl:server_new("jabber", ?MYNAME, "", []),
- Mechs = lists:map(fun(S) ->
+ case StateData#state.authentificated of
+ false ->
+ SASLState =
+ cyrsasl:server_new("jabber", ?MYNAME, "", []),
+ Mechs = lists:map(
+ fun(S) ->
{xmlelement, "mechanism", [],
[{xmlcdata, S}]}
end, cyrsasl:listmech()),
- case StateData#state.authentificated of
- false ->
send_element(StateData,
{xmlelement, "stream:features", [],
[{xmlelement, "mechanisms",
{next_state, wait_for_sasl_auth,
StateData#state{sasl_state = SASLState}};
_ ->
+ send_element(
+ StateData,
+ {xmlelement, "stream:features", [], []}),
{next_state, wait_for_session, StateData}
end;
_ ->
-endif.
-define(STREAM_HEADER,
- "<?xml version='1.0'?>"
- "<stream:stream "
- "xmlns:stream='http://etherx.jabber.org/streams' "
- "xmlns='jabber:server' "
- "xmlns:db='jabber:server:dialback' "
- "id='todo'>"
+ ("<?xml version='1.0'?>"
+ "<stream:stream "
+ "xmlns:stream='http://etherx.jabber.org/streams' "
+ "xmlns='jabber:server' "
+ "xmlns:db='jabber:server:dialback' "
+ "id='" ++ StateData#state.streamid ++ "'>")
).
-define(STREAM_TRAILER, "</stream:stream>").
case lists:member(To, ejabberd_router:dirty_get_all_domains()) of
true ->
ejabberd_s2s_out:start(To, From,
- {verify, self(), Key}),
+ {verify, self(),
+ Key, StateData#state.streamid}),
{next_state,
wait_for_verification,
StateData#state{myname = To,
{New, Verify} = case Type of
{new, Key} ->
{Key, false};
- {verify, Pid, Key} ->
- {false, {Pid, Key}}
+ {verify, Pid, Key, SID} ->
+ {false, {Pid, Key, SID}}
end,
{ok, open_socket, #state{queue = queue:new(),
myname = From,
case StateData#state.verify of
false ->
ok;
- {Pid, Key2} ->
+ {Pid, Key2, SID} ->
send_element(StateData#state.socket,
{xmlelement,
"db:verify",
[{"from", StateData#state.myname},
{"to", StateData#state.server},
- {"id", "todo"}],
+ {"id", SID}],
[{xmlcdata, Key2}]})
end,
{next_state, wait_for_validation,
case StateData#state.verify of
false ->
{next_state, wait_for_validation, StateData, ?S2STIMEOUT};
- {Pid, Key} ->
+ {Pid, _Key, _SID} ->
case Type of
"valid" ->
gen_fsm:send_event(Pid, valid);
{verify, VTo, VFrom, VId, VType} ->
?INFO_MSG("recv verify: ~p", [{VFrom, VTo, VId, VType}]),
case StateData#state.verify of
- {VPid, VKey} ->
+ {VPid, _VKey, _SID} ->
case VType of
"valid" ->
gen_fsm:send_event(VPid, valid);
_ ->
ok
end,
- %{xmlelement, Name, Attrs, Els} = El,
- %From = xml:get_attr_s("from", Attrs),
- %FromJID1 = jlib:string_to_jid(From),
- %FromJID = case FromJID1 of
- % {Node, Server, Resource} ->
- % if Server == StateData#state.server -> FromJID1;
- % true -> error
- % end;
- % _ -> error
- % end,
- %To = xml:get_attr_s("to", Attrs),
- %ToJID = case To of
- % "" -> error;
- % _ -> jlib:string_to_jid(To)
- % end,
- %if ((Name == "iq") or (Name == "message") or (Name == "presence")) and
- % (ToJID /= error) and (FromJID /= error) ->
- % ejabberd_router:route(FromJID, ToJID, El);
- % true ->
- % error
- %end,
{next_state, stream_established, StateData, ?S2STIMEOUT};
stream_established({xmlstreamend, Name}, StateData) ->