mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
Makes CURLINFO_CONTENT_LENGTH_DOWNLOAD work even if CURLOPT_NOBODY is set
true.
This commit is contained in:
parent
651c8d3bc4
commit
76c36688d0
@ -507,11 +507,15 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
if(conn->bits.chunk)
|
if(conn->bits.chunk)
|
||||||
conn->size=-1;
|
conn->size=-1;
|
||||||
|
|
||||||
|
}
|
||||||
if(-1 != conn->size) {
|
if(-1 != conn->size) {
|
||||||
|
/* We do this operation even if no_body is true, since this
|
||||||
|
data might be retrieved later with curl_easy_getinfo()
|
||||||
|
and its CURLINFO_CONTENT_LENGTH_DOWNLOAD option. */
|
||||||
|
|
||||||
Curl_pgrsSetDownloadSize(data, conn->size);
|
Curl_pgrsSetDownloadSize(data, conn->size);
|
||||||
conn->maxdownload = conn->size;
|
conn->maxdownload = conn->size;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/* If max download size is *zero* (nothing) we already
|
/* If max download size is *zero* (nothing) we already
|
||||||
have nothing and can safely return ok now! */
|
have nothing and can safely return ok now! */
|
||||||
if(0 == conn->maxdownload)
|
if(0 == conn->maxdownload)
|
||||||
|
Loading…
Reference in New Issue
Block a user