diff src/imap/cmd-append.c @ 6275:913b188f4dd4 HEAD

Removed explicit locking from views and maps. They were already locked all the time when they were used. Because of this change several functions can no longer fail, so they were changed to return void, and a lot of pointless error handling was removed.
author Timo Sirainen <tss@iki.fi>
date Sun, 12 Aug 2007 16:43:05 +0300
parents 3a1eed408cad
children bfb6aeddef9b
line wrap: on
line diff
--- a/src/imap/cmd-append.c	Sun Aug 12 16:34:37 2007 +0300
+++ b/src/imap/cmd-append.c	Sun Aug 12 16:43:05 2007 +0300
@@ -441,7 +441,7 @@
 	return box;
 }
 
-static int get_keywords(struct cmd_append_context *ctx)
+static void get_keywords(struct cmd_append_context *ctx)
 {
 	struct client *client = ctx->client;
 	struct mailbox_status status;
@@ -450,10 +450,7 @@
 	   client_parse_mail_flags()'s keyword verification works.
 	   however if we're not appending to selected mailbox, we'll
 	   need to restore the keywords list. */
-	if (mailbox_get_status(ctx->box, STATUS_KEYWORDS,
-			       &status) < 0)
-		return -1;
-
+	mailbox_get_status(ctx->box, STATUS_KEYWORDS, &status);
 	if (ctx->box != client->mailbox) {
 		ctx->old_keywords = client->keywords;
 
@@ -462,7 +459,6 @@
 			pool_alloconly_create("append keywords pool", 256);
 	}
 	client_save_keywords(&client->keywords, status.keywords);
-	return 0;
 }
 
 bool cmd_append(struct client_command_context *cmd)
@@ -487,15 +483,10 @@
 	else {
 		ctx->storage = mailbox_get_storage(ctx->box);
 
-		if (get_keywords(ctx) < 0) {
-			client_send_storage_error(cmd, ctx->storage);
-			mailbox_close(&ctx->box);
-			ctx->failed = TRUE;
-		} else {
-			ctx->t = mailbox_transaction_begin(ctx->box,
+		get_keywords(ctx);
+		ctx->t = mailbox_transaction_begin(ctx->box,
 					MAILBOX_TRANSACTION_FLAG_EXTERNAL |
 					MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS);
-		}
 	}
 
 	io_remove(&client->io);