mod_console: Add host:* commands to help (thanks Zash)
[prosody.git] / plugins / mod_bosh.lua
index b59dfd7871fa13eecb364ffddb3f913a8a4d9f62..2b95659c0ac51a9bc9eb5c2d6b470c152006867e 100644 (file)
@@ -25,7 +25,9 @@ local log = logger.init("mod_bosh");
 local xmlns_streams = "http://etherx.jabber.org/streams";
 local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
 local xmlns_bosh = "http://jabber.org/protocol/httpbind"; -- (hard-coded into a literal in session.send)
-local stream_callbacks = { stream_ns = "http://jabber.org/protocol/httpbind", stream_tag = "body", default_ns = "jabber:client" };
+
+local stream_callbacks = {
+       stream_ns = xmlns_bosh, stream_tag = "body", default_ns = "jabber:client" };
 
 local BOSH_DEFAULT_HOLD = tonumber(module:get_option("bosh_default_hold")) or 1;
 local BOSH_DEFAULT_INACTIVITY = tonumber(module:get_option("bosh_max_inactivity")) or 60;
@@ -286,6 +288,7 @@ function stream_callbacks.streamopened(request, attr)
                        -- Repeated, ignore
                        session.log("debug", "rid repeated (on request %s), ignoring: %s (diff %d)", request.id, session.rid, diff);
                        request.notopen = nil;
+                       request.ignore = true;
                        request.sid = sid;
                        t_insert(session.requests, request);
                        return;
@@ -314,6 +317,7 @@ function stream_callbacks.streamopened(request, attr)
 end
 
 function stream_callbacks.handlestanza(request, stanza)
+       if request.ignore then return; end
        log("debug", "BOSH stanza received: %s\n", stanza:top_tag());
        local session = sessions[request.sid];
        if session then