[dovecot-cvs] dovecot/src/imap cmd-append.c,1.27,1.28 cmd-copy.c,1.7,1.8 cmd-select.c,1.19,1.20 cmd-status.c,1.12,1.13 common.h,1.8,1.9 main.c,1.37,1.38

cras at procontrol.fi cras at procontrol.fi
Tue Jul 15 22:26:45 EEST 2003


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

Modified Files:
	cmd-append.c cmd-copy.c cmd-select.c cmd-status.c common.h 
	main.c 
Log Message:
index_mmap_invalidate = yes now invalidate memory maps before accessing
them. Setting this on should fix some problems with OpenBSD. It should also
make it possible to use index files over NFS as long as lock daemon is used.
It might be such a good idea however.



Index: cmd-append.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- cmd-append.c	2 Jul 2003 00:57:24 -0000	1.27
+++ cmd-append.c	15 Jul 2003 18:26:42 -0000	1.28
@@ -67,7 +67,8 @@
 		return TRUE;
 
 	box = client->storage->open_mailbox(client->storage,
-					    mailbox, FALSE, TRUE);
+					    mailbox, mailbox_open_flags |
+					    MAILBOX_OPEN_FAST);
 	if (box == NULL) {
 		client_send_storage_error(client);
 		return TRUE;

Index: cmd-copy.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-copy.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cmd-copy.c	15 Jun 2003 03:42:28 -0000	1.7
+++ cmd-copy.c	15 Jul 2003 18:26:42 -0000	1.8
@@ -21,7 +21,8 @@
 		return TRUE;
 
 	destbox = client->storage->open_mailbox(client->storage,
-						mailbox, FALSE, TRUE);
+						mailbox, mailbox_open_flags |
+						MAILBOX_OPEN_FAST);
 	if (destbox == NULL) {
 		client_send_storage_error(client);
 		return TRUE;

Index: cmd-select.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-select.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- cmd-select.c	17 Mar 2003 04:43:20 -0000	1.19
+++ cmd-select.c	15 Jul 2003 18:26:42 -0000	1.20
@@ -7,6 +7,7 @@
 {
 	struct mailbox *box;
 	struct mailbox_status status;
+	enum mailbox_open_flags flags;
 	const char *mailbox;
 
 	/* <mailbox> */
@@ -20,8 +21,10 @@
                         client_send_untagged_storage_error(client);
 	}
 
-	box = client->storage->open_mailbox(client->storage, mailbox,
-					    readonly, FALSE);
+	flags = mailbox_open_flags;
+	if (readonly)
+		flags |= MAILBOX_OPEN_READONLY;
+	box = client->storage->open_mailbox(client->storage, mailbox, flags);
 	if (box == NULL) {
 		client_send_storage_error(client);
 		return TRUE;

Index: cmd-status.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-status.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cmd-status.c	23 Jun 2003 18:22:48 -0000	1.12
+++ cmd-status.c	15 Jul 2003 18:26:42 -0000	1.13
@@ -65,7 +65,10 @@
 	} else {
 		/* open the mailbox */
 		box = client->storage->open_mailbox(client->storage,
-						    mailbox, TRUE, TRUE);
+						    mailbox,
+						    mailbox_open_flags |
+						    MAILBOX_OPEN_FAST |
+						    MAILBOX_OPEN_READONLY);
 		if (box == NULL)
 			return FALSE;
 	}

Index: common.h
===================================================================
RCS file: /home/cvs/dovecot/src/imap/common.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- common.h	2 Jul 2003 00:57:24 -0000	1.8
+++ common.h	15 Jul 2003 18:26:42 -0000	1.9
@@ -17,6 +17,7 @@
 extern struct ioloop *ioloop;
 extern unsigned int max_custom_flag_length, mailbox_check_interval;
 extern unsigned int imap_max_line_length;
+extern enum mailbox_open_flags mailbox_open_flags;
 
 extern string_t *capability_string;
 

Index: main.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/main.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- main.c	5 Jul 2003 20:33:19 -0000	1.37
+++ main.c	15 Jul 2003 18:26:42 -0000	1.38
@@ -24,6 +24,7 @@
 struct ioloop *ioloop;
 unsigned int max_custom_flag_length, mailbox_check_interval;
 unsigned int imap_max_line_length;
+enum mailbox_open_flags mailbox_open_flags;
 
 static struct module *modules;
 static char log_prefix[128]; /* syslog() needs this to be permanent */
@@ -146,6 +147,9 @@
 	str = getenv("MAILBOX_CHECK_INTERVAL");
 	mailbox_check_interval = str == NULL ? 0 :
 		(unsigned int)strtoul(str, NULL, 10);
+
+	mailbox_open_flags = getenv("MMAP_INVALIDATE") != NULL ?
+		MAILBOX_OPEN_MMAP_INVALIDATE : 0;
 
 	client = client_create(hin, hout, storage);
 



More information about the dovecot-cvs mailing list