[SCM] The rsync repository. - branch master updated
Rsync CVS commit messages
rsync-cvs at lists.samba.org
Mon Nov 21 10:36:59 MST 2011
The branch, master has been updated
via 7da1714 Add compatibility with an unmodified zlib.
via cbdff74 Fix --compress data-duplication bug.
via 37a7297 Fix version expansion.
from 8dd6ea1 Fix --delete-missing-args when --relative is active.
;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 7da17144fd764a2420a8d08897475c0b7fdbf956
Author: Wayne Davison <wayned at samba.org>
Date: Mon Nov 21 09:22:14 2011 -0800
Add compatibility with an unmodified zlib.
commit cbdff74b44b25ce713739b9c1fb4db67610c675e
Author: Wayne Davison <wayned at samba.org>
Date: Mon Nov 21 09:13:11 2011 -0800
Fix --compress data-duplication bug.
commit 37a729768bda9a29c69d69f7fbabeaa272b21685
Author: Wayne Davison <wayned at samba.org>
Date: Mon Nov 21 09:10:49 2011 -0800
Fix version expansion.
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 6 +++---
batch.c | 2 +-
configure.ac | 26 +++++++++++++++++++++++++-
options.c | 2 +-
rsync.h | 2 +-
token.c | 29 ++++++++++++++++++++---------
6 files changed, 51 insertions(+), 16 deletions(-)
Changeset truncated at 500 lines:
diff --git a/Makefile.in b/Makefile.in
index e3ee747..1b603b5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,7 +21,7 @@ srcdir=@srcdir@
VPATH=$(srcdir)
SHELL=/bin/sh
-VERSION=@VERSION@
+VERSION=@RSYNC_VERSION@
.SUFFIXES:
.SUFFIXES: .c .o
@@ -31,7 +31,7 @@ HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h
lib/pool_alloc.h
LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
-ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
+zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
util.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
@@ -41,7 +41,7 @@ OBJS3=progress.o pipe.o
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
popt/popthelp.o popt/poptparse.o
-OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
+OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@
TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
diff --git a/batch.c b/batch.c
index b63f0c5..78d567d 100644
--- a/batch.c
+++ b/batch.c
@@ -20,7 +20,7 @@
*/
#include "rsync.h"
-#include "zlib/zlib.h"
+#include <zlib.h>
#include <time.h>
extern int eol_nulls;
diff --git a/configure.ac b/configure.ac
index 58aeea0..9e6b555 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,9 @@ fi
AC_ARG_WITH(included-popt,
AC_HELP_STRING([--with-included-popt], [use bundled popt library, not from system]))
+AC_ARG_WITH(included-zlib,
+ AC_HELP_STRING([--with-included-zlib], [use bundled zlib library, not from system]))
+
AC_ARG_WITH(protected-args,
AC_HELP_STRING([--with-protected-args], [make --protected-args option the default]))
if test x"$with_protected_args" = x"yes"; then
@@ -343,7 +346,8 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
sys/un.h sys/attr.h mcheck.h arpa/inet.h arpa/nameser.h locale.h \
netdb.h malloc.h float.h limits.h iconv.h libcharset.h langinfo.h \
sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h \
- popt.h popt/popt.h linux/falloc.h netinet/in_systm.h netinet/ip.h)
+ popt.h popt/popt.h linux/falloc.h netinet/in_systm.h netinet/ip.h \
+ zlib.h)
AC_HEADER_MAJOR
AC_CACHE_CHECK([if makedev takes 3 args],rsync_cv_MAKEDEV_TAKES_3_ARGS,[
@@ -773,6 +777,25 @@ else
AC_MSG_RESULT(no)
fi
+# We default to using our zlib unless --with-included-zlib=no is given.
+if test x"$with_included_zlib" != x"no"; then
+ with_included_zlib=yes
+elif test x"$ac_cv_header_zlib_h" != x"yes"; then
+ with_included_zlib=yes
+fi
+if test x"$with_included_zlib" != x"yes"; then
+ AC_CHECK_LIB(z, deflateParams, , [with_included_zlib=yes])
+fi
+
+AC_MSG_CHECKING([whether to use included zlib])
+if test x"$with_included_zlib" = x"yes"; then
+ AC_MSG_RESULT($srcdir/zlib)
+ BUILD_ZLIB='$(zlib_OBJS)'
+ CFLAGS="$CFLAGS -I$srcdir/zlib"
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_CACHE_CHECK([for unsigned char],rsync_cv_SIGNED_CHAR_OK,[
AC_TRY_COMPILE([],[signed char *s = ""],
rsync_cv_SIGNED_CHAR_OK=yes,rsync_cv_SIGNED_CHAR_OK=no)])
@@ -926,6 +949,7 @@ AC_SUBST(OBJ_SAVE)
AC_SUBST(OBJ_RESTORE)
AC_SUBST(CC_SHOBJ_FLAG)
AC_SUBST(BUILD_POPT)
+AC_SUBST(BUILD_ZLIB)
AC_SUBST(MAKE_MAN)
AC_CHECK_FUNCS(_acl __acl _facl __facl)
diff --git a/options.c b/options.c
index d32376f..e8db07c 100644
--- a/options.c
+++ b/options.c
@@ -22,7 +22,7 @@
#include "rsync.h"
#include "itypes.h"
#include <popt.h>
-#include "zlib/zlib.h"
+#include <zlib.h>
extern int module_id;
extern int local_server;
diff --git a/rsync.h b/rsync.h
index 57e3d79..0c958c6 100644
--- a/rsync.h
+++ b/rsync.h
@@ -103,7 +103,7 @@
/* This is used when working on a new protocol version in CVS, and should
* be a new non-zero value for each CVS change that affects the protocol.
* It must ALWAYS be 0 when the protocol goes final (and NEVER before)! */
-#define SUBPROTOCOL_VERSION 13
+#define SUBPROTOCOL_VERSION 14
/* We refuse to interoperate with versions that are not in this range.
* Note that we assume we'll work with later versions: the onus is on
diff --git a/token.c b/token.c
index 75d2b17..7628e2e 100644
--- a/token.c
+++ b/token.c
@@ -21,9 +21,14 @@
#include "rsync.h"
#include "itypes.h"
-#include "zlib/zlib.h"
+#include <zlib.h>
+
+#ifndef Z_INSERT_ONLY
+#define Z_INSERT_ONLY Z_SYNC_FLUSH
+#endif
extern int do_compression;
+extern int protocol_version;
extern int module_id;
extern int def_compress_level;
extern char *skip_compress;
@@ -411,14 +416,18 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
toklen -= n1;
tx_strm.next_in = (Bytef *)map_ptr(buf, offset, n1);
tx_strm.avail_in = n1;
- tx_strm.next_out = (Bytef *) obuf;
- tx_strm.avail_out = AVAIL_OUT_SIZE(CHUNK_SIZE);
- r = deflate(&tx_strm, Z_INSERT_ONLY);
- if (r != Z_OK || tx_strm.avail_in != 0) {
- rprintf(FERROR, "deflate on token returned %d (%d bytes left)\n",
- r, tx_strm.avail_in);
- exit_cleanup(RERR_STREAMIO);
- }
+ if (protocol_version >= 31) /* Newer protocols avoid a data-duplicating bug */
+ offset += n1;
+ do {
+ tx_strm.next_out = (Bytef *) obuf;
+ tx_strm.avail_out = AVAIL_OUT_SIZE(CHUNK_SIZE);
+ r = deflate(&tx_strm, Z_INSERT_ONLY);
+ if (r != Z_OK) {
+ rprintf(FERROR, "deflate on token returned %d (%d bytes left)\n",
+ r, tx_strm.avail_in);
+ exit_cleanup(RERR_STREAMIO);
+ }
+ } while (tx_strm.avail_in != 0);
} while (toklen > 0);
}
}
@@ -593,6 +602,8 @@ static void see_deflate_token(char *buf, int32 len)
} else {
rx_strm.next_in = (Bytef *)buf;
rx_strm.avail_in = blklen;
+ if (protocol_version >= 31) /* Newer protocols avoid a data-duplicating bug */
+ buf += blklen;
len -= blklen;
blklen = 0;
}
--
The rsync repository.
More information about the rsync-cvs
mailing list