summaryrefslogtreecommitdiff
path: root/remote-curl.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 /remote-curl.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 'remote-curl.c')
-rw-r--r--remote-curl.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/remote-curl.c b/remote-curl.c
index b5be25ce96..faaeda44a9 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -471,16 +471,12 @@ static int post_rpc(struct rpc_state *rpc)
* the transfer time.
*/
size_t size;
- z_stream stream;
+ git_zstream stream;
int ret;
memset(&stream, 0, sizeof(stream));
- ret = deflateInit2(&stream, Z_BEST_COMPRESSION,
- Z_DEFLATED, (15 + 16),
- 8, Z_DEFAULT_STRATEGY);
- if (ret != Z_OK)
- die("cannot deflate request; zlib init error %d", ret);
- size = deflateBound(&stream, rpc->len);
+ git_deflate_init_gzip(&stream, Z_BEST_COMPRESSION);
+ size = git_deflate_bound(&stream, rpc->len);
gzip_body = xmalloc(size);
stream.next_in = (unsigned char *)rpc->buf;
@@ -488,11 +484,11 @@ static int post_rpc(struct rpc_state *rpc)
stream.next_out = (unsigned char *)gzip_body;
stream.avail_out = size;
- ret = deflate(&stream, Z_FINISH);
+ ret = git_deflate(&stream, Z_FINISH);
if (ret != Z_STREAM_END)
die("cannot deflate request; zlib deflate error %d", ret);
- ret = deflateEnd(&stream);
+ ret = git_deflate_end_gently(&stream);
if (ret != Z_OK)
die("cannot deflate request; zlib end error %d", ret);