Comparison

plugins/mod_bosh.lua @ 7381:a05bf94646ba

mod_bosh: Reject fractional 'wait' (See #343)
author Kim Alvefur <zash@zash.se>
date Tue, 19 Apr 2016 12:33:58 +0200
parent 7380:d24d88feed76
child 7382:c8923f882274
child 7387:addd041342bd
comparison
equal deleted inserted replaced
7380:d24d88feed76 7381:a05bf94646ba
259 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", 259 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
260 ["xmlns:stream"] = xmlns_streams, condition = "host-unknown" }); 260 ["xmlns:stream"] = xmlns_streams, condition = "host-unknown" });
261 response:send(tostring(close_reply)); 261 response:send(tostring(close_reply));
262 return; 262 return;
263 end 263 end
264 if not rid or (not wait and attr.wait or wait < 0) then 264 if not rid or (not wait and attr.wait or wait < 0 or wait % 1 ~= 0) then
265 log("debug", "BOSH client sent invalid rid or wait attributes: rid=%s, wait=%s", tostring(attr.rid), tostring(attr.wait)); 265 log("debug", "BOSH client sent invalid rid or wait attributes: rid=%s, wait=%s", tostring(attr.rid), tostring(attr.wait));
266 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", 266 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
267 ["xmlns:stream"] = xmlns_streams, condition = "bad-request" }); 267 ["xmlns:stream"] = xmlns_streams, condition = "bad-request" });
268 response:send(tostring(close_reply)); 268 response:send(tostring(close_reply));
269 return; 269 return;