[dovecot-cvs] dovecot/src/imap client.c, 1.67.2.7, 1.67.2.8 client.h, 1.36.2.1, 1.36.2.2

tss at dovecot.org tss at dovecot.org
Thu Mar 1 10:38:20 UTC 2007


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv12599

Modified Files:
      Tag: branch_1_0
	client.c client.h 
Log Message:
Added asserts to make sure client_destroy() isn't called while we're
handling commands.



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.67.2.7
retrieving revision 1.67.2.8
diff -u -d -r1.67.2.7 -r1.67.2.8
--- client.c	5 Jan 2007 18:48:52 -0000	1.67.2.7
+++ client.c	1 Mar 2007 10:38:17 -0000	1.67.2.8
@@ -64,6 +64,7 @@
 {
 	int ret;
 
+	i_assert(!client->handling_input);
 	i_assert(!client->destroyed);
 	client->destroyed = TRUE;
 
@@ -397,6 +398,8 @@
 	struct client_command_context *cmd = &client->cmd;
 	int ret;
 
+	i_assert(!client->handling_input);
+
 	if (client->command_pending) {
 		/* already processing one command. wait. */
 		io_remove(&client->io);
@@ -422,6 +425,7 @@
 		break;
 	}
 
+	client->handling_input = TRUE;
 	o_stream_cork(client->output);
 	do {
 		t_push();
@@ -429,6 +433,7 @@
 		t_pop();
 	} while (ret && !client->disconnected);
 	o_stream_uncork(client->output);
+	client->handling_input = FALSE;
 
 	if (client->command_pending)
 		client->input_pending = TRUE;

Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.h,v
retrieving revision 1.36.2.1
retrieving revision 1.36.2.2
diff -u -d -r1.36.2.1 -r1.36.2.2
--- client.h	1 Mar 2007 10:18:00 -0000	1.36.2.1
+++ client.h	1 Mar 2007 10:38:17 -0000	1.36.2.2
@@ -51,6 +51,7 @@
 	unsigned int command_pending:1;
 	unsigned int input_pending:1;
 	unsigned int output_pending:1;
+	unsigned int handling_input:1;
 	unsigned int input_skip_line:1; /* skip all the data until we've
 					   found a new line */
 };



More information about the dovecot-cvs mailing list