C - libcurl - How to get dltotal without using the CURLOPT_XFERINFOFUNCTION -
i using libcurl multi interface , need know how data being sent each request. rather not use curlopt_xferinfofunction
because gets called lot , need know dltotal while in curlopt_writefunction
callback. want clean existing easy handle , malloc'd data while still in write callback once data has been received. there function can call return total amount of data being sent particular easy handle?
i tried using curl_easy_getinfo()
curlinfo_size_download
, returned 0. tried curlinfo_content_length_download
returned 0. calling within curlopt_writefunction
callback.
the reason zeroes calls because size isn't known before-hand.
but let me alert "i want clean existing easy handle , malloc'd data while still in write callback" sounds disaster waiting happen. should not cleanup handle within callback.
Comments
Post a Comment