Chunked response not processed by libcurl
I'm using libcurl to download a file from a url. The original size of the file is 1700k but I only get 开发者_如何学Python1200k. After I inspected with a packet sniffer I realized that the data was coming in chunked encoding and gzip. Also my progress callback always shows a dltotal of -0- . I tried setting CURLOPT_ENCODING to "gzip", "deflate", "", "blah", 123123 (which are non-null) values but no luck. I still get 1200k of unprocessed data. What should I do to get this working along with the progress problem ??
Thanks, Fatih
libcurl calls the progress callback with "dltotal" set to 0 when chunked encoding is used since it can't know the total size then.
It does however support and deal with both chunked encoding and content-encoding gzip properly so if you don't get the full file decompressed, the problem might be that your server is acting up or that your connection somehow breaks before the full file has been transferred.
Also, you should make sure that you use a recent curl version so that you're not suffering from an old bug or similar.
精彩评论