Name
easy:SetOpt_ProgressFunction -- callback to progress meter function
Synopsis
easy:SetOpt_ProgressFunction(progress_callback[, userdata])
Function
Pass a callback function. This function gets called by libcurl instead of its internal equivalent with a frequent interval. While data is being transferred it will be called very frequently, and during slow periods like when nothing is being transferred it can slow down to about one call per second.

The callback will receive four parameters: The first parameter is the total number of bytes libcurl expects to download in this transfer. The second parameter is the number of bytes downloaded so far. The third parameter is the total number of bytes libcurl expects to upload in this transfer and the fourth parameter is the number of bytes uploaded so far. If you pass the optional userdata argument, the value you pass in userdata will be passed to your callback function as the fifth parameter. The userdata parameter can be of any type.

Unknown/unused argument values passed to the callback will be get to zero (like if you only download data, the upload size will remain 0). Many times the callback will be called one or more times first, before it knows the data sizes so a program must be made to handle that.

Returning a non-zero value from this callback will cause libcurl to abort the transfer and return #CURLE_ABORTED_BY_CALLBACK.

If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers.

#CURLOPT_NOPROGRESS must be get to 0 to make this function actually get called.

Inputs
progress_callback
input value
userdata
optional: user data to pass to callback function

Show TOC