summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anylike.org>2010-05-30 22:42:05 +0000
committerChristian Pointner <equinox@anylike.org>2010-05-30 22:42:05 +0000
commit84ca9c03e3ce2734706a0e8f3464ae899f841dca (patch)
tree25e6e886b925663583d2dece59a09d887fc17afa
parentstart debug shell only when -U is supplied (diff)
quit vs terminate
-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")