# HG changeset patch # User Matthew Wild # Date 1259807314 0 # Node ID 2dc9bbf254477b8b34f35df8b2ffc0fb37b4193b # Parent 8a01b08986798fd3ba0c5b6998fbd2b2d0d8fd1d net.server_select: Fix possibility of losing data sent from a socket just before it closes (thanks Sjoerd Simons) diff -r 8a01b0898679 -r 2dc9bbf25447 net/server_select.lua --- a/net/server_select.lua Thu Dec 03 01:13:06 2009 +0000 +++ b/net/server_select.lua Thu Dec 03 02:28:34 2009 +0000 @@ -467,7 +467,7 @@ end local _readbuffer = function( ) -- this function reads data local buffer, err, part = receive( socket, pattern ) -- receive buffer with "pattern" - if not err or ( err == "timeout" or err == "wantread" ) then -- received something + if not err or string_len(part) > 0 then -- received something local buffer = buffer or part or "" local len = string_len( buffer ) if len > maxreadlen then