changeset 12840:2ac35ed2f943

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.
author Timo Sirainen <tss@iki.fi>
date Thu, 10 Mar 2011 15:56:46 +0200
parents 3b2c301ab31f
children 0405f4c507c9
files src/dsync/dsync-proxy-server.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }