aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-02-24 14:36:44 +0100
committerKim Alvefur <zash@zash.se>2018-02-24 14:36:44 +0100
commit3356d3073c8e195a4e73a3d4611ade434b461dc4 (patch)
treeb865833ab1de948a98aa13a2e02b5b5481d63c91 /net
parent20b0b2268965e6260dd4f7ade4a0904d5eb11207 (diff)
downloadprosody-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
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua12
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