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
1 changed files with 14 additions and 12 deletions

View File

@ -102,6 +102,18 @@ function start()
os.kill(v)
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
function vt.stop()
for k,v in pairs(proxies) do
@ -147,16 +159,6 @@ function vt.settimer(time)
end
vt.start = start
_G.libs.vtunnel = vt
package.loaded.vtunnel = vt
start()
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
return vt