]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Switch to using LZ4_compress_default().
authorWayne Davison <wayne@opencoder.net>
Thu, 28 May 2020 18:40:52 +0000 (11:40 -0700)
committerWayne Davison <wayne@opencoder.net>
Thu, 28 May 2020 18:40:52 +0000 (11:40 -0700)
configure.ac
token.c

index 2b65ef9dd0acef1d069ff1e7f2a16de7433c38b0..fc112875899f202d895cc78dc7430a3c442d1cd1 100644 (file)
@@ -427,7 +427,7 @@ AH_TEMPLATE([SUPPORT_LZ4],
 [Undefine if you do not want LZ4 compression.  By default this is defined.])
 if test x"$enable_lz4" != x"no" && test x"$ac_cv_header_lz4_h" = x"yes"; then
     AC_MSG_RESULT(yes)
-    AC_SEARCH_LIBS(LZ4_compress, lz4, [AC_DEFINE(SUPPORT_LZ4)])
+    AC_SEARCH_LIBS(LZ4_compress_default, lz4, [AC_DEFINE(SUPPORT_LZ4)])
 else
     AC_MSG_RESULT(no)
 fi
diff --git a/token.c b/token.c
index f92b9b5b4e649c1a92006ecc94eb641ec34142fc..bea37f213107ef6d2e29657c1f6def6c78c65c90 100644 (file)
--- a/token.c
+++ b/token.c
@@ -692,7 +692,7 @@ static void send_zstd_token(int f, int32 token, struct map_struct *buf,
                        exit_cleanup(RERR_PROTOCOL);
                }
 
-               obuf = new_array(char, MAX_DATA_COUNT + 2);
+               obuf = new_array(char, OBUF_SIZE);
                if (!obuf)
                        out_of_memory("send_deflated_token");
 
@@ -946,7 +946,7 @@ send_compressed_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
                        } else
                                available_in /= 2;
 
-                       available_out = LZ4_compress(next_in, next_out, available_in);
+                       available_out = LZ4_compress_default(next_in, next_out, available_in, size - 2);
                        if (!available_out) {
                                rprintf(FERROR, "compress returned %d\n", available_out);
                                exit_cleanup(RERR_STREAMIO);