Mark control commands specially so the client can identify them, based

on a diff from George Nachman a while back.
This commit is contained in:
Nicholas Marriott
2013-06-23 12:41:54 +00:00
committed by Thomas Adam
parent 1099442c0a
commit a0172a6ae5
2 changed files with 8 additions and 2 deletions

View File

@ -157,14 +157,17 @@ int
cmdq_guard(struct cmd_q *cmdq, const char *guard)
{
struct client *c = cmdq->client;
int flags;
if (c == NULL)
return 0;
if (!(c->flags & CLIENT_CONTROL))
return 0;
evbuffer_add_printf(c->stdout_data, "%%%s %ld %u\n", guard,
(long) cmdq->time, cmdq->number);
flags = !!(cmdq->cmd->flags & CMD_CONTROL);
evbuffer_add_printf(c->stdout_data, "%%%s %ld %u %d\n", guard,
(long) cmdq->time, cmdq->number, flags);
server_push_stdout(c);
return 1;
}