Lines Matching defs:data

69 #define DSIZ CURL_MAX_WRITE_SIZE /* buffer size for decompressed data */
124 process_zlib_error(struct Curl_easy *data, z_stream *z)
127 failf(data, "Error while processing content unencoding: %s",
130 failf(data, "Error while processing content unencoding: "
137 exit_zlib(struct Curl_easy *data,
145 result = process_zlib_error(data, z);
152 static CURLcode process_trailer(struct Curl_easy *data,
168 result = exit_zlib(data, z, &zp->zlib_init, result);
176 static CURLcode inflate_stream(struct Curl_easy *data,
186 char *decomp; /* Put the decompressed data here. */
193 return exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR);
199 return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
219 /* Flush output data if some. */
223 result = Curl_cwriter_write(data, writer->next, type, decomp,
226 exit_zlib(data, z, &zp->zlib_init, result);
235 /* Always loop: there may be unflushed latched data in zlib state. */
239 /* No more data to flush: just exit loop. */
242 result = process_trailer(data, zp);
260 result = exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
263 result = exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
269 /* We're about to leave this call so the `nread' data bytes won't be seen
280 static CURLcode deflate_do_init(struct Curl_easy *data,
291 return process_zlib_error(data, z);
296 static CURLcode deflate_do_write(struct Curl_easy *data,
304 return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
311 return process_trailer(data, zp);
313 /* Now uncompress the data */
314 return inflate_stream(data, writer, type, ZLIB_INFLATING);
317 static void deflate_do_close(struct Curl_easy *data,
323 exit_zlib(data, z, &zp->zlib_init, CURLE_OK);
337 static CURLcode gzip_do_init(struct Curl_easy *data,
350 return process_zlib_error(data, z);
357 return process_zlib_error(data, z);
374 static gzip_status check_gzip_header(unsigned char const *data, ssize_t len,
384 if((data[0] != GZIP_MAGIC_0) || (data[1] != GZIP_MAGIC_1))
387 method = data[2];
388 flags = data[3];
397 data += 10;
405 extra_len = (data[1] << 8) | data[0];
411 data += (extra_len + 2);
416 while(len && *data) {
418 ++data;
420 if(!len || *data)
425 ++data;
430 while(len && *data) {
432 ++data;
434 if(!len || *data)
453 static CURLcode gzip_do_write(struct Curl_easy *data,
461 return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
467 /* Now uncompress the data */
468 return inflate_stream(data, writer, type, ZLIB_INIT_GZIP);
474 return exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR);
478 * enough data passed in to skip over the gzip header. If that happens, we
502 /* We need more data so we can find the end of the gzip header. It's
512 return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
515 zp->zlib_init = ZLIB_GZIP_HEADER; /* Need more gzip header data state */
516 /* We don't have any data to inflate yet */
521 return exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
529 /* Need more gzip header data state */
534 return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
536 /* Append the new block of data to the previous one */
541 /* This is the zlib stream data */
550 /* We still don't have any data to inflate! */
555 return exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
564 return process_trailer(data, zp);
575 /* We don't have any data to inflate; wait until next time */
579 /* We've parsed the header, now uncompress the data */
580 return inflate_stream(data, writer, type, ZLIB_GZIP_INFLATING);
584 static void gzip_do_close(struct Curl_easy *data,
590 exit_zlib(data, z, &zp->zlib_init, CURLE_OK);
650 static CURLcode brotli_do_init(struct Curl_easy *data,
654 (void) data;
660 static CURLcode brotli_do_write(struct Curl_easy *data,
673 return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
688 result = Curl_cwriter_write(data, writer->next, type,
711 static void brotli_do_close(struct Curl_easy *data,
716 (void) data;
743 static CURLcode zstd_do_init(struct Curl_easy *data,
748 (void)data;
755 static CURLcode zstd_do_write(struct Curl_easy *data,
766 return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
787 result = Curl_cwriter_write(data, writer->next, type,
799 static void zstd_do_close(struct Curl_easy *data,
804 (void)data;
900 static CURLcode error_do_init(struct Curl_easy *data,
903 (void)data;
908 static CURLcode error_do_write(struct Curl_easy *data,
920 return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
922 failf(data, "Unrecognized content encoding type. "
927 static void error_do_close(struct Curl_easy *data,
930 (void) data;
971 CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
998 if((is_transfer && !data->set.http_transfer_encoding &&
1000 (!is_transfer && data->set.http_ce_skip)) {
1005 if(Curl_cwriter_count(data, phase) + 1 >= MAX_ENCODE_STACK) {
1006 failf(data, "Reject response due to more than %u content encodings",
1013 failf(data, "ignore this error when the content-encoding is not recognized.");
1017 result = Curl_cwriter_create(&writer, data, cwt, phase);
1021 result = Curl_cwriter_add(data, writer);
1023 Curl_cwriter_free(data, writer);
1034 CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
1037 (void) data;