Back out change that treated "refuse options = compress" the same as
authorDavid Dykstra <dwd@samba.org>
Wed, 25 Nov 1998 15:37:50 +0000 (15:37 +0000)
committerDavid Dykstra <dwd@samba.org>
Wed, 25 Nov 1998 15:37:50 +0000 (15:37 +0000)
"dont compress = *", by request of Tridge.  Instead, mention the difference
in the man page.  Also, put in a shortcut in set_compression() to recognize
"*" earlier instead of going through malloc/strtok/fnmatch/free cycle.

options.c
rsyncd.conf.yo
token.c

index 71a08f5..ca1b018 100644 (file)
--- a/options.c
+++ b/options.c
@@ -238,13 +238,6 @@ static int check_refuse_options(char *ref, int opt)
        while ((p = strstr(ref,name))) {
                if ((p==ref || p[-1]==' ') &&
                    (p[len] == ' ' || p[len] == 0)) {
        while ((p = strstr(ref,name))) {
                if ((p==ref || p[-1]==' ') &&
                    (p[len] == ' ' || p[len] == 0)) {
-                       if (opt == 'z') {
-                               /* don't actually refuse this one, just */
-                               /*  minimize the compression level for now */
-                               extern int default_compression_level;
-                               default_compression_level = 0;
-                               return 0;
-                       }
                        slprintf(err_buf,sizeof(err_buf),
                                 "The '%s' option is not supported by this server\n", name);
                        return 1;
                        slprintf(err_buf,sizeof(err_buf),
                                 "The '%s' option is not supported by this server\n", name);
                        return 1;
index 3dab4b8..8e2ca39 100644 (file)
@@ -1,5 +1,5 @@
 mailto(rsync-bugs@samba.org)
 mailto(rsync-bugs@samba.org)
-manpage(rsyncd.conf)(5)(24 Nov 1998)()()
+manpage(rsyncd.conf)(5)(25 Nov 1998)()()
 manpagename(rsyncd.conf)(configuration file for rsync server)
 manpagesynopsis()
 
 manpagename(rsyncd.conf)(configuration file for rsync server)
 manpagesynopsis()
 
@@ -302,12 +302,12 @@ a 10 minute timeout).
 
 dit(bf(refuse options)) The "refuse options" option allows you to
 specify a space separated list of rsync command line options that will
 
 dit(bf(refuse options)) The "refuse options" option allows you to
 specify a space separated list of rsync command line options that will
-be refused by your rsync server. When an option is refused the server
-prints an error message and exits, except for the "compress" option
-in which case the server silently sends all files uncompressed.
-
-The full names of the options must be used (ie. you must use
-"checksum" not "c" to disable checksumming).
+be refused by your rsync server.  The full names of the options must be
+used (i.e., you must use "checksum" not "c" to disable checksumming).  
+When an option is refused, the server prints an error message and exits.
+To prevent all compression, you can use "dont compress = *" (see below)
+instead of "refuse options = compress" to avoid returning an error to a
+client that requests compression.
 
 dit(bf(dont compress)) The "dont compress" option allows you to select
 filenames based on wildcard patterns that should not be compressed
 
 dit(bf(dont compress)) The "dont compress" option allows you to select
 filenames based on wildcard patterns that should not be compressed
diff --git a/token.c b/token.c
index 3bd8d34..2967b44 100644 (file)
--- a/token.c
+++ b/token.c
@@ -21,7 +21,6 @@
 #include "zlib/zlib.h"
 
 extern int do_compression;
 #include "zlib/zlib.h"
 
 extern int do_compression;
-int default_compression_level = Z_DEFAULT_COMPRESSION;
 static int compression_level = Z_DEFAULT_COMPRESSION;
 
 /* determine the compression level based on a wildcard filename list */
 static int compression_level = Z_DEFAULT_COMPRESSION;
 
 /* determine the compression level based on a wildcard filename list */
@@ -33,11 +32,17 @@ void set_compression(char *fname)
 
        if (!do_compression) return;
 
 
        if (!do_compression) return;
 
-       compression_level = default_compression_level;
+       compression_level = Z_DEFAULT_COMPRESSION;
        dont = lp_dont_compress(module_id);
 
        if (!dont || !*dont) return;
 
        dont = lp_dont_compress(module_id);
 
        if (!dont || !*dont) return;
 
+       if ((dont[0] == '*') && (!dont[1])) {
+               /* an optimization to skip the rest of this routine */
+               compression_level = 0;
+               return;
+       }
+
        dont = strdup(dont);
        fname = strdup(fname);
        if (!dont || !fname) return;
        dont = strdup(dont);
        fname = strdup(fname);
        if (!dont || !fname) return;