aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-27 03:41:24 +0200
committerKim Alvefur <zash@zash.se>2017-03-27 03:41:24 +0200
commit24a02717389cd747187e567ab6881f4d1e36b14f (patch)
tree028e19c48da071b9bb79eb3edcd09bc69f49f5db /net
parentbd267b04905b584467d396bb3d20c32306bf2a19 (diff)
downloadprosody-im-server-24a02717389cd747187e567ab6881f4d1e36b14f.tar
prosody-im-server-24a02717389cd747187e567ab6881f4d1e36b14f.zip
net.server_epoll: Check write buffer for remaining data to write when closing
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 38620a21..3bb92d14 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -384,7 +384,7 @@ interface.send = interface.write;
-- Close, possibly after writing is done
function interface:close()
- if self._wantwrite then
+ if self.writebuffer and self.writebuffer[1] then
self:setflags(false, true); -- Flush final buffer contents
self.write, self.send = noop, noop; -- No more writing
log("debug", "Close %s after writing", tostring(self));