Software /
code /
prosody
Diff
net/server_epoll.lua @ 8776:e7d4344e0fea
net.server_epoll: Handle connection being closed and destroyed in onconnect callback
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 02 May 2018 19:20:29 +0200 |
parent | 8555:4f0f5b49bb03 |
child | 8777:2bfe963f3041 |
line wrap: on
line diff
--- a/net/server_epoll.lua Wed May 02 19:06:59 2018 +0200 +++ b/net/server_epoll.lua Wed May 02 19:20:29 2018 +0200 @@ -336,6 +336,7 @@ -- 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);