[dovecot-cvs] dovecot/src/master log.c,1.2,1.3

cras at dovecot.org cras at dovecot.org
Tue Oct 19 03:42:09 EEST 2004


Update of /var/lib/cvs/dovecot/src/master
In directory talvi:/tmp/cvs-serv16397

Modified Files:
	log.c 
Log Message:
Log flushing fixes.



Index: log.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/log.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- log.c	23 May 2004 19:23:57 -0000	1.2
+++ log.c	19 Oct 2004 00:42:07 -0000	1.3
@@ -21,6 +21,7 @@
 	char *prefix;
 	char next_log_type;
 	unsigned int throttle_msg:1;
+	unsigned int destroying:1;
 };
 
 static struct log_io *log_ios;
@@ -113,7 +114,8 @@
 	if (!continues)
 		log_io->next_log_type = '\0';
 
-	if (++log_io->log_counter > MAX_LOG_MESSAGS_PER_SEC) {
+	if (++log_io->log_counter > MAX_LOG_MESSAGS_PER_SEC &&
+	    !log_io->destroying) {
 		log_throttle(log_io);
 		return 0;
 	}
@@ -196,6 +198,10 @@
 	size_t size;
 
 	/* if there was something in buffer, write it */
+	log_io->destroying = TRUE;
+	(void)log_write_pending(log_io);
+
+	/* write partial data as well */
 	data = i_stream_get_data(log_io->stream, &size);
 	if (size != 0) {
 		t_push();



More information about the dovecot-cvs mailing list