aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-03-08 03:38:22 +0000
committerMatthew Wild <mwild1@gmail.com>2009-03-08 03:38:22 +0000
commitd2ebe25dc579fb0ab21e411518c50eee1fae0f99 (patch)
treedbd3f1adee49adfd2d9865f99e4a3c2b356aa5dc /net
parent61ca31c484a4ad127d9088aaf14914c3af37a26a (diff)
parent90fa7296e47fa3439f9842b6904c35dba48364e7 (diff)
downloadprosody-d2ebe25dc579fb0ab21e411518c50eee1fae0f99.tar.gz
prosody-d2ebe25dc579fb0ab21e411518c50eee1fae0f99.zip
Automated merge with http://waqas.ath.cx:8000/
Diffstat (limited to 'net')
-rw-r--r--net/adns.lua2
-rw-r--r--net/server.lua4
2 files changed, 5 insertions, 1 deletions
diff --git a/net/adns.lua b/net/adns.lua
index 200784aa..cb784d40 100644
--- a/net/adns.lua
+++ b/net/adns.lua
@@ -29,7 +29,7 @@ function new_async_socket(sock)
newconn.handler, newconn._socket = server.wrapclient(sock, "dns", 53, listener);
newconn.handler.settimeout = function () end
newconn.handler.setsockname = function (_, ...) return sock:setsockname(...); end
- newconn.handler.setpeername = function (_, ...) return sock:setpeername(...); end
+ newconn.handler.setpeername = function (_, ...) local ret = sock:setpeername(...); _.setsend(sock.send); return ret; end
newconn.handler.connect = function (_, ...) return sock:connect(...) end
newconn.handler.send = function (_, data) return _.write(data) end
return newconn.handler;
diff --git a/net/server.lua b/net/server.lua
index 361c5949..891d32db 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -386,6 +386,10 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
pattern = new or pattern
return pattern
end
+ handler.setsend = function ( newsend )
+ send = newsend or send
+ return send
+ end
handler.bufferlen = function( readlen, sendlen )
maxsendlen = sendlen or maxsendlen
maxreadlen = readlen or maxreadlen