- Try more in supporting all scenarios bsc#1046197#c24

* rsync-both-compressions.patch

OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=59
This commit is contained in:
Tomáš Chvátal 2017-07-25 11:55:46 +00:00 committed by Git OBS Bridge
parent beed298687
commit 89aa0785d4
3 changed files with 29 additions and 68 deletions

View File

@ -1,8 +1,8 @@
diff --git a/configure.ac b/configure.ac
index e01e124b..5a0b9bca 100644
index e01e124b..4ee4083e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -794,26 +794,23 @@ else
@@ -794,7 +794,8 @@ else
AC_MSG_RESULT(no)
fi
@ -12,27 +12,14 @@ index e01e124b..5a0b9bca 100644
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)
@@ -810,7 +811,6 @@ if test x"$with_included_zlib" = x"yes"; then
BUILD_ZLIB='$(zlib_OBJS)'
CFLAGS="-I$srcdir/zlib $CFLAGS"
-else
else
- AC_DEFINE(EXTERNAL_ZLIB, 1, [Define to 1 if using external zlib])
- AC_MSG_RESULT(no)
AC_MSG_RESULT(no)
fi
+AC_CHECK_LIB(z, deflateParams, , [AC_MSG_ERROR([zlib with deflateParams not found])])
+
AC_CACHE_CHECK([for unsigned char],rsync_cv_SIGNED_CHAR_OK,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char *s = ""]])],[rsync_cv_SIGNED_CHAR_OK=yes],[rsync_cv_SIGNED_CHAR_OK=no])])
if test x"$rsync_cv_SIGNED_CHAR_OK" = x"yes"; then
diff --git a/options.c b/options.c
index 64ec8b84..522875c5 100644
--- a/options.c
@ -55,19 +42,21 @@ index 64ec8b84..522875c5 100644
#ifdef HAVE_SETVBUF
diff --git a/token.c b/token.c
index ad9b9bcd..a1ceb975 100644
index ad9b9bcd..34bc331f 100644
--- a/token.c
+++ b/token.c
@@ -374,7 +374,7 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
}
if (nb == 0 && token != -2)
flush = Z_SYNC_FLUSH;
- r = deflate(&tx_strm, flush);
+ r = deflate_int(&tx_strm, flush);
if (r != Z_OK) {
rprintf(FERROR, "deflate returned %d\n", r);
exit_cleanup(RERR_STREAMIO);
@@ -405,7 +405,6 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
@@ -23,6 +23,10 @@
#include "itypes.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;
@@ -405,7 +409,6 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
} else if (token != -2 && do_compression == 1) {
/* Add the data in the current block to the compressor's
* history and hash table. */
@ -75,15 +64,7 @@ index ad9b9bcd..a1ceb975 100644
do {
/* Break up long sections in the same way that
* see_deflate_token() does. */
@@ -417,18 +416,13 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
offset += n1;
tx_strm.next_out = (Bytef *) obuf;
tx_strm.avail_out = AVAIL_OUT_SIZE(CHUNK_SIZE);
- r = deflate(&tx_strm, Z_INSERT_ONLY);
+ r = deflate_int(&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);
@@ -424,11 +427,6 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
exit_cleanup(RERR_STREAMIO);
}
} while (toklen > 0);
@ -95,7 +76,7 @@ index ad9b9bcd..a1ceb975 100644
}
}
@@ -579,7 +573,6 @@ static int32 recv_deflated_token(int f, char **data)
@@ -579,7 +577,6 @@ static int32 recv_deflated_token(int f, char **data)
*/
static void see_deflate_token(char *buf, int32 len)
{
@ -103,7 +84,7 @@ index ad9b9bcd..a1ceb975 100644
int r;
int32 blklen;
unsigned char hdr[5];
@@ -617,11 +610,6 @@ static void see_deflate_token(char *buf, int32 len)
@@ -617,11 +614,6 @@ static void see_deflate_token(char *buf, int32 len)
exit_cleanup(RERR_STREAMIO);
}
} while (len || rx_strm.avail_out == 0);
@ -115,29 +96,3 @@ index ad9b9bcd..a1ceb975 100644
}
/**
diff --git a/zlib/deflate.c b/zlib/deflate.c
index 529c5e8d..ba711897 100644
--- a/zlib/deflate.c
+++ b/zlib/deflate.c
@@ -664,7 +664,7 @@ local void flush_pending(strm)
}
/* ========================================================================= */
-int ZEXPORT deflate (strm, flush)
+int ZEXPORT deflate_int (strm, flush)
z_streamp strm;
int flush;
{
diff --git a/zlib/zlib.h b/zlib/zlib.h
index c4536ca7..ee98c332 100644
--- a/zlib/zlib.h
+++ b/zlib/zlib.h
@@ -244,7 +244,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
*/
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+ZEXTERN int ZEXPORT deflate_int OF((z_streamp strm, int flush));
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jul 25 11:55:53 UTC 2017 - tchvatal@suse.com
- Try more in supporting all scenarios bsc#1046197#c24
* rsync-both-compressions.patch
-------------------------------------------------------------------
Mon Jul 24 11:10:14 UTC 2017 - tchvatal@suse.com

View File

@ -64,7 +64,7 @@ for backups and mirroring and as an improved copy command for everyday use.
%prep
%setup -q -b 1
#rm -f zlib/*.h
rm -f zlib/*.h
patch -p1 < patches/acls.diff
patch -p1 < patches/xattrs.diff
patch -p1 < patches/slp.diff
@ -80,7 +80,7 @@ export CFLAGS="%{optflags} -fPIC -DPIC -fPIE"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
%configure \
--with-included-popt=no \
--with-included-zlib=yes \
--with-included-zlib=no \
--disable-debug \
--enable-slp \
--enable-acl-support \