From 427dea0f3aab1fb05172629d60ac27412f7ddeb9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 19 Apr 2016 17:24:00 +0200 Subject: net.server_event: Re-add write event if writebuffer is non-empty after write (eg due to writes from ondrain callback) (fixes #661) --- net/server_event.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/server_event.lua') 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 -- cgit v1.2.3