dovecot-1.2: imap: Store command args to client command contexts...

dovecot at dovecot.org dovecot at dovecot.org
Fri Feb 6 21:41:04 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/9b5d68776d03
changeset: 8730:9b5d68776d03
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 06 13:39:48 2009 -0500
description:
imap: Store command args to client command contexts for debugging purposes.

diffstat:

2 files changed, 13 insertions(+)
src/imap/client.c |    7 +++++++
src/imap/client.h |    6 ++++++

diffs (49 lines):

diff -r b7ebdade6cbd -r 9b5d68776d03 src/imap/client.c
--- a/src/imap/client.c	Fri Feb 06 13:38:54 2009 -0500
+++ b/src/imap/client.c	Fri Feb 06 13:39:48 2009 -0500
@@ -9,6 +9,7 @@
 #include "ostream.h"
 #include "var-expand.h"
 #include "imap-resp-code.h"
+#include "imap-util.h"
 #include "mail-namespace.h"
 #include "commands.h"
 
@@ -300,6 +301,7 @@ bool client_read_args(struct client_comm
 bool client_read_args(struct client_command_context *cmd, unsigned int count,
 		      unsigned int flags, const struct imap_arg **args_r)
 {
+	string_t *str;
 	int ret;
 
 	i_assert(count <= INT_MAX);
@@ -309,6 +311,11 @@ bool client_read_args(struct client_comm
 		/* all parameters read successfully */
 		i_assert(cmd->client->input_lock == NULL ||
 			 cmd->client->input_lock == cmd);
+
+		str = t_str_new(256);
+		imap_args_to_str(str, *args_r);
+		cmd->args = p_strdup(cmd->pool, str_c(str));
+
 		cmd->client->input_lock = NULL;
 		return TRUE;
 	} else if (ret == -2) {
diff -r b7ebdade6cbd -r 9b5d68776d03 src/imap/client.h
--- a/src/imap/client.h	Fri Feb 06 13:38:54 2009 -0500
+++ b/src/imap/client.h	Fri Feb 06 13:39:48 2009 -0500
@@ -48,8 +48,14 @@ struct client_command_context {
 	struct client *client;
 
 	pool_t pool;
+	/* IMAP command tag */
 	const char *tag;
+	/* Name of this command */
 	const char *name;
+	/* Parameters for this command. These are generated from parsed IMAP
+	   arguments, so they may not be exactly the same as how client sent
+	   them. */
+	const char *args;
 	enum command_flags cmd_flags;
 
 	command_func_t *func;


More information about the dovecot-cvs mailing list