cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Bug in curl 7.19 for CURLINFO_CONTENT_LENGTH_DOWNLOAD?

From: Gabriel Kuri <gkuri_at_ieee.org>
Date: Sat, 31 Oct 2009 00:43:33 -0700

Eh well, I ran the test and it failed ...

$ ./runtests.pl 566
********* System characteristics ********
* curl 7.19.7-CVS (x86_64-unknown-linux-gnu)
* libcurl/7.19.7-CVS OpenSSL/0.9.8k zlib/1.2.3 libidn/1.14
* Features: IDN Largefile NTLM SSL libz
* Host: huygens
* System: Linux huygens 2.6.30-gentoo-r1 #7 SMP Sat Jul 11 23:43:18 PDT
2009 x86_64 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel
GNU/Linux
* Server SSL: OFF
* libcurl SSL: ON
* debug build: OFF
* track memory: OFF
* valgrind: OFF
* HTTP IPv6 OFF
* FTP IPv6 OFF
* HTTP port: 8990
* FTP port: 8992
* FTP port 2: 8995
* TFTP port: 8997
* SCP/SFTP port: 8999
* SOCKS port: 9000
* SSL library: OpenSSL
* Libtool lib: OFF
*****************************************
test 566...[HTTP GET with CURLINFO_CONTENT_LENGTH_DOWNLOAD and 0 bytes
transfer]

 output FAILED:
--- log/check-expected 2009-10-31 00:29:58.000000000 -0700
+++ log/check-generated 2009-10-31 00:29:58.000000000 -0700
@@ -1 +1 @@
-CL: 0
+CL: -4616189618054758400

 - abort tests
TESTDONE: 0 tests out of 1 reported OK: 0%
TESTFAIL: These test cases failed: 566
TESTDONE: 1 tests were considered during 4 seconds.

Then I applied the patch to lib/progress.c and the test passed ...

$ ./runtests.pl 566
********* System characteristics ********
* curl 7.19.7-CVS (x86_64-unknown-linux-gnu)
* libcurl/7.19.7-CVS OpenSSL/0.9.8k zlib/1.2.3 libidn/1.14
* Features: IDN Largefile NTLM SSL libz
* Host: huygens
* System: Linux huygens 2.6.30-gentoo-r1 #7 SMP Sat Jul 11 23:43:18 PDT
2009 x86_64 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel
GNU/Linux
* Server SSL: OFF
* libcurl SSL: ON
* debug build: OFF
* track memory: OFF
* valgrind: OFF
* HTTP IPv6 OFF
* FTP IPv6 OFF
* HTTP port: 8990
* FTP port: 8992
* FTP port 2: 8995
* TFTP port: 8997
* SCP/SFTP port: 8999
* SOCKS port: 9000
* SSL library: OpenSSL
* Libtool lib: OFF
*****************************************
test 566...[HTTP GET with CURLINFO_CONTENT_LENGTH_DOWNLOAD and 0 bytes
transfer]
-d-poe-- OK (1 out of 1 , remaining: 00:00)
TESTDONE: 1 tests out of 1 reported OK: 100%
TESTDONE: 1 tests were considered during 3 seconds.

I'm not sure why the test is passing for you?

-----
Gabriel Kuri | Sr. Network Engineer
Instructional and Information Technology Division
California State Polytechnic University, Pomona
http://www.csupomona.edu/~iit
<https://exchange.csupomona.edu/exchweb/bin/redir.asp?URL=http://www.csupomona.edu/%7Eiit>
| +1 909 979 6363

Daniel Stenberg wrote:
> On Wed, 21 Oct 2009, Gabriel Kuri wrote:
>
>> However, I believe a Content-Length of 0 is valid, not unknown
>
> I just now wrote up and committed test case 566 to CVS. It works just
> fine!
>
> Can you see why test case 566 works while your test case does not? And
> if so, what do we need to change in our test case to make it fail like
> your case?
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-31