# HG changeset patch # User Kim Alvefur # Date 1470957206 -7200 # Node ID 785fa11382931a7ca29afefd177a8bf0e9e5fc1f # Parent b1b27dedf4cf9d31a69b06d23e19357815c891b7 net.server_epoll: Continue reading after a slight delay if there is buffered data after a read diff -r b1b27dedf4cf -r 785fa1138293 net/server_epoll.lua --- a/net/server_epoll.lua Fri Aug 12 01:11:59 2016 +0200 +++ b/net/server_epoll.lua Fri Aug 12 01:13:26 2016 +0200 @@ -28,6 +28,7 @@ write_timeout = 7; tcp_backlog = 128; accept_retry_interval = 10; + read_retry_delay = 1e-06; }; local fds = createtable(10, 0); -- FD -> conn @@ -236,6 +237,9 @@ return; end self:setreadtimeout(); + if self.conn:dirty() then + self:pausefor(cfg.read_retry_delay); + end end function interface:onwriteable() @@ -420,6 +424,9 @@ self._pausefor = addtimer(t, function () self._pausefor = nil; self:setflags(true); + if self.conn:dirty() then + self:onreadable(); + end end); end