Software /
code /
prosody
Changeset
2764:6f5c30865ddf
net.server_select: Fix possibility of losing data sent from a socket just before it closes (thanks Sjoerd Simons)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 03 Dec 2009 02:28:34 +0000 |
parents | 2763:083430330585 |
children | 2765:3cb9df793269 |
files | net/server.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/net/server.lua Thu Dec 03 01:13:06 2009 +0000 +++ b/net/server.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