From: Wayne Davison Date: Thu, 28 May 2020 18:40:52 +0000 (-0700) Subject: Switch to using LZ4_compress_default(). X-Git-Tag: v3.2.0pre1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7f10de4426375fc721ecd815ceddae7766c6598;p=thirdparty%2Frsync.git Switch to using LZ4_compress_default(). --- 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);