aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
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
commita032613e2664784b11834ad98619486f60f9ef0a (patch)
treeb865833ab1de948a98aa13a2e02b5b5481d63c91 /net/server_epoll.lua
parent7a1cc7bc28692dec0ea8f63008681bbb1ab66348 (diff)
downloadprosody-a032613e2664784b11834ad98619486f60f9ef0a.tar.gz
prosody-a032613e2664784b11834ad98619486f60f9ef0a.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/server_epoll.lua')
-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