diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-03-14 15:44:18 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-03-14 15:44:18 +0100 |
commit | 891ef341b329ab01f27d2375157de662ec1eb9b8 (patch) | |
tree | c5f55f84863ead43d06d9a1ea868f2149ce3bc2f /lib/http_chunks.c | |
parent | 2465ee757384855dce2b1787a9636141f3199c2a (diff) | |
download | curl-891ef341b329ab01f27d2375157de662ec1eb9b8.tar.gz |
chunked-encoding: provide a readable error string for chunked errors
Diffstat (limited to 'lib/http_chunks.c')
-rw-r--r-- | lib/http_chunks.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/http_chunks.c b/lib/http_chunks.c index 83e3f0eec..61a6098a7 100644 --- a/lib/http_chunks.c +++ b/lib/http_chunks.c @@ -361,4 +361,25 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, } return CHUNKE_OK; } + +const char *Curl_chunked_strerror(CHUNKcode code) +{ + switch (code) { + default: + return "OK"; + case CHUNKE_TOO_LONG_HEX: + return "Too long hexadecimal number"; + case CHUNKE_ILLEGAL_HEX: + return "Illegal or missing hexadecimal sequence"; + case CHUNKE_BAD_CHUNK: + return "Malformed encoding found"; + case CHUNKE_WRITE_ERROR: + return "Write error"; + case CHUNKE_BAD_ENCODING: + return "Bad content-encoding found"; + case CHUNKE_OUT_OF_MEMORY: + return "Out of memory"; + } +} + #endif /* CURL_DISABLE_HTTP */ |