dovecot-2.0: dsync: Reset idle timeouts at the end of i/o callba...

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 10 15:56:53 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/2ac35ed2f943
changeset: 12671:2ac35ed2f943
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 10 15:56:46 2011 +0200
description:
dsync: Reset idle timeouts at the end of i/o callbacks, not beginning.
This could make a difference if the callback runs for a long time.

diffstat:

 src/dsync/dsync-proxy-server.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 3b2c301ab31f -r 2ac35ed2f943 src/dsync/dsync-proxy-server.c
--- a/src/dsync/dsync-proxy-server.c	Wed Mar 09 20:22:52 2011 +0200
+++ b/src/dsync/dsync-proxy-server.c	Thu Mar 10 15:56:46 2011 +0200
@@ -108,7 +108,6 @@
 		return;
 	}
 
-	timeout_reset(server->to);
 	o_stream_cork(server->output);
 	while (proxy_server_read_line(server, &line) > 0) {
 		T_BEGIN {
@@ -123,6 +122,7 @@
 
 	if (ret < 0)
 		master_service_stop(master_service);
+	timeout_reset(server->to);
 }
 
 static int proxy_server_output(struct dsync_proxy_server *server)
@@ -130,7 +130,6 @@
 	struct ostream *output = server->output;
 	int ret;
 
-	timeout_reset(server->to);
 	if ((ret = o_stream_flush(output)) < 0)
 		ret = 1;
 	else if (server->cur_cmd != NULL) {
@@ -149,6 +148,7 @@
 	}
 	if (output->closed)
 		master_service_stop(master_service);
+	timeout_reset(server->to);
 	return ret;
 }
 


More information about the dovecot-cvs mailing list