diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-10-31 18:51:50 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-10-31 18:51:50 +0000 |
commit | 223d84810435d1fa3937e46488f6a4763de06972 (patch) | |
tree | 61e4fb95724c1eae894426e669faf284b2846e28 /lib/progress.c | |
parent | d8884168e3b094b47d70c49f902a6ef669f6c31c (diff) | |
download | curl-223d84810435d1fa3937e46488f6a4763de06972.tar.gz |
- Gabriel Kuri reported a problem with CURLINFO_CONTENT_LENGTH_DOWNLOAD if the
download was 0 bytes, as libcurl would then return the size as unknown (-1)
and not 0. I wrote a fix and test case 566 to verify it.
Diffstat (limited to 'lib/progress.c')
-rw-r--r-- | lib/progress.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/progress.c b/lib/progress.c index 69f273405..eddd852c1 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -211,7 +211,7 @@ void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size) void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size) { data->progress.size_dl = size; - if(size > 0) + if(size >= 0) data->progress.flags |= PGRS_DL_SIZE_KNOWN; else data->progress.flags &= ~PGRS_DL_SIZE_KNOWN; @@ -220,7 +220,7 @@ void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size) void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size) { data->progress.size_ul = size; - if(size > 0) + if(size >= 0) data->progress.flags |= PGRS_UL_SIZE_KNOWN; else data->progress.flags &= ~PGRS_UL_SIZE_KNOWN; |