aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-12-02 22:47:29 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-12-02 22:47:29 +0500
commit7bdedfb4f7bb033624a82bfb64c8d3e6e2541db8 (patch)
treeeb26563d8f8cc20c1da78e28035da5251abc00f3 /plugins
parent02b951a1a8295ca1a3240bdc72ab712d8b91acbf (diff)
downloadprosody-7bdedfb4f7bb033624a82bfb64c8d3e6e2541db8.tar.gz
prosody-7bdedfb4f7bb033624a82bfb64c8d3e6e2541db8.zip
mod_bosh: Use util.timer for timers instead of server.addtimer.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index 9546e653..2ea8e0a0 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -11,7 +11,6 @@ module.host = "*" -- Global module
local hosts = _G.hosts;
local lxp = require "lxp";
local init_xmlhandlers = require "core.xmlhandlers"
-local server = require "net.server";
local httpserver = require "net.httpserver";
local sm = require "core.sessionmanager";
local sm_destroy_session = sm.destroy_session;
@@ -21,6 +20,7 @@ local core_process_stanza = core_process_stanza;
local st = require "util.stanza";
local logger = require "util.logger";
local log = logger.init("mod_bosh");
+local timer = require "util.timer";
local xmlns_streams = "http://etherx.jabber.org/streams";
local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
@@ -401,13 +401,14 @@ function on_timer()
dead_sessions[i] = nil;
sm_destroy_session(session, "BOSH client silent for over "..session.bosh_max_inactive.." seconds");
end
+ return 1;
end
local function setup()
local ports = module:get_option("bosh_ports") or { 5280 };
httpserver.new_from_config(ports, handle_request, { base = "http-bind" });
- server.addtimer(on_timer);
+ timer.add_task(1, on_timer);
end
if prosody.start_time then -- already started
setup();