]> granicus.if.org Git - curl/commitdiff
Allen Pulsifer provided a patch that makes libcurl set the expected download
authorDaniel Stenberg <daniel@haxx.se>
Sat, 11 Aug 2007 21:05:13 +0000 (21:05 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 11 Aug 2007 21:05:13 +0000 (21:05 +0000)
size earlier when doing HTTP downloads, so that applications and the
progress meter etc know get the info earlier in the flow than before.

CHANGES
RELEASE-NOTES
lib/transfer.c

diff --git a/CHANGES b/CHANGES
index cb0cd4e94e0299dea46ca90754d5104d9eed42d1..dd1220aef26cd23f2399e723ebab7f932e9e90b6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,10 @@
                                   Changelog
 
 Daniel S (11 August 2007)
+- Allen Pulsifer provided a patch that makes libcurl set the expected download
+  size earlier when doing HTTP downloads, so that applications and the
+  progress meter etc know get the info earlier in the flow than before.
+
 - Patrick Monnerat modified the LDAP code and approach in curl. Starting now,
   the configure script checks for openldap and friends and we link with those
   libs just like we link all other third party libraries, and we no longer
index 9de5d7bf6e24710de43f5fe7f145ee94bdf9f5c4..a50a7315db37031254798e3aef2df9d1844ff256 100644 (file)
@@ -15,6 +15,7 @@ This release includes the following changes:
  o curl_easy_setopt() now allocates strings passed to it
  o SCP and SFTP support now requires libssh2 0.16 or later
  o LDAP libraries are now linked "regularly" and not with dlopen
+ o HTTP transfers have the download size info "available" earlier
 
 This release includes the following bugfixes:
 
@@ -60,6 +61,6 @@ advice from friends like these:
  Daniel Cater, Colin Hogben, Jofell Gallardo, Daniel Johnson,
  Ralf S. Engelschall, James Housley, Chris Flerackers, Patrick Monnerat,
  Jayesh A Shah, Greg Zavertnik, Peter O'Gorman, Greg Morse, Dmitriy Sergeyev,
- Scott Cantor
+ Scott Cantor, Allen Pulsifer
  
         Thanks! (and sorry if I forgot to mention someone)
index f276dc0f8f252f84798513c568dae90d8085e01a..de1e186401cfbfa7bf08b1c998d5312c7a859bae 100644 (file)
@@ -869,6 +869,10 @@ CURLcode Curl_readwrite(struct connectdata *conn,
               if(contentlength >= 0) {
                 k->size = contentlength;
                 k->maxdownload = k->size;
+                /* we set the progress download size already at this point
+                   just to make it easier for apps/callbacks to extract this
+                   info as soon as possible */
+                Curl_pgrsSetDownloadSize(data, k->size);
               }
               else {
                 /* Negative Content-Length is really odd, and we know it