Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ejabberd_c2s.erl4
-rw-r--r--src/web/ejabberd_http_bind.erl16
2 files changed, 12 insertions, 8 deletions
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
index 1bb7dd950..195492268 100644
--- a/src/ejabberd_c2s.erl
+++ b/src/ejabberd_c2s.erl
@@ -265,8 +265,8 @@ wait_for_stream({xmlstreamstart, #xmlel{ns = NS} = Opening}, StateData) ->
end,
Header = exmpp_stream:opening_reply(Opening,
StateData#state.streamid, DefaultLang),
- case exmpp_xml:get_attribute_as_binary(Opening, 'xmlns:stream', undefined_stream_namespace) of
- ?NS_XMPP_b ->
+ case NS of
+ ?NS_XMPP ->
ServerB = exmpp_stringprep:nameprep(
exmpp_stream:get_receiving_entity(Opening)),
Server = binary_to_list(ServerB),
diff --git a/src/web/ejabberd_http_bind.erl b/src/web/ejabberd_http_bind.erl
index 7ef8538d5..e2e191607 100644
--- a/src/web/ejabberd_http_bind.erl
+++ b/src/web/ejabberd_http_bind.erl
@@ -684,17 +684,21 @@ process_http_put(#http_put{rid = Rid, attrs = Attrs, payload = Payload,
C2SPid ->
case StreamTo of
{To, ""} ->
- StreamAttrs = [#xmlattr{name = 'to', value = list_to_binary(To)},
- #xmlattr{name = 'xmlns:stream', value = ?NS_XMPP_b}],
- StreamEl = #xmlel{name = 'stream:stream', ns = ?NS_JABBER_CLIENT_b, attrs = StreamAttrs},
+ DecNs = [{?NS_XMPP, "stream"},
+ {?NS_JABBER_CLIENT, none}],
+ StreamAttrs = [#xmlattr{name = 'to', value = list_to_binary(To)}],
+ StreamEl = #xmlel{name = stream, ns = ?NS_XMPP, declared_ns = DecNs,
+ attrs = StreamAttrs},
gen_fsm:send_event(
C2SPid,
{xmlstreamstart, StreamEl});
{To, Version} ->
+ DecNs = [{?NS_XMPP, "stream"},
+ {?NS_JABBER_CLIENT, none}],
StreamAttrs = [#xmlattr{name = 'to', value = list_to_binary(To)},
- #xmlattr{name = 'version', value = list_to_binary(Version)},
- #xmlattr{name = 'xmlns:stream', value = ?NS_XMPP_b}],
- StreamEl = #xmlel{name = 'stream:stream', ns = ?NS_JABBER_CLIENT_b, attrs = StreamAttrs},
+ #xmlattr{name = 'version', value = list_to_binary(Version)}],
+ StreamEl = #xmlel{name = stream, ns = ?NS_XMPP, declared_ns = DecNs,
+ attrs = StreamAttrs},
gen_fsm:send_event(
C2SPid,
{xmlstreamstart, StreamEl});