Timeout Issues

Wayne Davison wayned at samba.org
Fri Dec 31 00:33:46 GMT 2004


On Thu, Dec 30, 2004 at 11:23:07PM -0000, Stephen Schembri wrote:
> By default the timeout value is supposed to be 60 according to io.c, but
> in loadparam.c it is stating a value of 0 - is this statement correct?

The comment in io.c says that the default select() timeout is 60 secs,
which is not the same as the default rsync timeout value (which is 0,
meaning that rsync doesn't timeout).

> If I declare a timeout value of "timeout=20" in the config file, the
> value is ignored and the value of 60 seconds is always used.

The attached patch should fix this.

> Hope you have a Happy New Year and most of all, keep up the excellent
> work.

Thanks!

..wayne..
-------------- next part --------------
--- clientserver.c	8 Dec 2004 17:11:15 -0000	1.134
+++ clientserver.c	31 Dec 2004 00:24:07 -0000
@@ -43,6 +43,7 @@ extern int filesfrom_fd;
 extern int remote_protocol;
 extern int protocol_version;
 extern int io_timeout;
+extern int select_timeout;
 extern int orig_umask;
 extern int no_detach;
 extern int default_af_hint;
@@ -476,8 +477,11 @@ static int rsync_module(int f_in, int f_
 		exit_cleanup(RERR_UNSUPPORTED);
 	}
 
-	if (lp_timeout(i))
+	if (lp_timeout(i)) {
 		io_timeout = lp_timeout(i);
+		if (io_timeout && io_timeout < select_timeout)
+			select_timeout = io_timeout;
+	}
 
 	start_server(f_in, f_out, argc, argp);
 


More information about the rsync mailing list