Software /
code /
prosody
Changeset
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 |
parents | 2739:7339c2720b39 |
children | 2741:fcd30b72c50c |
files | net/server_select.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
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