From 3c88f71ca098b1cf2a572a7abf8e41bef8493ba7 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 27 Mar 2017 03:41:24 +0200 Subject: net.server_epoll: Check write buffer for remaining data to write when closing --- net/server_epoll.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/server_epoll.lua') diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 38620a21..3bb92d14 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -384,7 +384,7 @@ interface.send = interface.write; -- Close, possibly after writing is done function interface:close() - if self._wantwrite then + if self.writebuffer and self.writebuffer[1] 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)); -- cgit v1.2.3