aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-16 14:53:29 +0200
committerKim Alvefur <zash@zash.se>2016-08-16 14:53:29 +0200
commit488ff1ca2cb7d097d9d7b279bec69868edeef320 (patch)
tree92dadc8db6a5388938aeeb5c5803f69d6b9905e7
parent67d21bbcf30ed04c65bdf575dc85056fc8fd57c4 (diff)
downloadprosody-488ff1ca2cb7d097d9d7b279bec69868edeef320.tar.gz
prosody-488ff1ca2cb7d097d9d7b279bec69868edeef320.zip
net.server_epoll: Clear write flag before calling ondrain, fixes calling of ondisconnect on explicit close
-rw-r--r--net/server_epoll.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index fa79837d..f73b1a8c 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -250,13 +250,9 @@ function interface:onwriteable()
for i = #buffer, 1, -1 do
buffer[i] = nil;
end
- self:ondrain();
- if not buffer[1] then
- self:setflags(nil, false);
- self:setwritetimeout(false);
- else
- self:setwritetimeout();
- end
+ self:setflags(nil, false);
+ self:setwritetimeout(false);
+ self:ondrain(); -- Be aware of writes in ondrain
elseif partial then
buffer[1] = data:sub(partial+1)
for i = #buffer, 2, -1 do