summaryrefslogtreecommitdiff
path: root/src/modules/debug_shell.lua
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2010-12-29 12:24:43 +0000
committerChristian Pointner <equinox@spreadspace.org>2010-12-29 12:24:43 +0000
commit8edc1eccac63fbe2fcb7d7e3eab76cb8646df9a4 (patch)
treee18163715804d1eddedc9d4f1fb60a221a535fe6 /src/modules/debug_shell.lua
parentyet another trailing whitespace deletion (diff)
requester gets now stored with commands
response and timeout handlers get called now git-svn-id: https://svn.spreadspace.org/gcsd/trunk@91 ac14a137-c7f1-4531-abe0-07747231d213
Diffstat (limited to 'src/modules/debug_shell.lua')
-rw-r--r--src/modules/debug_shell.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/debug_shell.lua b/src/modules/debug_shell.lua
index 9c3b605..b2cd4a1 100644
--- a/src/modules/debug_shell.lua
+++ b/src/modules/debug_shell.lua
@@ -100,8 +100,12 @@ function debug_shell:new(config, runtype)
client.module_instance = inst
client.addr = addr
client.name = inst.name .. "#" .. tcp.endtostring(addr)
- function client:process_response() end
- function client:process_timeout() end
+ function client:process_response(response)
+ client_handle.out_buffer = client_handle.out_buffer .. "received response: '" .. response .. "'\n"
+ end
+ function client:process_timeout()
+ client_handle.out_buffer = client_handle.out_buffer .. "command timed out\n"
+ end
function client:get_read_handles()
return { client_handle }
end
@@ -217,7 +221,7 @@ function debug_shell:exec_cmd(handle, buffer)
if(not param or param == '') then handle.out_buffer = handle.out_buffer .. "Error: please specify a command\n"
else
handle.out_buffer = handle.out_buffer .. "enqueing command: " .. param .. "\n"
- command_queue:enqueue(param, "ok\n", 2500)
+ command_queue:enqueue(param, "ok\n", handle.client_instance, 2500)
end
else
handle.out_buffer = handle.out_buffer .. "unknown command\n"