Diff

net/server_epoll.lua @ 7594:5e884501a9ac

net.server_epoll: Prevent anything from happening to destroyed sockets
author Kim Alvefur <zash@zash.se>
date Thu, 18 Aug 2016 16:46:20 +0200
parent 7593:0266434d7df1
child 7595:166b2e0766a4
line wrap: on
line diff
--- a/net/server_epoll.lua	Thu Aug 18 16:41:22 2016 +0200
+++ b/net/server_epoll.lua	Thu Aug 18 16:46:20 2016 +0200
@@ -351,8 +351,14 @@
 	self:setflags(false, false);
 	self:setwritetimeout(false);
 	self:setreadtimeout(false);
+	self.onreadable = noop;
+	self.onwriteable = noop;
+	self.destroy = noop;
+	self.close = noop;
+	self.on = noop;
 	fds[self:getfd()] = nil;
-	return self.conn:close();
+	self.conn:close();
+	self.conn = nil;
 end
 
 function interface:ssl()