# HG changeset patch # User Kim Alvefur # Date 1479824904 -3600 # Node ID 5a07fe977002e398f90539b626e72fcefe02b92b # Parent 003ee2be26358233095c2b74228efb79f639aff1 net.server_select: Prevent writes after a handler is closed (fixes #783 I hope) diff -r 003ee2be2635 -r 5a07fe977002 net/server_select.lua --- a/net/server_select.lua Thu Nov 03 23:51:40 2016 +0100 +++ b/net/server_select.lua Tue Nov 22 15:28:24 2016 +0100 @@ -415,6 +415,7 @@ end handler.port = handler.clientport -- COMPAT server_event local write = function( self, data ) + if not handler then return false end bufferlen = bufferlen + #data if bufferlen > maxsendlen then _closelist[ handler ] = "send buffer exceeded" -- cannot close the client at the moment, have to wait to the end of the cycle