# HG changeset patch # User Matthew Wild # Date 1250018154 -3600 # Node ID 6587b6c2678e544e662acef555d5cdba8b216048 # Parent b30c4d0bbe84f40afadd4f118db795dfde312acd mod_bosh: Calculate rid difference just once diff -r b30c4d0bbe84 -r 6587b6c2678e plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Tue Aug 11 19:52:09 2009 +0100 +++ b/plugins/mod_bosh.lua Tue Aug 11 20:15:54 2009 +0100 @@ -208,16 +208,16 @@ if session.rid then local rid = tonumber(attr.rid); - if rid - session.rid > 1 then + local diff = rid - session.rid; + if diff > 1 then session.log("warn", "rid too large (means a request was lost). Last rid: %d New rid: %s", session.rid, attr.rid); - elseif session.rid >= rid then + elseif diff <= 0 then -- Repeated, ignore session.log("debug", "rid repeated (on request %s), ignoring: %d", request.id, session.rid); request.notopen = nil; t_insert(session.requests, request); return; end - request.rid = rid; session.rid = rid; end