diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-16 14:53:29 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-16 14:53:29 +0200 |
commit | 488ff1ca2cb7d097d9d7b279bec69868edeef320 (patch) | |
tree | 92dadc8db6a5388938aeeb5c5803f69d6b9905e7 | |
parent | 67d21bbcf30ed04c65bdf575dc85056fc8fd57c4 (diff) | |
download | prosody-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.lua | 10 |
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 |