set download size properly for HTTP downloads
authorDaniel Stenberg <daniel@haxx.se>
Mon, 5 Mar 2001 13:40:31 +0000 (13:40 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 5 Mar 2001 13:40:31 +0000 (13:40 +0000)
lib/transfer.c

index 5916ea916345c4f349d4504ae0c6e29eb03350d5..bf67788c2e5540e5e724f42982b45aa27dbfe626 100644 (file)
@@ -365,8 +365,10 @@ _Transfer(struct connectdata *c_conn)
               }
               /* check for Content-Length: header lines to get size */
               if (strnequal("Content-Length", p, 14) &&
-                  sscanf (p+14, ": %ld", &contentlength))
+                  sscanf (p+14, ": %ld", &contentlength)) {
                 conn->size = contentlength;
+                Curl_pgrsSetDownloadSize(data, contentlength);
+              }
               else if (strnequal("Connection: close", p,
                                  strlen("Connection: close"))) {
                 /*
@@ -625,8 +627,6 @@ _Transfer(struct connectdata *c_conn)
   return CURLE_OK;
 }
 
-typedef int (*func_T)(void);
-
 CURLcode curl_transfer(CURL *curl)
 {
   CURLcode res;