shadowing: don't shadow the global compress
This commit is contained in:
parent
fb6afd01a1
commit
bef0ce5392
16
src/comp.c
16
src/comp.c
@ -134,7 +134,7 @@ comp_method_zlib_free(voidpf opaque, voidpf address)
|
|||||||
* All your bandwidth are belong to us (so save some)
|
* All your bandwidth are belong to us (so save some)
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
comp_method_zlib_init(LIBSSH2_SESSION * session, int compress,
|
comp_method_zlib_init(LIBSSH2_SESSION * session, int compr,
|
||||||
void **abstract)
|
void **abstract)
|
||||||
{
|
{
|
||||||
z_stream *strm;
|
z_stream *strm;
|
||||||
@ -151,7 +151,7 @@ comp_method_zlib_init(LIBSSH2_SESSION * session, int compress,
|
|||||||
strm->opaque = (voidpf) session;
|
strm->opaque = (voidpf) session;
|
||||||
strm->zalloc = (alloc_func) comp_method_zlib_alloc;
|
strm->zalloc = (alloc_func) comp_method_zlib_alloc;
|
||||||
strm->zfree = (free_func) comp_method_zlib_free;
|
strm->zfree = (free_func) comp_method_zlib_free;
|
||||||
if (compress) {
|
if (compr) {
|
||||||
/* deflate */
|
/* deflate */
|
||||||
status = deflateInit(strm, Z_DEFAULT_COMPRESSION);
|
status = deflateInit(strm, Z_DEFAULT_COMPRESSION);
|
||||||
} else {
|
} else {
|
||||||
@ -338,25 +338,19 @@ comp_method_zlib_decomp(LIBSSH2_SESSION * session,
|
|||||||
* All done, no more compression for you
|
* All done, no more compression for you
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
comp_method_zlib_dtor(LIBSSH2_SESSION *session, int compress,
|
comp_method_zlib_dtor(LIBSSH2_SESSION *session, int compr, void **abstract)
|
||||||
void **abstract)
|
|
||||||
{
|
{
|
||||||
z_stream *strm = *abstract;
|
z_stream *strm = *abstract;
|
||||||
|
|
||||||
if (strm) {
|
if (strm) {
|
||||||
if (compress) {
|
if (compr)
|
||||||
/* deflate */
|
|
||||||
deflateEnd(strm);
|
deflateEnd(strm);
|
||||||
} else {
|
else
|
||||||
/* inflate */
|
|
||||||
inflateEnd(strm);
|
inflateEnd(strm);
|
||||||
}
|
|
||||||
|
|
||||||
LIBSSH2_FREE(session, strm);
|
LIBSSH2_FREE(session, strm);
|
||||||
}
|
}
|
||||||
|
|
||||||
*abstract = NULL;
|
*abstract = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user