diff options
author | Kim Alvefur <zash@zash.se> | 2018-02-24 14:36:44 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-02-24 14:36:44 +0100 |
commit | 3356d3073c8e195a4e73a3d4611ade434b461dc4 (patch) | |
tree | b865833ab1de948a98aa13a2e02b5b5481d63c91 | |
parent | 20b0b2268965e6260dd4f7ade4a0904d5eb11207 (diff) | |
download | prosody-3356d3073c8e195a4e73a3d4611ade434b461dc4.tar.gz prosody-3356d3073c8e195a4e73a3d4611ade434b461dc4.zip |
net.server_epoll: Remove special casing for having sent an empty write buffer because the wantwrite flag must be unset regardless
-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 |