diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2013-03-25 10:06:13 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2013-03-25 10:06:13 +0000 |
commit | ebd9c615c8137e68f8831d4dbfd968a2f6a10a72 (patch) | |
tree | e4497ed9bf72ae880c163589ad3cbd46211e2ffc /cmd-queue.c | |
parent | e9cef8bf305e93d0ec8496c8155e0fa1258b8378 (diff) | |
download | rtmux-ebd9c615c8137e68f8831d4dbfd968a2f6a10a72.tar.gz rtmux-ebd9c615c8137e68f8831d4dbfd968a2f6a10a72.tar.bz2 rtmux-ebd9c615c8137e68f8831d4dbfd968a2f6a10a72.zip |
Add some additional debug logging.
Diffstat (limited to 'cmd-queue.c')
-rw-r--r-- | cmd-queue.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd-queue.c b/cmd-queue.c index 07884df2..fba371dd 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -183,6 +183,7 @@ cmdq_continue(struct cmd_q *cmdq) struct cmd_q_item *next; enum cmd_retval retval; int guards, empty; + char s[1024]; guards = 0; if (c != NULL && c->session != NULL) @@ -204,11 +205,19 @@ cmdq_continue(struct cmd_q *cmdq) next = TAILQ_NEXT(cmdq->item, qentry); while (cmdq->cmd != NULL) { + cmd_print(cmdq->cmd, s, sizeof s); + log_debug("cmdq %p: %s (client %d)", cmdq, s, + cmdq->client != NULL ? cmdq->client->ibuf.fd : -1); + if (guards) cmdq_print(cmdq, "%%begin"); retval = cmdq->cmd->entry->exec(cmdq->cmd, cmdq); - if (guards) - cmdq_print(cmdq, "%%end"); + if (guards) { + if (retval == CMD_RETURN_ERROR) + cmdq_print(cmdq, "%%error"); + else + cmdq_print(cmdq, "%%end"); + } if (retval == CMD_RETURN_ERROR) break; |