From 85671a5bed961b7a542ffce853749fb61b0558ca Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 21 Oct 2014 22:06:46 +0000 Subject: Save next item after firing command in case it has added to the queue. --- cmd-queue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cmd-queue.c') diff --git a/cmd-queue.c b/cmd-queue.c index 6495d3fd..0ddf90f7 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -180,8 +180,6 @@ cmdq_continue(struct cmd_q *cmdq) cmdq->cmd = TAILQ_NEXT(cmdq->cmd, qentry); do { - 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, @@ -213,6 +211,7 @@ cmdq_continue(struct cmd_q *cmdq) cmdq->cmd = TAILQ_NEXT(cmdq->cmd, qentry); } + next = TAILQ_NEXT(cmdq->item, qentry); TAILQ_REMOVE(&cmdq->queue, cmdq->item, qentry); cmd_list_free(cmdq->item->cmdlist); -- cgit From b496b1fe11b99614e407d02edb1a21905f384929 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 27 Oct 2014 22:23:47 +0000 Subject: Move cfg_causes local into cfg.c and remove struct causelist. --- cmd-queue.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cmd-queue.c') diff --git a/cmd-queue.c b/cmd-queue.c index 0ddf90f7..a98fa9b6 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -93,17 +93,16 @@ cmdq_error(struct cmd_q *cmdq, const char *fmt, ...) struct client *c = cmdq->client; struct cmd *cmd = cmdq->cmd; va_list ap; - char *msg, *cause; + char *msg; size_t msglen; va_start(ap, fmt); msglen = xvasprintf(&msg, fmt, ap); va_end(ap); - if (c == NULL) { - xasprintf(&cause, "%s:%u: %s", cmd->file, cmd->line, msg); - ARRAY_ADD(&cfg_causes, cause); - } else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) { + if (c == NULL) + cfg_add_cause("%s:%u: %s", cmd->file, cmd->line, msg); + else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) { evbuffer_add(c->stderr_data, msg, msglen); evbuffer_add(c->stderr_data, "\n", 1); -- cgit