[dovecot-cvs] dovecot/src/imap cmd-copy.c,1.37,1.38

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


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

Modified Files:
	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.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cmd-copy.c	17 Apr 2007 17:19:40 -0000	1.37
+++ cmd-copy.c	11 May 2007 17:31:50 -0000	1.38
@@ -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;
@@ -56,7 +57,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