made vtunnel not crash the machine, more actual testing is required

This commit is contained in:
Izaya 2020-06-07 23:41:01 +10:00
parent d0378582ae
commit ba1bf9339d

View File

@ -102,6 +102,18 @@ function start()
os.kill(v) os.kill(v)
end end
end end
return os.spawn(function()
local last = computer.uptime()
while true do
local tE = {coroutine.yield()}
if computer.uptime() > last + cfg.rtimer then
for k,v in pairs(proxies) do
v.read()
end
last = computer.uptime()
end
end
end,"vtunnel")
end end
function vt.stop() function vt.stop()
for k,v in pairs(proxies) do for k,v in pairs(proxies) do
@ -147,16 +159,6 @@ function vt.settimer(time)
end end
vt.start = start vt.start = start
_G.libs.vtunnel = vt package.loaded.vtunnel = vt
start() return vt
local last = computer.uptime()
while true do
local tE = {coroutine.yield()}
if computer.uptime() > last + cfg.rtimer then
for k,v in pairs(proxies) do
v.read()
end
last = computer.uptime()
end
end