From 421f71c745a594b1e832075f856a328149cc8e84 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 22 Nov 2016 15:28:24 +0100 Subject: net.server_select: Prevent writes after a handler is closed (fixes #783 I hope) --- net/server_select.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'net/server_select.lua') diff --git a/net/server_select.lua b/net/server_select.lua index c50a6ce1..39640a83 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -415,6 +415,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport 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 -- cgit v1.2.3