aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-12-03 17:07:37 +0100
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-12-03 17:07:37 +0100
commit29fce4bb4be957f20c2c733b86c2fb8771fe1f70 (patch)
treed1741defe34dde8c331d3e2ef326bd4476ba348f
parent339c16a46f550c3b08350bfb1c4879f7f5e8a379 (diff)
downloadprosody-29fce4bb4be957f20c2c733b86c2fb8771fe1f70.tar.gz
prosody-29fce4bb4be957f20c2c733b86c2fb8771fe1f70.zip
mod_proxy65: Don't read data from the connection untill the proxying is activated
-rw-r--r--plugins/mod_proxy65.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_proxy65.lua b/plugins/mod_proxy65.lua
index ab9eda57..af618c01 100644
--- a/plugins/mod_proxy65.lua
+++ b/plugins/mod_proxy65.lua
@@ -88,6 +88,7 @@ function connlistener.onincoming(conn, data)
throttle_sending(transfers[sha].target, conn);
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:lock_read(true)
else
module:log("warn", "Neither data transfer nor initial connect of a participator of a transfer.")
conn.close();
@@ -243,6 +244,8 @@ function handle_to_domain(origin, stanza)
elseif(transfers[sha] ~= nil and transfers[sha].initiator ~= nil and transfers[sha].target ~= nil) then
origin.send(reply);
transfers[sha].activated = true;
+ transfers[sha].target:lock_read(false);
+ transfers[sha].initiator:lock_read(false);
end
else
module:log("error", "activation failed: sid: %s, initiator: %s, target: %s", tostring(sid), tostring(from), tostring(to));