aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_event.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-11-22 04:04:04 +0000
committerMatthew Wild <mwild1@gmail.com>2009-11-22 04:04:04 +0000
commit3fe8e5575403a0e9a06923dfcf62773c40cd1ec3 (patch)
treee71326532cdcbdee2ddaab65a7276a9718e573a7 /net/server_event.lua
parent4d67d89061c92629e6e942ab2851482cc077ad7d (diff)
downloadprosody-3fe8e5575403a0e9a06923dfcf62773c40cd1ec3.tar.gz
prosody-3fe8e5575403a0e9a06923dfcf62773c40cd1ec3.zip
net.server_event: Obey nowriting/nointerface for locks in interface methods
Diffstat (limited to 'net/server_event.lua')
-rw-r--r--net/server_event.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index 75c146eb..e4653cb1 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -290,6 +290,7 @@ do
-- Public methods
function interface_mt:write(data)
+ if self.nowriting then return nil, "locked" end
vdebug( "try to send data to client, id/data:", self.id, data )
data = tostring( data )
local len = string_len( data )
@@ -308,6 +309,7 @@ do
return true
end
function interface_mt:close(now)
+ if self.nointerface then return nil, "locked"; end
debug( "try to close client connection with id:", self.id )
if self.type == "client" then
self.fatalerror = "client to close"