aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-23 22:19:29 +0200
committerKim Alvefur <zash@zash.se>2020-08-23 22:19:29 +0200
commit2238804d7aece8e7a64e03f822b5106f932ea683 (patch)
tree1be37e18b6983b550658963c43a7b6ad752bc8a7
parentb6e1f9feb9e17f0c430683318b475aa806058955 (diff)
downloadprosody-2238804d7aece8e7a64e03f822b5106f932ea683.tar.gz
prosody-2238804d7aece8e7a64e03f822b5106f932ea683.zip
net.server_select: Fix traceback (thanks eta)
The `socket` here is unreferenced on disconnect. Calling :resume_writes after that causes an error when `addsocket()` tries to use it as a table index.
-rw-r--r--net/server_select.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index a2515d59..09c1c027 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -511,7 +511,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
end
handler.resume_writes = function (self)
nosend = false
- if bufferlen > 0 then
+ if bufferlen > 0 and socket then
_sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
end
end