mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
set download size properly for HTTP downloads
This commit is contained in:
parent
c21f848c1c
commit
07ce7539a8
@ -365,8 +365,10 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
}
|
}
|
||||||
/* check for Content-Length: header lines to get size */
|
/* check for Content-Length: header lines to get size */
|
||||||
if (strnequal("Content-Length", p, 14) &&
|
if (strnequal("Content-Length", p, 14) &&
|
||||||
sscanf (p+14, ": %ld", &contentlength))
|
sscanf (p+14, ": %ld", &contentlength)) {
|
||||||
conn->size = contentlength;
|
conn->size = contentlength;
|
||||||
|
Curl_pgrsSetDownloadSize(data, contentlength);
|
||||||
|
}
|
||||||
else if (strnequal("Connection: close", p,
|
else if (strnequal("Connection: close", p,
|
||||||
strlen("Connection: close"))) {
|
strlen("Connection: close"))) {
|
||||||
/*
|
/*
|
||||||
@ -625,8 +627,6 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef int (*func_T)(void);
|
|
||||||
|
|
||||||
CURLcode curl_transfer(CURL *curl)
|
CURLcode curl_transfer(CURL *curl)
|
||||||
{
|
{
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
|
Loading…
Reference in New Issue
Block a user