aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/server_event.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index bc1cc094..42b757d4 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -105,9 +105,13 @@ function interface_mt:_start_connection(plainssl) -- called from wrapclient
self:ontimeout() -- call timeout listener
self:_close()
debug( "new connection failed. id:", self.id, "error:", self.fatalerror )
- elseif EV_READWRITE == event then
- self.readcallback(event);
else
+ if EV_READWRITE == event then
+ if self.readcallback(event) == -1 then
+ -- Fatal error occurred
+ return -1;
+ end
+ end
if plainssl and has_luasec then -- start ssl session
self:starttls(self._sslctx, true)
else -- normal connection