diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2021-10-01 13:57:23 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2021-10-15 03:40:16 -0400 |
commit | b1d08d295f0e5035f9772654533f3caab64dd8c7 (patch) | |
tree | 7613054088e28118bdf11a61861a34207976aa0f /docs | |
parent | 8c6f126279f8abddf76661d0b404162c15bcc2c2 (diff) | |
download | curl-b1d08d295f0e5035f9772654533f3caab64dd8c7.tar.gz |
http: set content length earlier
- Make content length (ie download size) accessible to the user in the
header callback, but only after all headers have been processed (ie
only in the final call to the header callback).
Background:
For a long time the content length could be retrieved in the header
callback via CURLINFO_CONTENT_LENGTH_DOWNLOAD_T as soon as it was parsed
by curl.
Changes were made in 8a16e54 (precedes 7.79.0) to ignore content length
if any transfer encoding is used. A side effect of that was that
content length was not set by libcurl until after the header callback
was called the final time, because until all headers are processed it
cannot be determined if content length is valid.
This change keeps the same intention --all headers must be processed--
but now the content length is available before the final call to the
header function that indicates all headers have been processed (ie
a blank header).
Bug: https://github.com/curl/curl/commit/8a16e54#r57374914
Reported-by: sergio-nsk@users.noreply.github.com
Co-authored-by: Daniel Stenberg
Fixes https://github.com/curl/curl/issues/7804
Closes https://github.com/curl/curl/pull/7803
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions