Sun, 22 Nov 2009 04:04:04 +0000
net.server_event: Obey nowriting/nointerface for locks in interface methods
net/server_event.lua | file | annotate | diff | comparison | revisions |
--- a/net/server_event.lua Sun Nov 22 03:58:37 2009 +0000 +++ b/net/server_event.lua Sun Nov 22 04:04:04 2009 +0000 @@ -290,6 +290,7 @@ -- 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 @@ 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"