summaryrefslogtreecommitdiff
path: root/archive-zip.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-07-19 09:33:03 -0700
committerJunio C Hamano <gitster@pobox.com>2011-07-19 09:33:04 -0700
commiteb4f4076aa89d38221ee513a5f28f22124029c90 (patch)
tree8617f31f2dada1ec300dff9427f92ba00ea95500 /archive-zip.c
parentd37b2991b1edea76c01ec05cc383005b55c96e36 (diff)
parente01503b523e79748ac91d876f506811c597d03cb (diff)
downloadgit-eb4f4076aa89d38221ee513a5f28f22124029c90.tar.gz
Merge branch 'jc/zlib-wrap'
* jc/zlib-wrap: zlib: allow feeding more than 4GB in one go zlib: zlib can only process 4GB at a time zlib: wrap deflateBound() too zlib: wrap deflate side of the API zlib: wrap inflateInit2 used to accept only for gzip format zlib: wrap remaining calls to direct inflate/inflateEnd zlib wrapper: refactor error message formatter Conflicts: sha1_file.c
Diffstat (limited to 'archive-zip.c')
-rw-r--r--archive-zip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/archive-zip.c b/archive-zip.c
index cf285044e3..72d55a58ac 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -90,14 +90,14 @@ static void copy_le32(unsigned char *dest, unsigned int n)
static void *zlib_deflate(void *data, unsigned long size,
int compression_level, unsigned long *compressed_size)
{
- z_stream stream;
+ git_zstream stream;
unsigned long maxsize;
void *buffer;
int result;
memset(&stream, 0, sizeof(stream));
- deflateInit(&stream, compression_level);
- maxsize = deflateBound(&stream, size);
+ git_deflate_init(&stream, compression_level);
+ maxsize = git_deflate_bound(&stream, size);
buffer = xmalloc(maxsize);
stream.next_in = data;
@@ -106,7 +106,7 @@ static void *zlib_deflate(void *data, unsigned long size,
stream.avail_out = maxsize;
do {
- result = deflate(&stream, Z_FINISH);
+ result = git_deflate(&stream, Z_FINISH);
} while (result == Z_OK);
if (result != Z_STREAM_END) {
@@ -114,7 +114,7 @@ static void *zlib_deflate(void *data, unsigned long size,
return NULL;
}
- deflateEnd(&stream);
+ git_deflate_end(&stream);
*compressed_size = stream.total_out;
return buffer;