mirror of
https://github.com/curl/curl.git
synced 2026-08-26 17:43:31 +03:00
chunked-encoding: provide a readable error string for chunked errors
This commit is contained in:
parent
2465ee7573
commit
891ef341b3
3 changed files with 24 additions and 2 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue