mod_bosh: Fix to properly ignore repeated requests
authorMatthew Wild <mwild1@gmail.com>
Sat, 7 Aug 2010 18:00:04 +0000 (19:00 +0100)
committerMatthew Wild <mwild1@gmail.com>
Sat, 7 Aug 2010 18:00:04 +0000 (19:00 +0100)
plugins/mod_bosh.lua

index 1d4d8096fdf8476a9202b8cacfa639ea754e2b23..2b95659c0ac51a9bc9eb5c2d6b470c152006867e 100644 (file)
@@ -288,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;
@@ -316,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