# HG changeset patch # User Kim Alvefur # Date 1525281629 -7200 # Node ID e7d4344e0fea81e73c1a93e7f57157eef6b94672 # Parent ae7cf011e46a136660cff8e178ed5972eba2c513 net.server_epoll: Handle connection being closed and destroyed in onconnect callback diff -r ae7cf011e46a -r e7d4344e0fea net/server_epoll.lua --- 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);