net.server_epoll: Restore wantread flag after pause (fixes #1354) 0.11
authorKim Alvefur <zash@zash.se>
Sat, 04 May 2019 04:23:35 +0200
branch0.11
changeset 9998 524b8cd76780
parent 9995 8cd180dc18a8
child 9999 8d46ecc4bd0c
child 10002 c8646f65767a
net.server_epoll: Restore wantread flag after pause (fixes #1354) If a chunk of data has been received that is larger than the amount read at a time, then the connection is paused for a short time after which it tries to read some more. If, after that, there is still more data to read, it should do the same thing. However, because the "want read" flag is removed and was restored after the delayed reading, it would not schedule another delayed read.
net/server_epoll.lua
--- a/net/server_epoll.lua	Wed May 01 22:34:15 2019 +0200
+++ b/net/server_epoll.lua	Sat May 04 04:23:35 2019 +0200
@@ -600,10 +600,10 @@
 	self:set(false);
 	self._pausefor = addtimer(t, function ()
 		self._pausefor = nil;
+		self:set(true);
 		if self.conn and self.conn:dirty() then
 			self:onreadable();
 		end
-		self:set(true);
 	end);
 end