diff options
Diffstat (limited to 'script-beta/jsonrpc.lua')
-rw-r--r-- | script-beta/jsonrpc.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/script-beta/jsonrpc.lua b/script-beta/jsonrpc.lua index 39cd00f5..d4b79c6e 100644 --- a/script-beta/jsonrpc.lua +++ b/script-beta/jsonrpc.lua @@ -4,8 +4,6 @@ local tonumber = tonumber local util = require 'utility' local log = require 'brave.log' -_ENV = nil - ---@class jsonrpc local m = {} m.type = 'jsonrpc' @@ -22,7 +20,10 @@ local function readProtoHead(reader, errHandle) while true do local line = reader 'L' if line == nil then - break + -- 说明管道已经关闭了 + log.warn('stdin closed!') + os.exit(true) + return nil end if line == '\r\n' then break |