diff options
Diffstat (limited to 'net/server.lua')
-rw-r--r-- | net/server.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/server.lua b/net/server.lua index 6ab8ce91..ad46071b 100644 --- a/net/server.lua +++ b/net/server.lua @@ -434,7 +434,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport handler.bufferlen = function( readlen, sendlen )
maxsendlen = sendlen or maxsendlen
maxreadlen = readlen or maxreadlen
- return maxreadlen, maxsendlen
+ return bufferlen, maxreadlen, maxsendlen
end
handler.lock = function( switch )
if switch == true then
@@ -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 (err == "wantread" or err == "timeout") or string_len(part) > 0 then -- received something
local buffer = buffer or part or ""
local len = string_len( buffer )
if len > maxreadlen then
|