aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-03-05 16:45:46 +0000
committerMatthew Wild <mwild1@gmail.com>2010-03-05 16:45:46 +0000
commitc071b4638d4a78d9c7e76ae973553e04cb5e22b6 (patch)
tree2c8e7c933e9e471597dc60050a3f81ef0a90d025 /net
parent1967ba02a55f3b3d326020b27c73fcab78e0262d (diff)
downloadprosody-c071b4638d4a78d9c7e76ae973553e04cb5e22b6.tar.gz
prosody-c071b4638d4a78d9c7e76ae973553e04cb5e22b6.zip
net.server_select: Fix for traceback when a read returns an error and no data (thanks dersd)
Diffstat (limited to 'net')
-rw-r--r--net/server_select.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index c4a1f19a..49cbe25d 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -430,7 +430,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 == "wantread" or err == "timeout") or string_len(part) > 0 then -- received something
+ if not err or (err == "wantread" or err == "timeout") or (part and string_len(part) > 0) then -- received something
local buffer = buffer or part or ""
local len = string_len( buffer )
if len > maxreadlen then