hopefully fixed keepalives

This commit is contained in:
Izaya 2018-04-06 17:41:28 +10:00
parent 9528dd443d
commit 17c7bc0a13
1 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,9 @@ function clientLoop()
client.buffer = client.buffer .. s
client.last=os.time()
end
if client.buffer:sub(1,3) == "\0\1\0" then
client.buffer=client.buffer:sub(4)
end
if client.buffer:len() > 16384 then
print("Dropping client "..tostring(id).." for wasting resources")
client.conn:close()