summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-16 18:23:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-16 18:23:26 (GMT)
commita35d78c0f483a65ea96c4f0c9a825bf28a386273 (patch)
treea20407fc5fbce3b190a364d10c47d807433ec9a5 /remote-curl.c
parent184cb4d6899a2644b07c11bef71df869a851f525 (diff)
parente01503b523e79748ac91d876f506811c597d03cb (diff)
downloadgit-a35d78c0f483a65ea96c4f0c9a825bf28a386273.zip
git-a35d78c0f483a65ea96c4f0c9a825bf28a386273.tar.gz
git-a35d78c0f483a65ea96c4f0c9a825bf28a386273.tar.bz2
Merge branch 'jc/zlib-wrap' into maint
* 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
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 8ac5028..69831e9 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -473,16 +473,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;
@@ -490,11 +486,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);