Skip to content
Snippets Groups Projects
Commit 0a0d6c47 authored by Nikolay Shirokovskiy's avatar Nikolay Shirokovskiy Committed by Vladimir Davydov
Browse files

console: put console EOF check in single place

For the client_print there are also other checks and actions but they
are unnecesessary.

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
parent 6a508fc3
No related branches found
Tags 1.7.1
No related merge requests found
......@@ -633,10 +633,6 @@ end
-- Print result to stdout
--
local function local_print(self, output)
if output == nil then
self.running = nil
return
end
print(output)
end
......@@ -668,14 +664,6 @@ end
-- Print result to connected client from console.listen()
--
local function client_print(self, output)
if not self.client then
return
elseif not output then
-- disconnect peer
self.client = nil -- socket will be closed by tcp_server() function
self.running = nil
return
end
self.client:write(output)
end
......@@ -707,8 +695,10 @@ local function repl(self)
while self.running do
local command = self:read()
local output = self:eval(command)
if output == nil then break end
self:print(output)
end
self.running = false
fiber.self().storage.console = nil
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment