On 3/28/2024 2:24 PM, R C via curl-library wrote:
How can one 'find' the total number of bytes reveived and written  with a callback_write function with CURLOPT_WRITEFUNCTION


Keep track of it yourself by using CURLOPT_WRITEDATA to set the user pointer. See the CURLOPT_WRITEFUNCTION example [1]. There is also CURLINFO_SIZE_DOWNLOAD_T [2] which is usually the same but not always, since it's used for statistics and counts body bytes that in certain unusual situations must be ignored and are not passed to the write callback.


[1]: https://curl.se/libcurl/c/CURLOPT_WRITEFUNCTION.html
[2]: https://curl.se/libcurl/c/CURLINFO_SIZE_DOWNLOAD_T.html


--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to