net.server_event: Allow writing into buffer of write-locked connections

Check for 'nointerface' flag instead, whatever that means.
This commit is contained in:
Kim Alvefur 2019-03-24 19:07:39 +01:00
parent 3a1498ebd3
commit 20eaa5d17b

View file

@ -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