1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-12-25 01:48:05 +11:00

fixed some temporary hangs in fserv

This commit is contained in:
Izaya 2020-03-13 13:29:52 +11:00
parent 645fcf8270
commit cb3847d1c4

View File

@ -63,7 +63,7 @@ local function handleSocket(sock) -- create a coroutine for a new socket
log("["..sock.cname.."] Transferring remote file.",7)
sock:write("y")
for s in r do
coroutine.yield()
os.sleep(0)
sock:write(s)
end
else
@ -102,8 +102,8 @@ local function handleSocket(sock) -- create a coroutine for a new socket
log("["..sock.cname.."] Transferring file.",7)
local chunk = f:read(net.mtu)
repeat
coroutine.yield()
sock:write(chunk)
os.sleep(0)
sock:write(chunk or "")
chunk = f:read(net.mtu)
until not chunk
sock:close()