cURL / Mailing Lists / curl-library / Single Mail


ask the reason of curl return "Transferred a partial file"

From: shili <>
Date: Mon, 18 Jul 2011 14:54:19 +0800

hi all:
   recently i used the curl to download the audio file on our server,and
sometimes the curl quit by the reason of "Transferred a partial file",
but when i used the command to download the file, i could download all
of the file, i want to know the reason,what makes the curl return the
error "Transferred a partial file"?and is there any different between
the curl command and the library?

my program code is :
static int player_request_url(char *url,int num,char **heads)
    int i=0;
    int res = 0;
    CURL *curl;
    struct curl_slist *chunk = NULL;
    curl = curl_easy_init();
        printf("plugin_request_url_with_head heads num error curl\n");
        return -1;
            chunk = curl_slist_append( chunk,heads[i]);
        curl_easy_setopt( curl, CURLOPT_HTTPHEADER, chunk );
    curl_easy_setopt( curl, CURLOPT_HEADERFUNCTION,header_callback);
    curl_easy_setopt(curl, CURLOPT_URL, url);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_fwrite);
    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
    curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, curl_progress);
    curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
    curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
    curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 3);
    curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
    res = curl_easy_perform(curl);
    double length=0;
      printf("the length is %d\n",length);
        printf("the network wrong reason %s res %d\n",
        curl_slist_free_all( chunk );
    chunk = NULL;
    return res;

List admin:
Received on 2011-07-18