[dovecot-cvs] dovecot/src/pop3 client.c,1.76,1.77

tss at dovecot.org tss at dovecot.org
Sun May 13 20:11:08 EEST 2007


Update of /var/lib/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv20721/pop3

Modified Files:
	client.c 
Log Message:
Error handling rewrite.



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/client.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- client.c	13 May 2007 15:53:27 -0000	1.76
+++ client.c	13 May 2007 17:11:04 -0000	1.77
@@ -130,7 +130,7 @@
 	struct client *client;
         enum mailbox_open_flags flags;
 	const char *errmsg;
-	bool temporary_error;
+	enum mail_error error;
 
 	/* always use nonblocking I/O */
 	net_set_nonblock(fd_in, TRUE);
@@ -169,7 +169,7 @@
 	if (client->mailbox == NULL) {
 		errmsg = t_strdup_printf("Couldn't open INBOX: %s",
 				mail_storage_get_last_error(storage,
-							    &temporary_error));
+							    &error));
 		i_error("%s", errmsg);
 		client_send_line(client, "-ERR [IN-USE] %s", errmsg);
 		client_destroy(client, "Couldn't open INBOX");
@@ -178,7 +178,7 @@
 
 	if (!init_mailbox(client)) {
 		i_error("Couldn't init INBOX: %s",
-			mail_storage_get_last_error(storage, &temporary_error));
+			mail_storage_get_last_error(storage, &error));
 		client_destroy(client, "Mailbox init failed");
 		return NULL;
 	}
@@ -331,8 +331,7 @@
 
 void client_send_storage_error(struct client *client)
 {
-	const char *error;
-	bool temporary_error;
+	enum mail_error error;
 
 	if (mailbox_is_inconsistent(client->mailbox)) {
 		client_send_line(client, "-ERR Mailbox is in inconsistent "
@@ -341,10 +340,9 @@
 		return;
 	}
 
-	error = mail_storage_get_last_error(client->inbox_ns->storage,
-					    &temporary_error);
-	client_send_line(client, "-ERR %s", error != NULL ? error :
-			 "BUG: Unknown error");
+	client_send_line(client, "-ERR %s",
+			 mail_storage_get_last_error(client->inbox_ns->storage,
+						     &error));
 }
 
 static void client_input(struct client *client)



More information about the dovecot-cvs mailing list