mod_proxy65: Update for new net.server API, untested

Sun, 22 Nov 2009 15:06:30 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 22 Nov 2009 15:06:30 +0000
changeset 2138
8bb1a2d82896
parent 2137
c5d87a3316f8
child 2144
8e59d37a0e68

mod_proxy65: Update for new net.server API, untested

plugins/mod_proxy65.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_proxy65.lua	Sun Nov 22 14:58:09 2009 +0000
+++ b/plugins/mod_proxy65.lua	Sun Nov 22 15:06:30 2009 +0000
@@ -48,7 +48,7 @@
 			module:log("debug", "new session found ... ")
 			session.setup = true;
 			sessions[conn] = session;
-			conn.write(string.char(5, 0));
+			conn:write(string.char(5, 0));
 		end
 		return;
 	end
@@ -56,7 +56,7 @@
 		if session.sha ~= nil and transfers[session.sha] ~= nil then
 			local sha = session.sha;
 			if transfers[sha].activated == true and transfers[sha].initiator == conn and transfers[sha].target ~= nil then
-				transfers[sha].target.write(data);
+				transfers[sha].target:write(data);
 				return;
 			end
 		end
@@ -81,7 +81,7 @@
 				session.sha = sha;
 				module:log("debug", "initiator connected ... ");
 			end
-			conn.write(string.char(5, 0, 0, 3, sha:len()) .. sha .. string.char(0, 0)); -- VER, REP, RSV, ATYP, BND.ADDR (sha), BND.PORT (2 Byte)
+			conn:write(string.char(5, 0, 0, 3, sha:len()) .. sha .. string.char(0, 0)); -- VER, REP, RSV, ATYP, BND.ADDR (sha), BND.PORT (2 Byte)
 		else
 			log:module("warn", "Neither data transfer nor initial connect of a participator of a transfer.")
 			conn.close();

mercurial