net/server_epoll.lua
branch0.11
changeset 9935 485231f8b75d
parent 9826 13c2707d2417
child 9936 df73ca804719
--- a/net/server_epoll.lua	Mon Jan 14 00:17:02 2019 +0100
+++ b/net/server_epoll.lua	Thu Mar 28 12:31:14 2019 +0100
@@ -355,15 +355,18 @@
 		self:onconnect();
 		self:on("incoming", data);
 	else
+		if err == "wantread" then
+			self:set(true, nil);
+			err = "timeout";
+		elseif err == "wantwrite" then
+			self:set(nil, true);
+			err = "timeout";
+		end
 		if partial and partial ~= "" then
 			self:onconnect();
 			self:on("incoming", partial, err);
 		end
-		if err == "wantread" then
-			self:set(true, nil);
-		elseif err == "wantwrite" then
-			self:set(nil, true);
-		elseif err ~= "timeout" then
+		if err ~= "timeout" then
 			self:on("disconnect", err);
 			self:destroy()
 			return;