]> granicus.if.org Git - ejabberd/commitdiff
Use 'to' field only in the first client stream initialization
authorAlexey Shchepin <alexey@process-one.net>
Mon, 20 Jan 2014 14:06:05 +0000 (16:06 +0200)
committerAlexey Shchepin <alexey@process-one.net>
Mon, 20 Jan 2014 14:06:05 +0000 (16:06 +0200)
src/ejabberd_c2s.erl

index e5304044a4bd94cadece0cfd7f6783a5e043fa94..5a02f98bd10e1105a5ce51eb2caef53b6d7cf99f 100644 (file)
@@ -291,7 +291,12 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
     DefaultLang = ?MYLANG,
     case xml:get_attr_s(<<"xmlns:stream">>, Attrs) of
        ?NS_STREAM ->
-           Server = jlib:nameprep(xml:get_attr_s(<<"to">>, Attrs)),
+            Server =
+                case StateData#state.server of
+                    undefined ->
+                        jlib:nameprep(xml:get_attr_s(<<"to">>, Attrs));
+                    S -> S
+                end,
            case lists:member(Server, ?MYHOSTS) of
                true ->
                    Lang = case xml:get_attr_s(<<"xml:lang">>, Attrs) of