[dovecot-cvs] dovecot/src/imap cmd-close.c,1.3,1.4 cmd-search.c,1.10,1.11 commands-util.c,1.12,1.13

cras at procontrol.fi cras at procontrol.fi
Thu Jan 2 12:21:43 EET 2003


Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv21738/imap

Modified Files:
	cmd-close.c cmd-search.c commands-util.c 
Log Message:
Storage can now specify if errors should be sent to user as BAD or NO.
Some changes to messageset parsing as specified by latest IMAP4rev1 draft.
Bad charset error is prefixed with [BADCHARSET]. Fixed a crash in SEARCH the
last commit in it caused.



Index: cmd-close.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-close.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cmd-close.c	2 Nov 2002 20:10:20 -0000	1.3
+++ cmd-close.c	2 Jan 2003 10:21:41 -0000	1.4
@@ -5,8 +5,12 @@
 
 static void client_send_untagged_storage_error(Client *client)
 {
-	client_send_line(client, t_strconcat("* NO ",
-		client->storage->get_last_error(client->storage), NULL));
+	const char *error;
+	int syntax;
+
+	error = client->storage->get_last_error(client->storage, &syntax);
+	client_send_line(client,
+			 t_strconcat(syntax ? "* BAD " : "* NO ", error, NULL));
 }
 
 int cmd_close(Client *client)

Index: cmd-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-search.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cmd-search.c	2 Jan 2003 08:09:26 -0000	1.10
+++ cmd-search.c	2 Jan 2003 10:21:41 -0000	1.11
@@ -52,8 +52,11 @@
 		if (client->mailbox->search(client->mailbox, charset,
 					    sargs, NULL,
 					    client->output, client->cmd_uid)) {
-			/* NOTE: syncing isn't allowed here */
-			client_sync_without_expunges(client);
+			/* NOTE: syncing is allowed when returning UIDs */
+			if (client->cmd_uid)
+				client_sync_full(client);
+			else
+				client_sync_without_expunges(client);
 			client_send_tagline(client, "OK Search completed.");
 		} else {
 			client_send_storage_error(client);

Index: commands-util.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/commands-util.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- commands-util.c	2 Jan 2003 08:09:26 -0000	1.12
+++ commands-util.c	2 Jan 2003 10:21:41 -0000	1.13
@@ -98,6 +98,9 @@
 
 void client_send_storage_error(Client *client)
 {
+	const char *error;
+	int syntax;
+
 	if (client->mailbox != NULL &&
 	    client->mailbox->is_inconsistency_error(client->mailbox)) {
 		/* we can't do forced CLOSE, so have to disconnect */
@@ -107,8 +110,9 @@
 		return;
 	}
 
-	client_send_tagline(client, t_strconcat("NO ",
-		client->storage->get_last_error(client->storage), NULL));
+	error = client->storage->get_last_error(client->storage, &syntax);
+	client_send_tagline(client, t_strconcat(syntax ? "BAD " : "NO ",
+						error, NULL));
 }
 
 int client_parse_mail_flags(Client *client, ImapArg *args, size_t args_count,




More information about the dovecot-cvs mailing list