[dovecot-cvs] dovecot/src/imap client.c, 1.46, 1.47 cmd-fetch.c, 1.22, 1.23 imap-fetch.c, 1.25, 1.26

cras at dovecot.org cras at dovecot.org
Mon Sep 20 02:23:10 EEST 2004


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

Modified Files:
	client.c cmd-fetch.c imap-fetch.c 
Log Message:
cleanups



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- client.c	28 Aug 2004 18:04:50 -0000	1.46
+++ client.c	19 Sep 2004 23:23:08 -0000	1.47
@@ -378,9 +378,9 @@
 static void client_output(void *context)
 {
 	struct client *client = context;
-	int ret, finished;
+	int finished;
 
-	if ((ret = o_stream_flush(client->output)) < 0) {
+	if (o_stream_flush(client->output) < 0) {
 		client_destroy(client);
 		return;
 	}

Index: cmd-fetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-fetch.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cmd-fetch.c	18 Aug 2004 23:53:39 -0000	1.22
+++ cmd-fetch.c	19 Sep 2004 23:23:08 -0000	1.23
@@ -85,7 +85,9 @@
 			client_send_storage_error(client, storage);
 		}
 		return TRUE;
-	} if ((client_workarounds & WORKAROUND_OE6_FETCH_NO_NEWMAIL) != 0) {
+	}
+
+	if ((client_workarounds & WORKAROUND_OE6_FETCH_NO_NEWMAIL) != 0) {
 		client_send_tagline(client, ok_message);
 		return TRUE;
 	} else {
@@ -104,6 +106,9 @@
 		/* unfinished */
 		return FALSE;
 	}
+	if (ret < 0)
+		ctx->failed = TRUE;
+
 	if (imap_fetch_deinit(ctx) < 0)
 		ret = -1;
 	return cmd_fetch_finish(client, ret < 0);
@@ -151,6 +156,8 @@
 		client->cmd_context = ctx;
 		return FALSE;
 	}
+	if (ret < 0)
+		ctx->failed = TRUE;
 	if (imap_fetch_deinit(ctx) < 0)
 		ret = -1;
 	return cmd_fetch_finish(client, ret < 0);

Index: imap-fetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- imap-fetch.c	29 Aug 2004 07:52:02 -0000	1.25
+++ imap-fetch.c	19 Sep 2004 23:23:08 -0000	1.26
@@ -164,11 +164,8 @@
 	int ret;
 
 	if (ctx->cont_handler != NULL) {
-		if ((ret = ctx->cont_handler(ctx)) <= 0) {
-			if (ret < 0)
-				ctx->failed = TRUE;
+		if ((ret = ctx->cont_handler(ctx)) <= 0)
 			return ret;
-		}
 
 		ctx->cont_handler = NULL;
 		ctx->cur_offset = 0;
@@ -200,10 +197,8 @@
 				    ctx->cur_mail->seq);
 			if (o_stream_send(ctx->client->output,
 					  str_data(ctx->cur_str),
-					  str_len(ctx->cur_str)) < 0) {
-				ctx->failed = TRUE;
+					  str_len(ctx->cur_str)) < 0)
 				return -1;
-			}
 
 			str_truncate(ctx->cur_str, 0);
 			str_append_c(ctx->cur_str, ' ');
@@ -218,10 +213,7 @@
 			t_pop();
 
 			if (ret <= 0) {
-				if (ret < 0)
-					ctx->failed = TRUE;
-				else
-					i_assert(ctx->cont_handler != NULL);
+				i_assert(ret < 0 || ctx->cont_handler != NULL);
 				return ret;
 			}
 
@@ -233,17 +225,13 @@
 			if (o_stream_send(ctx->client->output,
 					  str_data(ctx->cur_str) + ctx->first,
 					  str_len(ctx->cur_str) - 1 -
-					  ctx->first) < 0) {
-				ctx->failed = TRUE;
+					  ctx->first) < 0)
 				return -1;
-			}
 			str_truncate(ctx->cur_str, 0);
 		}
 
-		if (o_stream_send(ctx->client->output, ")\r\n", 3) < 0) {
-			ctx->failed = TRUE;
+		if (o_stream_send(ctx->client->output, ")\r\n", 3) < 0)
 			return -1;
-		}
 
 		ctx->cur_mail = NULL;
 		ctx->cur_handler = 0;



More information about the dovecot-cvs mailing list