Lines Matching refs:z

68 process_zlib_error(struct connectdata *conn, z_stream *z)  in process_zlib_error()  argument
71 if(z->msg) in process_zlib_error()
73 z->msg); in process_zlib_error()
82 exit_zlib(z_stream *z, zlibInitState *zlib_init, CURLcode result) in exit_zlib() argument
84 inflateEnd(z); in exit_zlib()
94 z_stream *z = &k->z; /* zlib state structure */ in inflate_stream() local
95 uInt nread = z->avail_in; in inflate_stream()
96 Bytef *orig_in = z->next_in; in inflate_stream()
105 return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY); in inflate_stream()
112 z->next_out = (Bytef *)decomp; in inflate_stream()
113 z->avail_out = DSIZ; in inflate_stream()
115 status = inflate(z, Z_SYNC_FLUSH); in inflate_stream()
118 if((DSIZ - z->avail_out) && (!k->ignorebody)) { in inflate_stream()
120 DSIZ - z->avail_out); in inflate_stream()
124 return exit_zlib(z, &k->zlib_init, result); in inflate_stream()
131 if(inflateEnd(z) == Z_OK) in inflate_stream()
132 return exit_zlib(z, &k->zlib_init, result); in inflate_stream()
134 return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); in inflate_stream()
140 if(z->avail_in == 0) { in inflate_stream()
149 (void) inflateEnd(z); /* don't care about the return code */ in inflate_stream()
150 if(inflateInit2(z, -MAX_WBITS) != Z_OK) { in inflate_stream()
152 return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); in inflate_stream()
154 z->next_in = orig_in; in inflate_stream()
155 z->avail_in = nread; in inflate_stream()
161 return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); in inflate_stream()
172 z_stream *z = &k->z; /* zlib state structure */ in Curl_unencode_deflate_write() local
176 memset(z, 0, sizeof(z_stream)); in Curl_unencode_deflate_write()
177 z->zalloc = (alloc_func)zalloc_cb; in Curl_unencode_deflate_write()
178 z->zfree = (free_func)zfree_cb; in Curl_unencode_deflate_write()
180 if(inflateInit(z) != Z_OK) in Curl_unencode_deflate_write()
181 return process_zlib_error(conn, z); in Curl_unencode_deflate_write()
186 z->next_in = (Bytef *)k->str; in Curl_unencode_deflate_write()
187 z->avail_in = (uInt)nread; in Curl_unencode_deflate_write()
282 z_stream *z = &k->z; /* zlib state structure */ in Curl_unencode_gzip_write() local
286 memset(z, 0, sizeof(z_stream)); in Curl_unencode_gzip_write()
287 z->zalloc = (alloc_func)zalloc_cb; in Curl_unencode_gzip_write()
288 z->zfree = (free_func)zfree_cb; in Curl_unencode_gzip_write()
292 if(inflateInit2(z, MAX_WBITS+32) != Z_OK) { in Curl_unencode_gzip_write()
293 return process_zlib_error(conn, z); in Curl_unencode_gzip_write()
299 if(inflateInit2(z, -MAX_WBITS) != Z_OK) { in Curl_unencode_gzip_write()
300 return process_zlib_error(conn, z); in Curl_unencode_gzip_write()
308 z->next_in = (Bytef *)k->str; in Curl_unencode_gzip_write()
309 z->avail_in = (uInt)nread; in Curl_unencode_gzip_write()
317 return exit_zlib(z, &k->zlib_init, CURLE_FUNCTION_NOT_FOUND); in Curl_unencode_gzip_write()
339 z->next_in = (Bytef *)k->str + hlen; in Curl_unencode_gzip_write()
340 z->avail_in = (uInt)(nread - hlen); in Curl_unencode_gzip_write()
352 z->avail_in = (uInt)nread; in Curl_unencode_gzip_write()
353 z->next_in = malloc(z->avail_in); in Curl_unencode_gzip_write()
354 if(z->next_in == NULL) { in Curl_unencode_gzip_write()
355 return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY); in Curl_unencode_gzip_write()
357 memcpy(z->next_in, k->str, z->avail_in); in Curl_unencode_gzip_write()
364 return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); in Curl_unencode_gzip_write()
374 unsigned char *oldblock = z->next_in; in Curl_unencode_gzip_write()
376 z->avail_in += (uInt)nread; in Curl_unencode_gzip_write()
377 z->next_in = realloc(z->next_in, z->avail_in); in Curl_unencode_gzip_write()
378 if(z->next_in == NULL) { in Curl_unencode_gzip_write()
380 return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY); in Curl_unencode_gzip_write()
383 memcpy(z->next_in + z->avail_in - nread, k->str, nread); in Curl_unencode_gzip_write()
385 switch (check_gzip_header(z->next_in, z->avail_in, &hlen)) { in Curl_unencode_gzip_write()
388 free(z->next_in); in Curl_unencode_gzip_write()
390 z->next_in = (Bytef *)k->str + hlen + nread - z->avail_in; in Curl_unencode_gzip_write()
391 z->avail_in = (uInt)(z->avail_in - hlen); in Curl_unencode_gzip_write()
401 free(z->next_in); in Curl_unencode_gzip_write()
402 return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z)); in Curl_unencode_gzip_write()
411 z->next_in = (Bytef *)k->str; in Curl_unencode_gzip_write()
412 z->avail_in = (uInt)nread; in Curl_unencode_gzip_write()
416 if(z->avail_in == 0) { in Curl_unencode_gzip_write()
430 z_stream *z = &k->z; in Curl_unencode_cleanup() local
432 (void) exit_zlib(z, &k->zlib_init, CURLE_OK); in Curl_unencode_cleanup()