Problems with --bwlimit && --daemon

Marcelo Ricardo Leitner mrl at conectiva.com.br
Thu Nov 4 14:26:06 GMT 2004


Hi list,

I couldn't find anything related to this, on mailing lists or even bugzilla,
so here it is.
A problem with this combination exists in the new 2.6.3 where the bwlimit
code got rewritten and is not present at <= 2.6.2.

The problem is that on io.c:882 bwlimit_writemax is also used to control the
bandwidth, but it is not initialized for the daemon mode.

At options.c:772 you can see the function returning and a bit bellow, line
810, bwlimit_writemax gets initialized.

A quick fix I did, without many checkings, but working:

--- rsync-2.6.3/options.c.mrl	2004-09-23 14:39:05.000000000 -0300
+++ rsync-2.6.3/options.c	2004-11-04 12:16:27.408947256 -0200
@@ -769,6 +769,12 @@
 		}
 	}
 
+	if (bwlimit) {
+		bwlimit_writemax = (size_t)bwlimit * 128;
+		if (bwlimit_writemax < 512)
+			bwlimit_writemax = 512;
+	}
+
 	if (daemon_opt) {
 		daemon_opt = 0;
 		am_daemon = 1;
@@ -807,12 +813,6 @@
 	if (do_progress && !verbose)
 		verbose = 1;
 
-	if (bwlimit) {
-		bwlimit_writemax = (size_t)bwlimit * 128;
-		if (bwlimit_writemax < 512)
-			bwlimit_writemax = 512;
-	}
-
 	if (inplace) {
 #if HAVE_FTRUNCATE
 		if (partial_dir) {

Thanks for your time,
-- 
Marcelo Ricardo Leitner <mrl at conectiva.com.br>


More information about the rsync mailing list