aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-12-03 02:28:34 +0000
committerMatthew Wild <mwild1@gmail.com>2009-12-03 02:28:34 +0000
commitd3176587c4ccffcee5ba8e4e615d3f161b4fadf6 (patch)
treebac144ef26c5edcb2ab0d2b6c8ca1d9454234e56 /net
parent54c77c0054c13aed866c19bec1179a886eaefea8 (diff)
downloadprosody-d3176587c4ccffcee5ba8e4e615d3f161b4fadf6.tar.gz
prosody-d3176587c4ccffcee5ba8e4e615d3f161b4fadf6.zip
net.server_select: Fix possibility of losing data sent from a socket just before it closes (thanks Sjoerd Simons)
Diffstat (limited to 'net')
-rw-r--r--net/server.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server.lua b/net/server.lua
index 6ab8ce91..2d27f769 100644
--- a/net/server.lua
+++ b/net/server.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