aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-05-02 19:20:29 +0200
committerKim Alvefur <zash@zash.se>2018-05-02 19:20:29 +0200
commit14009b5cbdd87033281dea9925ce3173f87a0610 (patch)
tree994b762add21e8950da2b38656529f38e1312208
parent5cb2160a0bf9ac45cb57e3a8d1c1ae5ea56e95c1 (diff)
downloadprosody-14009b5cbdd87033281dea9925ce3173f87a0610.tar.gz
prosody-14009b5cbdd87033281dea9925ce3173f87a0610.zip
net.server_epoll: Handle connection being closed and destroyed in onconnect callback
-rw-r--r--net/server_epoll.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index b62bad83..e9d37426 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -336,6 +336,7 @@ end
-- Called when socket is writable
function interface:onwritable()
self:onconnect();
+ if not self.conn then return; end -- could have been closed in onconnect
local buffer = self.writebuffer;
local data = t_concat(buffer);
local ok, err, partial = self.conn:send(data);