summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/debug_shell.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/debug_shell.lua b/src/debug_shell.lua
index e470a8e..e8ba6ef 100644
--- a/src/debug_shell.lua
+++ b/src/debug_shell.lua
@@ -109,6 +109,11 @@ debug_shell.handle = function(sock)
else
debug_shell.buffer = debug_shell.buffer .. data
ret = debug_shell.exec_cmd()
+ if(ret == 1) then
+ debug_shell.socks[2]:close()
+ debug_shell.socks[2] = nil
+ ret = 0
+ end
debug_shell.buffer = ""
end
end
@@ -142,7 +147,11 @@ debug_shell.exec_cmd = function()
if(cmd == 'quit') then
if(sep and sep ~= "") then return 0 end
- log.printf(log.NOTICE, "debug shell: quit command received")
+ log.printf(log.INFO, "debug shell: quitting debug session")
+ return 1
+ elseif(cmd == 'terminate') then
+ if(sep and sep ~= "") then return 0 end
+ log.printf(log.NOTICE, "debug shell: terminate command received")
return 2
elseif(cmd == 'ping') then
if(sep == ' ') then debug_shell.socks[2]:send("pong " .. (param or "") .. "\n")