From bf9e29ed2d95a81780effae125fe6dca688818c1 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 4 Apr 2017 15:58:42 +0300 Subject: [PATCH] imap: Add client_command_context.human_args Generated with imap_write_args_for_human() --- src/imap/imap-client.c | 4 ++++ src/imap/imap-client.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index ccedbdcd88..d4dafc5b72 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -663,6 +663,10 @@ bool client_read_args(struct client_command_context *cmd, unsigned int count, imap_write_args(str, *args_r); cmd->args = p_strdup(cmd->pool, str_c(str)); + str_truncate(str, 0); + imap_write_args_for_human(str, *args_r); + cmd->human_args = p_strdup(cmd->pool, str_c(str)); + cmd->client->input_lock = NULL; return TRUE; } else if (ret == -2) { diff --git a/src/imap/imap-client.h b/src/imap/imap-client.h index 26a91ec0c1..663917065c 100644 --- a/src/imap/imap-client.h +++ b/src/imap/imap-client.h @@ -88,6 +88,9 @@ struct client_command_context { arguments, so they may not be exactly the same as how client sent them. */ const char *args; + /* Parameters for this command generated with + imap_write_args_for_human(), so it's suitable for logging. */ + const char *human_args; enum command_flags cmd_flags; const char *tagline_reply;