Diff

net/server_event.lua @ 2125:2b4f8a35e41a

net.server_event: Handle and ignore 'wantread' error from receive(), treat as a timeout
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Nov 2009 04:08:11 +0000
parent 2124:465a7481ab96
child 2126:12669db7ed4a
line wrap: on
line diff
--- a/net/server_event.lua	Sun Nov 22 04:06:40 2009 +0000
+++ b/net/server_event.lua	Sun Nov 22 04:08:11 2009 +0000
@@ -552,7 +552,7 @@
 					interface.eventread = nil
 					return -1
 				end
-				if err and ( "timeout" ~= err ) then
+				if err and ( err ~= "timeout" and err ~= "wantread" ) then
 					if "wantwrite" == err then -- need to read on write event
 						if not interface.eventwrite then  -- register new write event if needed
 							interface.eventwrite = addevent( base, interface.conn, EV_WRITE, interface.writecallback, cfg.WRITE_TIMEOUT )