We have a local definition of zlib's compressBound which is not in
sync with recent versions of zlib. This may cause a "Compression of
svndiff data failed" message from the Subversion server when the
buffer provided to zlib is not large enough.
This reverts to using the zlib-provided version, since the old version
of zlib that was missing this function should be quite rare these
days.
---
subversion/libsvn_delta/svndiff.c |7 +--
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/subversion/libsvn_delta/svndiff.c
b/subversion/libsvn_delta/svndiff.c
index bf6afa9..c0187b5 100644
--- a/subversion/libsvn_delta/svndiff.c
+++ b/subversion/libsvn_delta/svndiff.c
@@ -31,11 +31,6 @@
#include "svn_private_config.h"
#include
-/* This macro is taken from zlib, and was originally the function
- compressBound. It shouldn't ever change, but once every millenium,
- it may be useful for someone to make sure. */
-#define svnCompressBound(LEN) ((LEN) + ((LEN) >> 12) + ((LEN) >> 14) + 11)
-
/* For svndiff1, address/instruction/new data under this size will not
be compressed using zlib as a secondary compressor. */
#define MIN_COMPRESS_SIZE 512
@@ -152,7 +147,7 @@ zlib_encode(const char *data, apr_size_t len,
svn_stringbuf_t *out)
}
else
{
- svn_stringbuf_ensure(out, svnCompressBound(len) + intlen);
+ svn_stringbuf_ensure(out, compressBound(len) + intlen);
endlen = out->blocksize;
if (compress2((unsigned char *)out->data + intlen, &endlen,
--
1.7.1