]> granicus.if.org Git - ejabberd/commitdiff
Retract from previous commit the code that checked the connection is attempted to...
authorBadlop <badlop@process-one.net>
Sat, 9 Aug 2008 20:09:37 +0000 (20:09 +0000)
committerBadlop <badlop@process-one.net>
Sat, 9 Aug 2008 20:09:37 +0000 (20:09 +0000)
SVN Revision: 1517

ChangeLog
src/ejabberd_service.erl

index afd8fbde871635a03af958097ce3745d7b193bf2..517ec43ad2b1570ef139fc422c892f495466c470 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,8 @@
 2008-08-09  Badlop  <badlop@process-one.net>
 
        * src/ejabberd_service.erl: Fix XEP-0114 compliance: define xmlns
-       in header of error response; check the connection is attempted to
-       a served component; include in response the JID of served
-       component not server (thanks to Sergei Golovan)
+       in header of error response; include in response the JID of served
+       component not server (thanks to Sergei Golovan)(EJAB-717)
 
 2008-08-01  Badlop  <badlop@process-one.net>
 
index d7216fc6e50b4b3aea2b9e1fc07cf720f58c9a11..66025fce7081e6aafffe2b1f01358844e3090db9 100644 (file)
        "</stream:stream>"
        ).
 
--define(HOST_UNKNOWN_ERR,
-       "<stream:stream "
-       "xmlns:stream='http://etherx.jabber.org/streams'>"
-       "<stream:error>Host Unknown</stream:error>"
-       "</stream:stream>"
-       ).
-
 -define(INVALID_HANDSHAKE_ERR,
        "<stream:error>Invalid Handshake</stream:error>"
        "</stream:stream>"
@@ -178,19 +171,15 @@ init([{SockMod, Socket}, Opts]) ->
 wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
     case xml:get_attr_s("xmlns", Attrs) of
        "jabber:component:accept" ->
-           %% Check that destination is a served component
+           %% Note: XEP-0114 requires to check that destination is a Jabber
+           %% component served by this Jabber server.
+           %% However several transports don't respect that,
+           %% so ejabberd doesn't check 'to' attribute (EJAB-717)
            To = xml:get_attr_s("to", Attrs),
-           case lists:member(To, StateData#state.hosts) of
-               true ->
-                   Header = io_lib:format(?STREAM_HEADER,
-                                          [StateData#state.streamid,
-                                           xml:crypt(To)]),
-                   send_text(StateData, Header),
-                   {next_state, wait_for_handshake, StateData};
-               _ ->
-                   send_text(StateData, ?HOST_UNKNOWN_ERR),
-                   {stop, normal, StateData}
-           end;
+           Header = io_lib:format(?STREAM_HEADER,
+                                  [StateData#state.streamid, xml:crypt(To)]),
+           send_text(StateData, Header),
+           {next_state, wait_for_handshake, StateData};
        _ ->
            send_text(StateData, ?INVALID_HEADER_ERR),
            {stop, normal, StateData}