1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00
curl/tests/data/test599
Brandon Casey 6beb0eeea1 Ensure progress.size_dl/progress.size_ul are always >= 0
Historically the default "unknown" value for progress.size_dl and
progress.size_ul has been zero, since these values are initialized
implicitly by the calloc that allocates the curl handle that these
variables are a part of.  Users of curl that install progress
callbacks may expect these values to always be >= 0.

Currently it is possible for progress.size_dl and progress.size_ul
to by set to a value of -1, if Curl_pgrsSetDownloadSize() or
Curl_pgrsSetUploadSize() are passed a "size" of -1 (which a few
places currently do, and a following patch will add more).  So
lets update Curl_pgrsSetDownloadSize() and Curl_pgrsSetUploadSize()
so they make sure that these variables always contain a value that
is >= 0.

Updates test579 and test599.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
2014-09-07 23:23:12 +02:00

86 lines
1.4 KiB
Plaintext

<testcase>
<info>
<keywords>
HTTP
HTTP POST
</keywords>
</info>
#
# Server-side
<reply>
<data>
HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: 5990001
Content-Length: 6
Connection: close
Content-Type: text/html
-foo-
</data>
<data1>
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Transfer-Encoding: chunked
Connection: close
Content-Type: text/html
32
this data is slightly larger than the first piece
0
</data1>
<datacheck>
HTTP/1.1 302 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Location: 5990001
Content-Length: 6
Connection: close
Content-Type: text/html
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Transfer-Encoding: chunked
Connection: close
Content-Type: text/html
this data is slightly larger than the first piece
</datacheck>
</reply>
# Client-side
<client>
<server>
http
</server>
# tool is what to use instead of 'curl'
<tool>
lib599
</tool>
# Bug 3510057 pointed out that when following a location to a larger chunked
# encoded page, the first size would still be used in the progress callback
<name>
HTTP GET with progress callback and redirects changing content sizes
</name>
<command>
http://%HOSTIP:%HTTPPORT/599 log/ip599
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<file name="log/ip599">
CL: -1
</file>
</verify>
</testcase>