cURL

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1392 CURLOPT_RANGE can not download 1byte?

From: qokelate <nn0o0nn_at_users.sf.net>
Date: Sun, 06 Jul 2014 14:15:35 +0000

        // download 2bytes
        {
                FILE *f = fopen("z:\\1.txt", "wb");
                CURL *curl = curl_easy_init();
                curl_easy_setopt(curl, CURLOPT_URL, "http://dldir1.qq.com/qqfile/qq/QQ6.0/11743/QQ6.0.exe");
                curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
                curl_easy_setopt(curl, CURLOPT_RANGE, "0-1");
                curl_easy_perform(curl);
        }

        // download nothing
                {
                        FILE *f = fopen("z:\\2.txt", "wb");
                        CURL *curl = curl_easy_init();
                        curl_easy_setopt(curl, CURLOPT_URL, "http://dldir1.qq.com/qqfile/qq/QQ6.0/11743/QQ6.0.exe");
                        curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
                        curl_easy_setopt(curl, CURLOPT_RANGE, "0-0");
                        curl_easy_perform(curl);
                }

        // download nothing
                {
                        FILE *f = fopen("z:\\3.txt", "wb");
                        CURL *curl = curl_easy_init();
                        curl_easy_setopt(curl, CURLOPT_URL, "http://dldir1.qq.com/qqfile/qq/QQ6.0/11743/QQ6.0.exe");
                        curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
                        curl_easy_setopt(curl, CURLOPT_RANGE, "1-1");
                        curl_easy_perform(curl);
                }

        // download 1byte
                {
                        FILE *f = fopen("z:\\4.txt", "wb");
                        CURL *curl = curl_easy_init();
                        curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/pub/www/utilities/curl/curl-4.8.tar.gz");
                        curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
                        curl_easy_setopt(curl, CURLOPT_RANGE, "1-1");
                        curl_easy_perform(curl);
                }

compare 3,4 why? I can never understand

libcurl version : 7.35.0
os : win7 x64 vs2013

---
** [bugs:#1392] CURLOPT_RANGE can not download 1byte?**
**Status:** open
**Labels:** range 
**Created:** Sat Jul 05, 2014 10:09 AM UTC by qokelate
**Last Updated:** Sun Jul 06, 2014 01:43 AM UTC
**Owner:** Daniel Stenberg
how to download 1byte data in curl? (libcurl or curltool)
curl_easy_setopt(curl, CURLOPT_RANGE, "0-1");  // download 2bytes
curl_easy_setopt(curl, CURLOPT_RANGE, "1-1");  // download nothing
curl_easy_setopt(curl, CURLOPT_RANGE, "0-1");  // download nothing
option bug?
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-07-06

These mail archives are generated by hypermail.

donate! Page updated March 21, 2014.
web site info

File upload with ASP.NET