mirror of
https://github.com/curl/curl.git
synced 2026-05-30 10:17:28 +03:00
content_encoding: avoid getting all encodings unless necessary
The error_do_write() function may very well return witout needing the listing of all encoding types so postpone that call until it is needed. Closes #14831
This commit is contained in:
parent
81300c30e2
commit
63ebc48b69
1 changed files with 6 additions and 6 deletions
|
|
@ -909,18 +909,18 @@ static CURLcode error_do_write(struct Curl_easy *data,
|
|||
struct Curl_cwriter *writer, int type,
|
||||
const char *buf, size_t nbytes)
|
||||
{
|
||||
char all[256];
|
||||
(void)Curl_all_content_encodings(all, sizeof(all));
|
||||
|
||||
(void) writer;
|
||||
(void) buf;
|
||||
(void) nbytes;
|
||||
|
||||
if(!(type & CLIENTWRITE_BODY) || !nbytes)
|
||||
return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
|
||||
|
||||
failf(data, "Unrecognized content encoding type. "
|
||||
"libcurl understands %s content encodings.", all);
|
||||
else {
|
||||
char all[256];
|
||||
(void)Curl_all_content_encodings(all, sizeof(all));
|
||||
failf(data, "Unrecognized content encoding type. "
|
||||
"libcurl understands %s content encodings.", all);
|
||||
}
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue