static size_t curlwrite_cb(void *ptr, size_t size, size_t nmemb, void *data) { RequestData *requestdata = data; double contentlength; g_string_append_len(requestdata->response, ptr, size*nmemb); curl_easy_getinfo(requestdata->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &contentlength); if (requestdata->user_cb) { NetStatusProgress progress = {0}; progress.current = requestdata->response->len; progress.total = (int)contentlength; requestdata->user_cb(NET_STATUS_PROGRESS, &progress, requestdata->user_data); } return size*nmemb; }