diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-03-22 22:38:12 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-03-22 22:38:12 +0000 |
commit | 76c36688d09b86a1b3a5e2d363e0fefa81d7c8a2 (patch) | |
tree | 8c80fe7a789e9afcfe8a6f90bc6905d6a01929da | |
parent | 651c8d3bc4e1e6da6868acba730021e4cb7d3a41 (diff) |
Makes CURLINFO_CONTENT_LENGTH_DOWNLOAD work even if CURLOPT_NOBODY is set
true.
-rw-r--r-- | lib/transfer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 84d244ef0..2a0df0f64 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -507,10 +507,14 @@ CURLcode Curl_readwrite(struct connectdata *conn, if(conn->bits.chunk) conn->size=-1; - if(-1 != conn->size) { - Curl_pgrsSetDownloadSize(data, conn->size); - conn->maxdownload = 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); + conn->maxdownload = conn->size; } /* If max download size is *zero* (nothing) we already have nothing and can safely return ok now! */ |