279 wait = math_min(wait, bosh_max_wait); |
279 wait = math_min(wait, bosh_max_wait); |
280 |
280 |
281 -- New session |
281 -- New session |
282 sid = new_uuid(); |
282 sid = new_uuid(); |
283 local session = { |
283 local session = { |
284 type = "c2s_unauthed", conn = request.conn, sid = sid, rid = rid, host = attr.to, |
284 type = "c2s_unauthed", conn = request.conn, sid = sid, rid = rid, host = to_host, |
285 bosh_version = attr.ver, bosh_wait = wait, streamid = sid, |
285 bosh_version = attr.ver, bosh_wait = wait, streamid = sid, |
286 bosh_max_inactive = bosh_max_inactivity, |
286 bosh_max_inactive = bosh_max_inactivity, |
287 requests = { }, send_buffer = {}, reset_stream = bosh_reset_stream, |
287 requests = { }, send_buffer = {}, reset_stream = bosh_reset_stream, |
288 close = bosh_close_stream, dispatch_stanza = core_process_stanza, notopen = true, |
288 close = bosh_close_stream, dispatch_stanza = core_process_stanza, notopen = true, |
289 log = logger.init("bosh"..sid), secure = consider_bosh_secure or request.secure, |
289 log = logger.init("bosh"..sid), secure = consider_bosh_secure or request.secure, |