curl-library
Re: Downloading a file through HTTP proxy gives incorrect progress data when used CURLOPT_PROGRESSFUNCTION
Date: Mon, 24 Oct 2016 18:33:50 -0400
On 10/24/2016 11:38 AM, manish wrote:
> I am using CURLOPT_PROGRESSFUNCTION to log the progress of file
> download. When I try to download a file through a FTP server without
> any proxy, I am getting correct progress data through "dltotal" and
> "dlnow" variables used in callback function. However, if I use HTTP
> proxy to download a file from the FTP server, I am getting incorrect
> progress data. dltotal is always coming as "0", however dlnow is
> showing correct value.
>
> Also a side issue is that, when I download a file through HTTP proxy,
> it adds carriage return character at the end of every line.
>
...
> [debug]: Download status of abc.xml : Downloaded 0 bytes out of 0
> bytes | -nan % complete
> [debug]: HTTP 1.0, assume close after body
> [debug]: Download status of abc.xml : Downloaded 6992 bytes out of 0
> bytes | inf % complete
> [debug]: Download status of abc.xml : Downloaded 20480 bytes out of 0
> bytes | inf % complete
> [debug]: Download status of abc.xml : Downloaded 21633 bytes out of 0
> bytes | inf % complete
Both of what you describe are likely due to your proxy. The reason you
see 0 bytes is likely because the proxy reply didn't include the content
length. To confirm use curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-25