From 2a611f95554e7fda6164dfea5bbbc349431c2f66 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 2 Mar 2016 16:30:05 +0100 Subject: net.server_event: Prevent resuming connections without readcallback, eg closed connections (fixes #590) --- net/server_event.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/server_event.lua') diff --git a/net/server_event.lua b/net/server_event.lua index 45938a13..a60de08e 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -289,7 +289,7 @@ do function interface_mt:resume() self:_lock(self.nointerface, false, self.nowriting); - if not self.eventread then + if self.readcallback and not self.eventread then self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT ); -- register callback end end -- cgit v1.2.3 From 170dbb45cc3604f3402ce700e2c9b4a249f961ab Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 2 Mar 2016 16:30:46 +0100 Subject: net.server_event: Return true from conn:resume() to indicate success --- net/server_event.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'net/server_event.lua') diff --git a/net/server_event.lua b/net/server_event.lua index a60de08e..d505825d 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -291,6 +291,7 @@ do self:_lock(self.nointerface, false, self.nowriting); if self.readcallback and not self.eventread then self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT ); -- register callback + return true; end end -- cgit v1.2.3