[dovecot-cvs] dovecot/src/imap cmd-fetch.c,1.24,1.25

cras at dovecot.org cras at dovecot.org
Thu Nov 11 19:36:54 EET 2004


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

Modified Files:
	cmd-fetch.c 
Log Message:
Make sure fetching gets deinitialized properly if connection closes in the
middle of it.



Index: cmd-fetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-fetch.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmd-fetch.c	28 Sep 2004 10:55:36 -0000	1.24
+++ cmd-fetch.c	11 Nov 2004 17:36:51 -0000	1.25
@@ -1,6 +1,7 @@
 /* Copyright (C) 2002-2004 Timo Sirainen */
 
 #include "common.h"
+#include "ostream.h"
 #include "commands.h"
 #include "imap-fetch.h"
 #include "imap-search.h"
@@ -109,9 +110,13 @@
         struct imap_fetch_context *ctx = client->cmd_context;
 	int ret;
 
-	if ((ret = imap_fetch(ctx)) == 0) {
-		/* unfinished */
-		return FALSE;
+	if (client->output->closed)
+		ret = -1;
+	else {
+		if ((ret = imap_fetch(ctx)) == 0) {
+			/* unfinished */
+			return FALSE;
+		}
 	}
 	if (ret < 0)
 		ctx->failed = TRUE;



More information about the dovecot-cvs mailing list