diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-07-19 09:33:03 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-07-19 09:33:04 -0700 |
commit | eb4f4076aa89d38221ee513a5f28f22124029c90 (patch) | |
tree | 8617f31f2dada1ec300dff9427f92ba00ea95500 /remote-curl.c | |
parent | Merge branch 'ak/gcc46-profile-feedback' (diff) | |
parent | zlib: allow feeding more than 4GB in one go (diff) | |
download | tgif-eb4f4076aa89d38221ee513a5f28f22124029c90.tar.xz |
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.c | 14 |
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); |