aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_bosh.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-08-11 20:15:54 +0100
committerMatthew Wild <mwild1@gmail.com>2009-08-11 20:15:54 +0100
commit041a1ee3969b85b122238b994b9ef6da1e449646 (patch)
treebe070da4736e6385d6ae84ddfb61d975fb5eb776 /plugins/mod_bosh.lua
parentfdf0b9db40067f3bfd2dc2be5609875d5173bcc7 (diff)
downloadprosody-041a1ee3969b85b122238b994b9ef6da1e449646.tar.gz
prosody-041a1ee3969b85b122238b994b9ef6da1e449646.zip
mod_bosh: Calculate rid difference just once
Diffstat (limited to 'plugins/mod_bosh.lua')
-rw-r--r--plugins/mod_bosh.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index d8eb94e7..fae7dc93 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -208,16 +208,16 @@ function stream_callbacks.streamopened(request, attr)
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