Lines Matching full:zp
137 struct zlib_params *zp) in process_trailer() argument
139 z_stream *z = &zp->z; in process_trailer()
141 uInt len = z->avail_in < zp->trailerlen? z->avail_in: zp->trailerlen; in process_trailer()
146 zp->trailerlen -= len; in process_trailer()
151 if(result || !zp->trailerlen) in process_trailer()
152 result = exit_zlib(conn, z, &zp->zlib_init, result); in process_trailer()
155 zp->zlib_init = ZLIB_EXTERNAL_TRAILER; in process_trailer()
164 struct zlib_params *zp = (struct zlib_params *) &writer->params; in inflate_stream() local
165 z_stream *z = &zp->z; /* zlib state structure */ in inflate_stream()
173 if(zp->zlib_init != ZLIB_INIT && in inflate_stream()
174 zp->zlib_init != ZLIB_INFLATING && in inflate_stream()
175 zp->zlib_init != ZLIB_INIT_GZIP && in inflate_stream()
176 zp->zlib_init != ZLIB_GZIP_INFLATING) in inflate_stream()
177 return exit_zlib(conn, z, &zp->zlib_init, CURLE_WRITE_ERROR); in inflate_stream()
183 return exit_zlib(conn, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY); in inflate_stream()
206 zp->zlib_init = started; /* Data started. */ in inflate_stream()
210 exit_zlib(conn, z, &zp->zlib_init, result); in inflate_stream()
226 result = process_trailer(conn, zp); in inflate_stream()
231 if(zp->zlib_init == ZLIB_INIT) { in inflate_stream()
237 zp->zlib_init = ZLIB_INFLATING; in inflate_stream()
238 zp->trailerlen = 4; /* Tolerate up to 4 unknown trailer bytes. */ in inflate_stream()
242 zp->zlib_init = ZLIB_UNINIT; /* inflateEnd() already called. */ in inflate_stream()
246 result = exit_zlib(conn, z, &zp->zlib_init, process_zlib_error(conn, z)); in inflate_stream()
255 if(nread && zp->zlib_init == ZLIB_INIT) in inflate_stream()
256 zp->zlib_init = started; /* Cannot restart anymore. */ in inflate_stream()
266 struct zlib_params *zp = (struct zlib_params *) &writer->params; in deflate_init_writer() local
267 z_stream *z = &zp->z; /* zlib state structure */ in deflate_init_writer()
278 zp->zlib_init = ZLIB_INIT; in deflate_init_writer()
286 struct zlib_params *zp = (struct zlib_params *) &writer->params; in deflate_unencode_write() local
287 z_stream *z = &zp->z; /* zlib state structure */ in deflate_unencode_write()
293 if(zp->zlib_init == ZLIB_EXTERNAL_TRAILER) in deflate_unencode_write()
294 return process_trailer(conn, zp); in deflate_unencode_write()
303 struct zlib_params *zp = (struct zlib_params *) &writer->params; in deflate_close_writer() local
304 z_stream *z = &zp->z; /* zlib state structure */ in deflate_close_writer()
306 exit_zlib(conn, z, &zp->zlib_init, CURLE_OK); in deflate_close_writer()
323 struct zlib_params *zp = (struct zlib_params *) &writer->params; in gzip_init_writer() local
324 z_stream *z = &zp->z; /* zlib state structure */ in gzip_init_writer()
338 zp->zlib_init = ZLIB_INIT_GZIP; /* Transparent gzip decompress state */ in gzip_init_writer()
345 zp->trailerlen = 8; /* A CRC-32 and a 32-bit input size (RFC 1952, 2.2) */ in gzip_init_writer()
346 zp->zlib_init = ZLIB_INIT; /* Initial call state */ in gzip_init_writer()
440 struct zlib_params *zp = (struct zlib_params *) &writer->params; in gzip_unencode_write() local
441 z_stream *z = &zp->z; /* zlib state structure */ in gzip_unencode_write()
443 if(zp->zlib_init == ZLIB_INIT_GZIP) { in gzip_unencode_write()
454 return exit_zlib(conn, z, &zp->zlib_init, CURLE_WRITE_ERROR); in gzip_unencode_write()
467 switch(zp->zlib_init) { in gzip_unencode_write()
478 zp->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */ in gzip_unencode_write()
492 return exit_zlib(conn, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY); in gzip_unencode_write()
495 zp->zlib_init = ZLIB_GZIP_HEADER; /* Need more gzip header data state */ in gzip_unencode_write()
501 return exit_zlib(conn, z, &zp->zlib_init, process_zlib_error(conn, z)); in gzip_unencode_write()
514 return exit_zlib(conn, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY); in gzip_unencode_write()
526 zp->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */ in gzip_unencode_write()
535 return exit_zlib(conn, z, &zp->zlib_init, process_zlib_error(conn, z)); in gzip_unencode_write()
544 return process_trailer(conn, zp); in gzip_unencode_write()
567 struct zlib_params *zp = (struct zlib_params *) &writer->params; in gzip_close_writer() local
568 z_stream *z = &zp->z; /* zlib state structure */ in gzip_close_writer()
570 exit_zlib(conn, z, &zp->zlib_init, CURLE_OK); in gzip_close_writer()
723 struct zstd_params *zp = (struct zstd_params *)&writer->params; in zstd_init_writer() local
729 zp->zds = ZSTD_createDStream(); in zstd_init_writer()
730 zp->decomp = NULL; in zstd_init_writer()
731 return zp->zds ? CURLE_OK : CURLE_OUT_OF_MEMORY; in zstd_init_writer()
739 struct zstd_params *zp = (struct zstd_params *)&writer->params; in zstd_unencode_write() local
744 if(!zp->decomp) { in zstd_unencode_write()
745 zp->decomp = malloc(DSIZ); in zstd_unencode_write()
746 if(!zp->decomp) in zstd_unencode_write()
755 out.dst = zp->decomp; in zstd_unencode_write()
758 errorCode = ZSTD_decompressStream(zp->zds, &out, &in); in zstd_unencode_write()
764 zp->decomp, out.pos); in zstd_unencode_write()
778 struct zstd_params *zp = (struct zstd_params *)&writer->params; in zstd_close_writer() local
781 if(zp->decomp) { in zstd_close_writer()
782 free(zp->decomp); in zstd_close_writer()
783 zp->decomp = NULL; in zstd_close_writer()
785 if(zp->zds) { in zstd_close_writer()
786 ZSTD_freeDStream(zp->zds); in zstd_close_writer()
787 zp->zds = NULL; in zstd_close_writer()