diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-12-03 02:28:34 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-12-03 02:28:34 +0000 |
commit | 99e33affa47209fda58125a474e8617a2d981d7c (patch) | |
tree | 09614325aa6df22c7a9a761c3bf66331c0084855 /net/server_select.lua | |
parent | 490f351cecd3bdc9f0ecb792a8df75e7a9e31e30 (diff) | |
download | prosody-99e33affa47209fda58125a474e8617a2d981d7c.tar.gz prosody-99e33affa47209fda58125a474e8617a2d981d7c.zip |
net.server_select: Fix possibility of losing data sent from a socket just before it closes (thanks Sjoerd Simons)
Diffstat (limited to 'net/server_select.lua')
-rw-r--r-- | net/server_select.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_select.lua b/net/server_select.lua index ab2efcb0..566f5ae9 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -467,7 +467,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport 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
|