Partially revert "Fix more HTTP-Bind", add proper fix: c2s works again, BOSH not yet

This commit is contained in:
Badlop 2010-05-10 13:56:58 +02:00
parent 3f6579ffbc
commit 110819525f
2 changed files with 12 additions and 8 deletions

View File

@ -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),

View File

@ -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});