summaryrefslogtreecommitdiff
path: root/rdiff-backup/src
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-15 23:17:24 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-15 23:17:24 +0000
commitc3beb4a2425f1ca142f1c773ca8205399b48c993 (patch)
tree11631cdfa3528e8c19b4a43a3eaf2d25c7716d1d /rdiff-backup/src
parent036ee5fc7e9a99ceb9e5f8661b76c092bb052e53 (diff)
downloadrdiff-backup-c3beb4a2425f1ca142f1c773ca8205399b48c993.tar.gz
Enabled ssh compression by default, increased conn_bufsize.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@88 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/src')
-rw-r--r--rdiff-backup/src/globals.py5
-rwxr-xr-xrdiff-backup/src/main.py7
-rw-r--r--rdiff-backup/src/rpath.py10
-rw-r--r--rdiff-backup/src/setconnections.py8
4 files changed, 20 insertions, 10 deletions
diff --git a/rdiff-backup/src/globals.py b/rdiff-backup/src/globals.py
index 58c43d4..508d0ed 100644
--- a/rdiff-backup/src/globals.py
+++ b/rdiff-backup/src/globals.py
@@ -20,7 +20,7 @@ class Globals:
# This is used by the BufferedRead class to determine how many
# bytes to request from the underlying file per read(). Larger
# values may save on connection overhead and latency.
- conn_bufsize = 4096
+ conn_bufsize = 98304
# True if script is running as a server
server = None
@@ -139,6 +139,9 @@ class Globals:
"jpg|gif|png|jp2|mp3|ogg|avi|wmv|mpeg|mpg|rm|mov)$"
no_compression_regexp = None
+ # Determines whether or not ssh will be run with the -C switch
+ ssh_compression = 1
+
# On the reader and writer connections, the following will be
# replaced by the source and mirror Select objects respectively.
select_source, select_mirror = None, None
diff --git a/rdiff-backup/src/main.py b/rdiff-backup/src/main.py
index 72d93ce..a6c1ce0 100755
--- a/rdiff-backup/src/main.py
+++ b/rdiff-backup/src/main.py
@@ -36,8 +36,9 @@ class Main:
"parsable-output", "quoting-char=", "remote-cmd=",
"remote-schema=", "remove-older-than=",
"restore-as-of=", "resume", "resume-window=", "server",
- "terminal-verbosity=", "test-server", "verbosity",
- "version", "windows-mode", "windows-time-format"])
+ "ssh-no-compression", "terminal-verbosity=",
+ "test-server", "verbosity", "version", "windows-mode",
+ "windows-time-format"])
except getopt.error, e:
self.commandline_error("Bad commandline options: %s" % str(e))
@@ -100,6 +101,8 @@ class Main:
elif opt == '--resume-window':
Globals.set_integer('resume_window', arg)
elif opt == "-s" or opt == "--server": self.action = "server"
+ elif opt == "--ssh-no-compression":
+ Globals.set('ssh_compression', None)
elif opt == "--terminal-verbosity": Log.setterm_verbosity(arg)
elif opt == "--test-server": self.action = "test-server"
elif opt == "-V" or opt == "--version":
diff --git a/rdiff-backup/src/rpath.py b/rdiff-backup/src/rpath.py
index 5ed36f5..414268c 100644
--- a/rdiff-backup/src/rpath.py
+++ b/rdiff-backup/src/rpath.py
@@ -247,13 +247,13 @@ class RORPath(RPathStatic):
This object doesn't contain any information about the file,
but, when passed along, may show where the previous stages are
in their processing. It is the RORPath equivalent of fiber.
+ This placeholder size, in conjunction with the placeholder
+ threshold in Highlevel .. generate_dissimilar seem to yield an
+ OK tradeoff between unnecessary placeholders and lots of
+ memory usage, but I'm not sure exactly why.
"""
- self.data = {'placeholder':
- ("It is actually good for placeholders to use"
- "up a bit of memory, so the buffers get flushed"
- "more often when placeholders move through."
- "See the get_dissimilar docs for more info.")}
+ self.data = {'placeholder': " "*500}
def isplaceholder(self):
"""True if the object is a placeholder"""
diff --git a/rdiff-backup/src/setconnections.py b/rdiff-backup/src/setconnections.py
index 29665db..a32c68e 100644
--- a/rdiff-backup/src/setconnections.py
+++ b/rdiff-backup/src/setconnections.py
@@ -16,9 +16,10 @@ class SetConnections:
"""
# This is the schema that determines how rdiff-backup will open a
- # pipe to the remote system. If the file is given as A:B, %s will
+ # pipe to the remote system. If the file is given as A::B, %s will
# be substituted with A in the schema.
- __cmd_schema = 'ssh %s rdiff-backup --server'
+ __cmd_schema = 'ssh -C %s rdiff-backup --server'
+ __cmd_schema_no_compress = 'ssh %s rdiff-backup --server'
# This is a list of remote commands used to start the connections.
# The first is None because it is the local connection.
@@ -27,6 +28,9 @@ class SetConnections:
def InitRPs(cls, arglist, remote_schema = None, remote_cmd = None):
"""Map the given file descriptions into rpaths and return list"""
if remote_schema: cls.__cmd_schema = remote_schema
+ elif not Globals.ssh_compression:
+ cls.__cmd_schema = cls.__cmd_schema_no_compress
+
if not arglist: return []
desc_pairs = map(cls.parse_file_desc, arglist)