Changeset

8091:acecf1413233

net.server_epoll: Reset onwritable before calling onconnect (fixes traceback if connection closed in onconnect)
author Kim Alvefur <zash@zash.se>
date Sun, 16 Apr 2017 02:36:42 +0200
parents 8090:00d1fb300c74
children 8101:3e25d96571d1
files net/server_epoll.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Sat Apr 15 02:27:43 2017 +0200
+++ b/net/server_epoll.lua	Sun Apr 16 02:36:42 2017 +0200
@@ -533,12 +533,12 @@
 
 -- Connected!
 function interface:onconnect()
+	self.onwriteable = nil;
+	self:setflags(true, false);
 	if not self._connected then
 		self._connected = true;
 		self:on("connect");
 	end
-	self.onwriteable = nil;
-	self:setflags(true, false);
 	return self:onwriteable();
 end