[dovecot-cvs] dovecot/src/plugins/acl acl-backend-vfile.c, 1.16, 1.17

tss at dovecot.org tss at dovecot.org
Wed Apr 11 20:40:20 EEST 2007


Update of /var/lib/cvs/dovecot/src/plugins/acl
In directory talvi:/tmp/cvs-serv1988

Modified Files:
	acl-backend-vfile.c 
Log Message:
cache_secs fixes



Index: acl-backend-vfile.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/acl/acl-backend-vfile.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- acl-backend-vfile.c	11 Apr 2007 11:02:31 -0000	1.16
+++ acl-backend-vfile.c	11 Apr 2007 17:40:18 -0000	1.17
@@ -16,10 +16,8 @@
 
 #define ACL_FILENAME "dovecot-acl"
 
-/* Time difference to allow between this system's time and file server's time */
-#define ACL_SYNC_SECS 1
-
 #define ACL_ESTALE_RETRY_COUNT NFS_ESTALE_RETRY_COUNT
+#define ACL_VFILE_DEFAULT_CACHE_SECS (60*5)
 
 struct acl_vfile_validity {
 	time_t last_check;
@@ -85,6 +83,7 @@
 	t_push();
 	tmp = t_strsplit(data, ":");
 	backend->global_dir = p_strdup_empty(_backend->pool, *tmp);
+	backend->cache_secs = ACL_VFILE_DEFAULT_CACHE_SECS;
 
 	while (*++tmp != NULL) {
 		if (strncmp(*tmp, "cache_secs=", 11) == 0)
@@ -416,8 +415,10 @@
 		   do it only after a couple of seconds so we don't
 		   keep re-reading it all the time within those
 		   seconds) */
-		if (st.st_mtime < validity->last_read_time - ACL_SYNC_SECS ||
-		    ioloop_time - validity->last_read_time <= ACL_SYNC_SECS)
+		unsigned int cache_secs = backend->cache_secs;
+
+		if (st.st_mtime < validity->last_read_time - cache_secs ||
+		    ioloop_time - validity->last_read_time <= cache_secs)
 			return 0;
 	}
 



More information about the dovecot-cvs mailing list