Software /
code /
prosody
Diff
net/server_select.lua @ 2740:2442c54cf9ec
net.server_select: Fix for traceback when a read returns an error and no data (thanks dersd)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 05 Mar 2010 16:45:46 +0000 |
parent | 2732:dabdc56561f9 |
child | 2925:692b3c6c5bd2 |
child | 2997:6ccaefea80ec |
line wrap: on
line diff
--- a/net/server_select.lua Fri Mar 05 15:00:11 2010 +0000 +++ b/net/server_select.lua Fri Mar 05 16:45:46 2010 +0000 @@ -430,7 +430,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 == "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