mirror of
https://github.com/curl/curl.git
synced 2026-07-26 09:07:16 +03: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
1 changed files with 5 additions and 1 deletions
|
|
@ -105,7 +105,11 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||
if(rc != cb)
|
||||
return rc;
|
||||
/* 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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue