From 041a1ee3969b85b122238b994b9ef6da1e449646 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 11 Aug 2009 20:15:54 +0100 Subject: mod_bosh: Calculate rid difference just once --- plugins/mod_bosh.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3