mirror of
https://github.com/curl/curl.git
synced 2025-01-12 13:55:11 +08:00
tool_cb_hdr: return error for failed header writes
By checking that fflush() works. Reported-by: Sebastian Andersson Fixes #13836 Closes #13859
This commit is contained in:
parent
464282ddfb
commit
c61f753881
@ -105,7 +105,11 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||||||
if(rc != cb)
|
if(rc != cb)
|
||||||
return rc;
|
return rc;
|
||||||
/* flush the stream to send off what we got earlier */
|
/* flush the stream to send off what we got earlier */
|
||||||
(void)fflush(heads->stream);
|
if(fflush(heads->stream)) {
|
||||||
|
errorf(per->config->global, "Failed writing headers to %s",
|
||||||
|
per->config->headerfile);
|
||||||
|
return CURL_WRITEFUNC_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_easy_getinfo(per->curl, CURLINFO_SCHEME, &scheme);
|
curl_easy_getinfo(per->curl, CURLINFO_SCHEME, &scheme);
|
||||||
|
Loading…
Reference in New Issue
Block a user