mirror of
https://github.com/tmate-io/tmate.git
synced 2025-01-23 14:28:55 +01:00
Add some additional debug logging.
This commit is contained in:
parent
e9cef8bf30
commit
ebd9c615c8
1
cfg.c
1
cfg.c
@ -41,6 +41,7 @@ load_cfg(const char *path, struct cmd_q *cmdq, char **cause)
|
|||||||
size_t len, oldlen;
|
size_t len, oldlen;
|
||||||
struct cmd_list *cmdlist;
|
struct cmd_list *cmdlist;
|
||||||
|
|
||||||
|
log_debug("loading %s", path);
|
||||||
if ((f = fopen(path, "rb")) == NULL) {
|
if ((f = fopen(path, "rb")) == NULL) {
|
||||||
xasprintf(cause, "%s: %s", path, strerror(errno));
|
xasprintf(cause, "%s: %s", path, strerror(errno));
|
||||||
return (-1);
|
return (-1);
|
||||||
|
11
cmd-queue.c
11
cmd-queue.c
@ -183,6 +183,7 @@ cmdq_continue(struct cmd_q *cmdq)
|
|||||||
struct cmd_q_item *next;
|
struct cmd_q_item *next;
|
||||||
enum cmd_retval retval;
|
enum cmd_retval retval;
|
||||||
int guards, empty;
|
int guards, empty;
|
||||||
|
char s[1024];
|
||||||
|
|
||||||
guards = 0;
|
guards = 0;
|
||||||
if (c != NULL && c->session != NULL)
|
if (c != NULL && c->session != NULL)
|
||||||
@ -204,11 +205,19 @@ cmdq_continue(struct cmd_q *cmdq)
|
|||||||
next = TAILQ_NEXT(cmdq->item, qentry);
|
next = TAILQ_NEXT(cmdq->item, qentry);
|
||||||
|
|
||||||
while (cmdq->cmd != NULL) {
|
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)
|
if (guards)
|
||||||
cmdq_print(cmdq, "%%begin");
|
cmdq_print(cmdq, "%%begin");
|
||||||
retval = cmdq->cmd->entry->exec(cmdq->cmd, cmdq);
|
retval = cmdq->cmd->entry->exec(cmdq->cmd, cmdq);
|
||||||
if (guards)
|
if (guards) {
|
||||||
|
if (retval == CMD_RETURN_ERROR)
|
||||||
|
cmdq_print(cmdq, "%%error");
|
||||||
|
else
|
||||||
cmdq_print(cmdq, "%%end");
|
cmdq_print(cmdq, "%%end");
|
||||||
|
}
|
||||||
|
|
||||||
if (retval == CMD_RETURN_ERROR)
|
if (retval == CMD_RETURN_ERROR)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user