diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/imap/cmd-x-cancel.c | |
parent | Initial commit. (diff) | |
download | dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/imap/cmd-x-cancel.c')
-rw-r--r-- | src/imap/cmd-x-cancel.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/imap/cmd-x-cancel.c b/src/imap/cmd-x-cancel.c new file mode 100644 index 0000000..3f49451 --- /dev/null +++ b/src/imap/cmd-x-cancel.c @@ -0,0 +1,28 @@ +/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */ + +#include "imap-common.h" +#include "imap-commands.h" + +bool cmd_x_cancel(struct client_command_context *cmd) +{ + struct client_command_context *cancel_cmd; + const char *tag; + + /* <tag> */ + if (!client_read_string_args(cmd, 1, &tag)) + return FALSE; + + cancel_cmd = cmd->client->command_queue; + for (; cancel_cmd != NULL; cancel_cmd = cancel_cmd->next) { + if (cancel_cmd->tag != NULL && cancel_cmd != cmd && + strcmp(cancel_cmd->tag, tag) == 0) { + client_command_cancel(&cancel_cmd); + client_send_tagline(cmd, "OK Command cancelled."); + return TRUE; + } + } + + client_send_tagline(cmd, "NO Command tag not found."); + return TRUE; +} + |