aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-11-22 15:28:24 +0100
committerKim Alvefur <zash@zash.se>2016-11-22 15:28:24 +0100
commit28ac8f61506cb86d188a95f7bd3e1e2c4d117493 (patch)
treec9948fa867685eb88382d3b5ff27fed844dcae53 /net
parentf8b911269b90918b014319cbdda32eedc687d941 (diff)
downloadprosody-28ac8f61506cb86d188a95f7bd3e1e2c4d117493.tar.gz
prosody-28ac8f61506cb86d188a95f7bd3e1e2c4d117493.zip
net.server_select: Prevent writes after a handler is closed (fixes #783 I hope)
Diffstat (limited to 'net')
-rw-r--r--net/server_select.lua1
1 files changed, 1 insertions, 0 deletions
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