[dovecot-cvs] dovecot/src/imap imap-fetch.c, 1.27, 1.28 imap-fetch.h, 1.10, 1.11

cras at dovecot.org cras at dovecot.org
Sun Oct 3 15:28:59 EEST 2004


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

Modified Files:
	imap-fetch.c imap-fetch.h 
Log Message:
If fetching fails, finish sending the untagged FETCH reply correctly.



Index: imap-fetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- imap-fetch.c	28 Sep 2004 10:55:36 -0000	1.27
+++ imap-fetch.c	3 Oct 2004 12:28:57 -0000	1.28
@@ -204,6 +204,7 @@
 			str_truncate(ctx->cur_str, 0);
 			str_append_c(ctx->cur_str, ' ');
 			ctx->first = TRUE;
+			ctx->line_finished = FALSE;
 		}
 
 		for (; ctx->cur_handler < size; ctx->cur_handler++) {
@@ -231,6 +232,7 @@
 			str_truncate(ctx->cur_str, 0);
 		}
 
+		ctx->line_finished = TRUE;
 		if (o_stream_send(ctx->client->output, ")\r\n", 3) < 0)
 			return -1;
 
@@ -245,6 +247,11 @@
 {
 	str_free(ctx->cur_str);
 
+	if (!ctx->line_finished) {
+		if (o_stream_send(ctx->client->output, ")\r\n", 3) < 0)
+			return -1;
+	}
+
 	if (ctx->cur_input != NULL) {
 		i_stream_unref(ctx->cur_input);
 		ctx->cur_input = NULL;

Index: imap-fetch.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- imap-fetch.h	28 Sep 2004 10:55:37 -0000	1.10
+++ imap-fetch.h	3 Oct 2004 12:28:57 -0000	1.11
@@ -53,6 +53,7 @@
 	unsigned int cur_have_eoh:1;
 	unsigned int cur_append_eoh:1;
 	unsigned int first:1;
+	unsigned int line_finished:1;
 	unsigned int failed:1;
 };
 



More information about the dovecot-cvs mailing list