From 3356d3073c8e195a4e73a3d4611ade434b461dc4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 24 Feb 2018 14:36:44 +0100 Subject: net.server_epoll: Remove special casing for having sent an empty write buffer because the wantwrite flag must be unset regardless --- net/server_epoll.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'net') diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 8e884ac2..93a7a1a9 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -338,14 +338,12 @@ function interface:onwriteable() local data = t_concat(buffer); local ok, err, partial = self.conn:send(data); if ok then - if data ~= "" then - for i = #buffer, 1, -1 do - buffer[i] = nil; - end - self:setflags(nil, false); - self:setwritetimeout(false); - self:ondrain(); -- Be aware of writes in ondrain + self:setflags(nil, false); + for i = #buffer, 1, -1 do + buffer[i] = nil; end + self:setwritetimeout(false); + self:ondrain(); -- Be aware of writes in ondrain self:onconnect(); return; elseif partial then -- cgit v1.2.3