cURL / Mailing Lists / curl-library / Single Mail

curl-library

CurlLib curl_easy_perform Bytes being dropped on web page download

From: Joseph Cameron <bajaexplorer_at_yahoo.com>
Date: Mon, 12 Mar 2012 17:58:16 -0700 (PDT)

System: Win 7, with Oracle VMBox running Debian 6 as guest.
I am wondering if my problem has to do with the bridged connections.
 
Download of web page and csv files are having bytes dropped from the download.
Between seperate runs, quanity of dropped bytes veries.
 
getinmemory.c example just gave me compiler error about void and char*.
Seems like functions did not agree with the declarations.
 
This is what I am using. The commented out 'buffer' was the only way I could get it to even half-way download.
 
static size_t write_data(char* data, size_t size, size_t nmemb, string* buffer) {
    int results = 0;
//    if (buffer != NULL) {
        buffer->append(data, size*nmemb);
        results = size * nmemb;
//    }
    return results;
}
 
-------------------
string yahoo_etf_url = "http://finance.yahoo.com/etf/browser/mkt?c0&k=5&f=0&o=d&cs=1&ce=2000";
    curl = curl_easy_init();
    if (curl) {
//        curl_easy_setopt( curl, CURLOPT_VERBOSE, 1 );
        curl_easy_setopt( curl, CURLOPT_URL,  yahoo_etf_url.c_str() );
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &write_data);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &etf_page);
        curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-13