From 97bb48b578078377edb640a42284b73f456be1f5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 18 Aug 2016 16:05:18 +0200 Subject: net.server_epoll: Don't call ondrain when connection is to be closed --- net/server_epoll.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/server_epoll.lua b/net/server_epoll.lua index d765f35b..b2df6188 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -307,11 +307,12 @@ function interface:onwriteable() end function interface:ondrain() - self:on("drain"); - if self._starttls then - self:starttls(); - elseif self._toclose then - self:close(); + if self._toclose then + return self:close(); + elseif self._starttls then + return self:starttls(); + else + return self:on("drain"); end end -- cgit v1.2.3