aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-11-22 04:43:46 +0000
committerMatthew Wild <mwild1@gmail.com>2009-11-22 04:43:46 +0000
commit31dd61128403f0af9e2482856ec95d18c85f79d5 (patch)
tree9f28e7a5e208f1b595a7c25f7253003e7f2a4ee8
parent8f2a8c9c0935ad80f10308838667295cbedcf080 (diff)
downloadprosody-31dd61128403f0af9e2482856ec95d18c85f79d5.tar.gz
prosody-31dd61128403f0af9e2482856ec95d18c85f79d5.zip
*_listener: Update for new net.server API, specifically .listener -> .onincoming, .disconnect -> .ondisconnect
-rw-r--r--net/httpclient_listener.lua4
-rw-r--r--net/httpserver_listener.lua4
-rw-r--r--net/xmppclient_listener.lua4
-rw-r--r--net/xmppcomponent_listener.lua6
-rw-r--r--net/xmppserver_listener.lua6
5 files changed, 12 insertions, 12 deletions
diff --git a/net/httpclient_listener.lua b/net/httpclient_listener.lua
index 69b7946b..6517de44 100644
--- a/net/httpclient_listener.lua
+++ b/net/httpclient_listener.lua
@@ -15,7 +15,7 @@ local buffers = {}; -- Buffers of partial lines
local httpclient = { default_port = 80, default_mode = "*a" };
-function httpclient.listener(conn, data)
+function httpclient.onincoming(conn, data)
local request = requests[conn];
if not request then
@@ -28,7 +28,7 @@ function httpclient.listener(conn, data)
end
end
-function httpclient.disconnect(conn, err)
+function httpclient.ondisconnect(conn, err)
local request = requests[conn];
if request then
request:reader(nil);
diff --git a/net/httpserver_listener.lua b/net/httpserver_listener.lua
index 455191fb..5a261a43 100644
--- a/net/httpserver_listener.lua
+++ b/net/httpserver_listener.lua
@@ -16,7 +16,7 @@ local requests = {}; -- Open requests
local httpserver = { default_port = 80, default_mode = "*a" };
-function httpserver.listener(conn, data)
+function httpserver.onincoming(conn, data)
local request = requests[conn];
if not request then
@@ -34,7 +34,7 @@ function httpserver.listener(conn, data)
end
end
-function httpserver.disconnect(conn, err)
+function httpserver.ondisconnect(conn, err)
local request = requests[conn];
if request and not request.destroyed then
request.conn = nil;
diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua
index 34438f3d..fc0dce2c 100644
--- a/net/xmppclient_listener.lua
+++ b/net/xmppclient_listener.lua
@@ -101,7 +101,7 @@ local function session_close(session, reason)
end
session.send("</stream:stream>");
session.conn:close();
- xmppclient.disconnect(session.conn, (reason and (reason.text or reason.condition)) or reason or "session closed");
+ xmppclient.ondisconnect(session.conn, (reason and (reason.text or reason.condition)) or reason or "session closed");
end
end
@@ -133,7 +133,7 @@ function xmppclient.onincoming(conn, data)
end
end
-function xmppclient.disconnect(conn, err)
+function xmppclient.ondisconnect(conn, err)
local session = sessions[conn];
if session then
(session.log or log)("info", "Client disconnected: %s", err);
diff --git a/net/xmppcomponent_listener.lua b/net/xmppcomponent_listener.lua
index c16f41a0..b353b1b3 100644
--- a/net/xmppcomponent_listener.lua
+++ b/net/xmppcomponent_listener.lua
@@ -118,12 +118,12 @@ local function session_close(session, reason)
end
session.send("</stream:stream>");
session.conn.close();
- component_listener.disconnect(session.conn, "stream error");
+ component_listener.ondisconnect(session.conn, "stream error");
end
end
--- Component connlistener
-function component_listener.listener(conn, data)
+function component_listener.onincoming(conn, data)
local session = sessions[conn];
if not session then
local _send = conn.write;
@@ -157,7 +157,7 @@ function component_listener.listener(conn, data)
end
end
-function component_listener.disconnect(conn, err)
+function component_listener.ondisconnect(conn, err)
local session = sessions[conn];
if session then
(session.log or log)("info", "component disconnected: %s (%s)", tostring(session.host), tostring(err));
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index c7e02ec5..797ef183 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -104,14 +104,14 @@ local function session_close(session, reason)
session.conn.close(true); -- Force FIXME: timer?
end
session.conn.close();
- xmppserver.disconnect(session.conn, "stream error");
+ xmppserver.ondisconnect(session.conn, "stream error");
end
end
-- End of session methods --
-function xmppserver.listener(conn, data)
+function xmppserver.onincoming(conn, data)
local session = sessions[conn];
if not session then
session = s2s_new_incoming(conn);
@@ -148,7 +148,7 @@ function xmppserver.status(conn, status)
end
end
-function xmppserver.disconnect(conn, err)
+function xmppserver.ondisconnect(conn, err)
local session = sessions[conn];
if session then
if err and err ~= "closed" and session.srv_hosts then