From 6f7e27827e430143f2b5e2b33dc0197a8a011fe0 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Fri, 8 Mar 2019 16:47:39 -0500 Subject: [PATCH] phase out peripheral.lookup --- sys/apis/proxy.lua | 2 +- sys/apps/Network.lua | 17 ++++------------- sys/network/proxy.lua | 3 +++ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/sys/apis/proxy.lua b/sys/apis/proxy.lua index 4603d57..eb3d819 100644 --- a/sys/apis/proxy.lua +++ b/sys/apis/proxy.lua @@ -12,7 +12,7 @@ function Proxy.create(remoteId, uri) socket.co = coroutine.running() socket:write(uri) - local methods = socket:read() or error('Timed out') + local methods = socket:read(2) or error('Timed out') local hijack = { } for _,method in pairs(methods) do diff --git a/sys/apps/Network.lua b/sys/apps/Network.lua index c8232ff..efc71de 100644 --- a/sys/apps/Network.lua +++ b/sys/apps/Network.lua @@ -6,7 +6,6 @@ local Util = require('util') local colors = _G.colors local device = _G.device -local multishell = _ENV.multishell local network = _G.network local os = _G.os local shell = _ENV.shell @@ -178,19 +177,10 @@ function page:eventHandler(event) local t = self.grid:getSelected() if t then if event.type == 'telnet' then - multishell.openTab({ - path = 'sys/apps/telnet.lua', - focused = true, - args = { t.id }, - title = t.label, - }) + shell.openForegroundTab('telnet ' .. t.id) + elseif event.type == 'vnc' then - multishell.openTab({ - path = 'sys/apps/vnc.lua', - focused = true, - args = { t.id }, - title = t.label, - }) + shell.openForegroundTab('vnc.lua ' .. t.id) os.queueEvent('overview_shortcut', { title = t.label, category = "VNC", @@ -199,6 +189,7 @@ function page:eventHandler(event) \031e\\/\031 \0319c", run = "vnc.lua " .. t.id, }) + elseif event.type == 'clear' then Util.clear(network) page.grid:update() diff --git a/sys/network/proxy.lua b/sys/network/proxy.lua index c721896..7e0f284 100644 --- a/sys/network/proxy.lua +++ b/sys/network/proxy.lua @@ -11,6 +11,7 @@ local function getProxy(path) break end end + return proxy end Event.addRoutine(function() @@ -27,6 +28,7 @@ Event.addRoutine(function() if not api then print('proxy: invalid API') + socket:close() return end @@ -52,6 +54,7 @@ Event.addRoutine(function() _G.printError(m) end end + socket:close() end) end end)