From c7f10de4426375fc721ecd815ceddae7766c6598 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 28 May 2020 11:40:52 -0700 Subject: [PATCH] Switch to using LZ4_compress_default(). --- configure.ac | 2 +- token.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 2b65ef9d..fc112875 100644 --- a/configure.ac +++ b/configure.ac @@ -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 f92b9b5b..bea37f21 100644 --- 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); -- 2.47.2