From 84ca9c03e3ce2734706a0e8f3464ae899f841dca Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 30 May 2010 22:42:05 +0000 Subject: quit vs terminate --- src/debug_shell.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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") -- cgit v1.2.3