diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/server_epoll.lua | 12 |
1 files changed, 5 insertions, 7 deletions
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 |