diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-10-01 15:40:05 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-10-02 07:46:05 +0200 |
commit | f0f053fed034bacf956a9f32ea65529b0b123247 (patch) | |
tree | bb3f25d59646cb85cd64728e4c95d3c6df436da4 /lib/http_chunks.h | |
parent | ac830139dadf4abd48232e3eb5ce0c8d06d19dcf (diff) | |
download | curl-f0f053fed034bacf956a9f32ea65529b0b123247.tar.gz |
chunked-encoding: stop hiding the CURLE_BAD_CONTENT_ENCODING error
Unknown content-encoding would get returned as CURLE_WRITE_ERROR if the
response is chunked-encoded.
Reported-by: Ilya Kosarev
Fixes #4310
Closes #4449
Diffstat (limited to 'lib/http_chunks.h')
-rw-r--r-- | lib/http_chunks.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/http_chunks.h b/lib/http_chunks.h index b969c5590..8f4a33c8e 100644 --- a/lib/http_chunks.h +++ b/lib/http_chunks.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -21,6 +21,9 @@ * KIND, either express or implied. * ***************************************************************************/ + +struct connectdata; + /* * The longest possible hexadecimal number we support in a chunked transfer. * Weird enough, RFC2616 doesn't set a maximum size! Since we use strtoul() @@ -71,9 +74,9 @@ typedef enum { CHUNKE_TOO_LONG_HEX = 1, CHUNKE_ILLEGAL_HEX, CHUNKE_BAD_CHUNK, - CHUNKE_WRITE_ERROR, CHUNKE_BAD_ENCODING, CHUNKE_OUT_OF_MEMORY, + CHUNKE_PASSTHRU_ERROR, /* Curl_httpchunk_read() returns a CURLcode to use */ CHUNKE_LAST } CHUNKcode; @@ -87,4 +90,10 @@ struct Curl_chunker { size_t dataleft; /* untouched data amount at the end of the last buffer */ }; +/* The following functions are defined in http_chunks.c */ +void Curl_httpchunk_init(struct connectdata *conn); +CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, + ssize_t length, ssize_t *wrote, + CURLcode *passthru); + #endif /* HEADER_CURL_HTTP_CHUNKS_H */ |