Software /
code /
prosody
Comparison
plugins/mod_bosh.lua @ 8101:3e25d96571d1
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 20 Apr 2017 00:41:49 +0200 |
parent | 7660:d2825ddaac19 |
parent | 8097:e24263db3380 |
child | 8185:e89320b8a789 |
comparison
equal
deleted
inserted
replaced
8091:acecf1413233 | 8101:3e25d96571d1 |
---|---|
306 wait = math_min(wait, bosh_max_wait); | 306 wait = math_min(wait, bosh_max_wait); |
307 | 307 |
308 -- New session | 308 -- New session |
309 sid = new_uuid(); | 309 sid = new_uuid(); |
310 local session = { | 310 local session = { |
311 type = "c2s_unauthed", conn = {}, sid = sid, rid = rid, host = attr.to, | 311 type = "c2s_unauthed", conn = request.conn, sid = sid, rid = rid, host = attr.to, |
312 bosh_version = attr.ver, bosh_wait = wait, streamid = sid, | 312 bosh_version = attr.ver, bosh_wait = wait, streamid = sid, |
313 bosh_max_inactive = bosh_max_inactivity, | 313 bosh_max_inactive = bosh_max_inactivity, |
314 requests = { }, send_buffer = {}, reset_stream = bosh_reset_stream, | 314 requests = { }, send_buffer = {}, reset_stream = bosh_reset_stream, |
315 close = bosh_close_stream, dispatch_stanza = core_process_stanza, notopen = true, | 315 close = bosh_close_stream, dispatch_stanza = core_process_stanza, notopen = true, |
316 log = logger.init("bosh"..sid), secure = consider_bosh_secure or request.secure, | 316 log = logger.init("bosh"..sid), secure = consider_bosh_secure or request.secure, |
382 response:send(tostring(st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", condition = "item-not-found" }))); | 382 response:send(tostring(st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", condition = "item-not-found" }))); |
383 context.notopen = nil; | 383 context.notopen = nil; |
384 return; | 384 return; |
385 end | 385 end |
386 | 386 |
387 session.conn = request.conn; | |
388 | |
387 if session.rid then | 389 if session.rid then |
388 local rid = tonumber(attr.rid); | 390 local rid = tonumber(attr.rid); |
389 local diff = rid - session.rid; | 391 local diff = rid - session.rid; |
390 -- Diff should be 1 for a healthy request | 392 -- Diff should be 1 for a healthy request |
391 if diff ~= 1 then | 393 if diff ~= 1 then |