Software /
code /
prosody
Diff
plugins/mod_bosh.lua @ 1664:6587b6c2678e
mod_bosh: Calculate rid difference just once
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 11 Aug 2009 20:15:54 +0100 |
parent | 1663:b30c4d0bbe84 |
child | 1665:2c72b725384e |
line wrap: on
line diff
--- 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