aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_event.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-04-19 17:24:00 +0200
committerKim Alvefur <zash@zash.se>2016-04-19 17:24:00 +0200
commit2bf3239f769a9ea49d8aa7cfaa62bc034ddc4773 (patch)
treea8258dafe945b61f20e60ca8b187fd47fcd12081 /net/server_event.lua
parent5f4b783bf3d8ff785e812101ddb4c7f490bfdf6a (diff)
downloadprosody-2bf3239f769a9ea49d8aa7cfaa62bc034ddc4773.tar.gz
prosody-2bf3239f769a9ea49d8aa7cfaa62bc034ddc4773.zip
net.server_event: Re-add write event if writebuffer is non-empty after write (eg due to writes from ondrain callback) (fixes #661)
Diffstat (limited to 'net/server_event.lua')
-rw-r--r--net/server_event.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index d505825d..1c6f1547 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -548,6 +548,10 @@ do
elseif interface.eventreadtimeout then
return EV_WRITE, EV_TIMEOUT
end
+ if interface.writebuffer ~= 0 then
+ -- data possibly written from ondrain
+ return EV_WRITE, cfg.WRITE_TIMEOUT
+ end
interface.eventwrite = nil
return -1
elseif byte and (err == "timeout" or err == "wantwrite") then -- want write again