From 223d84810435d1fa3937e46488f6a4763de06972 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 31 Oct 2009 18:51:50 +0000 Subject: - 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. --- lib/progress.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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, , et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, , 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; -- cgit v1.2.3