diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-12 01:13:26 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-12 01:13:26 +0200 |
commit | 8dc3c63849f1d6bccb305f01fbc21ead6b42f327 (patch) | |
tree | 6085241bdf81493cebe2caeb5834458a4eef9642 /net | |
parent | cd4065264283a20c1ec1b90443724a5e743604ac (diff) | |
download | prosody-8dc3c63849f1d6bccb305f01fbc21ead6b42f327.tar.gz prosody-8dc3c63849f1d6bccb305f01fbc21ead6b42f327.zip |
net.server_epoll: Continue reading after a slight delay if there is buffered data after a read
Diffstat (limited to 'net')
-rw-r--r-- | net/server_epoll.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 66d9841c..7bc93b33 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -28,6 +28,7 @@ local cfg = { 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 @@ function interface:onreadable() return; end self:setreadtimeout(); + if self.conn:dirty() then + self:pausefor(cfg.read_retry_delay); + end end function interface:onwriteable() @@ -420,6 +424,9 @@ function interface:pausefor(t) self._pausefor = addtimer(t, function () self._pausefor = nil; self:setflags(true); + if self.conn:dirty() then + self:onreadable(); + end end); end |