aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-24 19:07:39 +0100
committerKim Alvefur <zash@zash.se>2019-03-24 19:07:39 +0100
commit20eaa5d17bcff2a0f861b48f23ec3b3d4290f583 (patch)
tree3cd5239365c91eb9c5963ce1a3a45c35df8dcdcb /net
parent3a1498ebd335a15a987e3087f84089620b5507c5 (diff)
downloadprosody-20eaa5d17bcff2a0f861b48f23ec3b3d4290f583.tar.gz
prosody-20eaa5d17bcff2a0f861b48f23ec3b3d4290f583.zip
net.server_event: Allow writing into buffer of write-locked connections
Check for 'nointerface' flag instead, whatever that means.
Diffstat (limited to 'net')
-rw-r--r--net/server_event.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index 42c9af2e..fde79d86 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -304,7 +304,7 @@ end
-- Public methods
function interface_mt:write(data)
- if self.nowriting then return nil, "locked" end
+ if self.nointerface then return nil, "locked"; end
--vdebug( "try to send data to client, id/data:", self.id, data )
data = tostring( data )
local len = #data
@@ -316,7 +316,7 @@ function interface_mt:write(data)
end
t_insert(self.writebuffer, data) -- new buffer
self.writebufferlen = total
- if not self.eventwrite then -- register new write event
+ if not self.eventwrite and not self.nowriting then -- register new write event
--vdebug( "register new write event" )
self.eventwrite = addevent( base, self.conn, EV_WRITE, self.writecallback, cfg.WRITE_TIMEOUT )
end