mirror of
https://github.com/kepler155c/opus
synced 2024-12-28 09:30:34 +00:00
fix invalid msg crashing socket
This commit is contained in:
parent
cb03e56a1f
commit
68ee419d83
@ -20,6 +20,8 @@ function Config.load(fname, data)
|
|||||||
|
|
||||||
Util.merge(data, contents)
|
Util.merge(data, contents)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
function Config.loadWithCheck(fname, data)
|
function Config.loadWithCheck(fname, data)
|
||||||
@ -36,7 +38,7 @@ function Config.loadWithCheck(fname, data)
|
|||||||
shell.run('edit ' .. filename)
|
shell.run('edit ' .. filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
Config.load(fname, data)
|
return Config.load(fname, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Config.update(fname, data)
|
function Config.update(fname, data)
|
||||||
|
@ -183,7 +183,7 @@ function Socket.server(port)
|
|||||||
local _, _, sport, dport, msg = os.pullEvent('modem_message')
|
local _, _, sport, dport, msg = os.pullEvent('modem_message')
|
||||||
|
|
||||||
if sport == port and
|
if sport == port and
|
||||||
msg and
|
msg and type(msg) == 'table' and
|
||||||
msg.dhost == os.getComputerID() and
|
msg.dhost == os.getComputerID() and
|
||||||
msg.type == 'OPEN' then
|
msg.type == 'OPEN' then
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ _G.requireInjector(_ENV)
|
|||||||
local Ansi = require('ansi')
|
local Ansi = require('ansi')
|
||||||
local Packages = require('packages')
|
local Packages = require('packages')
|
||||||
local UI = require('ui')
|
local UI = require('ui')
|
||||||
local Util = require('util')
|
|
||||||
|
|
||||||
local colors = _G.colors
|
local colors = _G.colors
|
||||||
local shell = _ENV.shell
|
local shell = _ENV.shell
|
||||||
@ -75,7 +74,7 @@ end
|
|||||||
function page:run(operation, name)
|
function page:run(operation, name)
|
||||||
local oterm = term.redirect(self.action.output.win)
|
local oterm = term.redirect(self.action.output.win)
|
||||||
self.action.output:clear()
|
self.action.output:clear()
|
||||||
local cmd = string.format('Package %s %s', operation, name)
|
local cmd = string.format('package %s %s', operation, name)
|
||||||
--for _ = 1, 3 do
|
--for _ = 1, 3 do
|
||||||
-- print(cmd .. '\n')
|
-- print(cmd .. '\n')
|
||||||
-- os.sleep(1)
|
-- os.sleep(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user