aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/server_epoll.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 62fb9863..89f358a5 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -334,10 +334,13 @@ interface.send = interface.write;
function interface:close()
if self._wantwrite then
+ self:setflags(false, true); -- Flush final buffer contents
+ self.write, self.send = noop, noop; -- No more writing
log("debug", "Close %s after writing", tostring(self));
self._toclose = true;
else
log("debug", "Close %s now", tostring(self));
+ self.write, self.send = noop, noop;
self.close = noop;
self:on("disconnect");
self:destroy();