Diff

mod_onions/mod_onions.lua @ 1299:a7d6c6d2c7b5

mod_onions: Accepted patch that should fix problems when using libevent.
author Thijs Alkemade <me@thijsalkema.de>
date Tue, 04 Feb 2014 12:48:33 +0100
parent 1071:8f59b45fe6a7
child 1343:7dbde05b48a9
line wrap: on
line diff
--- a/mod_onions/mod_onions.lua	Mon Feb 03 22:17:40 2014 +0100
+++ b/mod_onions/mod_onions.lua	Tue Feb 04 12:48:33 2014 +0100
@@ -92,7 +92,7 @@
 			if t then
 				t = filter("bytes/out", tostring(t));
 				if t then
-					return w(conn, tostring(t));
+					return conn:write(tostring(t));
 				end
 			end
 		end
@@ -136,8 +136,8 @@
 	module:log("debug", "Sending connect message.");
 
 	-- version 5, connect, (reserved), type: domainname, (length, hostname), port
-	conn:send(c(5) .. c(1) .. c(0) .. c(3) .. c(#session.socks5_to) .. session.socks5_to);
-	conn:send(c(rshift(session.socks5_port, 8)) .. c(band(session.socks5_port, 0xff)));
+	conn:write(c(5) .. c(1) .. c(0) .. c(3) .. c(#session.socks5_to) .. session.socks5_to);
+	conn:write(c(rshift(session.socks5_port, 8)) .. c(band(session.socks5_port, 0xff)));
 
 	session.socks5_handler = socks5_connect_sent;
 end
@@ -146,7 +146,7 @@
 	module:log("debug", "Connected to SOCKS5 proxy, sending SOCKS5 handshake.");
 
 	-- Socks version 5, 1 method, no auth
-	conn:send(c(5) .. c(1) .. c(0));
+	conn:write(c(5) .. c(1) .. c(0));
 	
 	sessions[conn].socks5_handler = socks5_handshake_sent;
 end