version 1.17, 2001/12/29 21:56:01 |
version 1.18, 2002/03/16 11:24:53 |
|
|
static z_stream outgoing_stream; |
static z_stream outgoing_stream; |
static int compress_init_send_called = 0; |
static int compress_init_send_called = 0; |
static int compress_init_recv_called = 0; |
static int compress_init_recv_called = 0; |
|
static int inflate_failed = 0; |
|
static int deflate_failed = 0; |
|
|
/* |
/* |
* Initializes compression; level is compression level from 1 to 9 |
* Initializes compression; level is compression level from 1 to 9 |
|
|
incoming_stream.total_out, incoming_stream.total_in, |
incoming_stream.total_out, incoming_stream.total_in, |
incoming_stream.total_out == 0 ? 0.0 : |
incoming_stream.total_out == 0 ? 0.0 : |
(double) incoming_stream.total_in / incoming_stream.total_out); |
(double) incoming_stream.total_in / incoming_stream.total_out); |
if (compress_init_recv_called == 1) |
if (compress_init_recv_called == 1 && inflate_failed == 0) |
inflateEnd(&incoming_stream); |
inflateEnd(&incoming_stream); |
if (compress_init_send_called == 1) |
if (compress_init_send_called == 1 && deflate_failed == 0) |
deflateEnd(&outgoing_stream); |
deflateEnd(&outgoing_stream); |
} |
} |
|
|
|
|
sizeof(buf) - outgoing_stream.avail_out); |
sizeof(buf) - outgoing_stream.avail_out); |
break; |
break; |
default: |
default: |
|
deflate_failed = 1; |
fatal("buffer_compress: deflate returned %d", status); |
fatal("buffer_compress: deflate returned %d", status); |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
|
|
*/ |
*/ |
return; |
return; |
default: |
default: |
|
inflate_failed = 1; |
fatal("buffer_uncompress: inflate returned %d", status); |
fatal("buffer_uncompress: inflate returned %d", status); |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |