[dovecot-cvs] dovecot/src/imap cmd-copy.c,1.35.2.1,1.35.2.2

tss at dovecot.org tss at dovecot.org
Fri May 11 20:31:48 EEST 2007


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv13799

Modified Files:
      Tag: branch_1_0
	cmd-copy.c 
Log Message:
We sent "Hang in there.." too early sometimes and checked it too often.



Index: cmd-copy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-copy.c,v
retrieving revision 1.35.2.1
retrieving revision 1.35.2.2
diff -u -d -r1.35.2.1 -r1.35.2.2
--- cmd-copy.c	21 Mar 2007 19:19:48 -0000	1.35.2.1
+++ cmd-copy.c	11 May 2007 17:31:46 -0000	1.35.2.2
@@ -12,13 +12,14 @@
 
 static void client_send_sendalive_if_needed(struct client *client)
 {
-	time_t now;
+	time_t now, last_io;
 
 	if (o_stream_get_buffer_used_size(client->output) != 0)
 		return;
 
 	now = time(NULL);
-	if (now - client->last_output > MAIL_STORAGE_STAYALIVE_SECS) {
+	last_io = I_MAX(client->last_input, client->last_output);
+	if (now - last_io > MAIL_STORAGE_STAYALIVE_SECS) {
 		o_stream_send_str(client->output, "* OK Hang in there..\r\n");
 		o_stream_flush(client->output);
 		client->last_output = now;
@@ -49,7 +50,7 @@
 			break;
 		}
 
-		if ((++copy_count % COPY_CHECK_INTERVAL) != 0)
+		if ((++copy_count % COPY_CHECK_INTERVAL) == 0)
 			client_send_sendalive_if_needed(client);
 
 		keywords_list = mail_get_keywords(mail);



More information about the dovecot-cvs mailing list