easy:SetOpt_SeekFunction -- user callback for seeking in input stream
easy:SetOpt_SeekFunction(seek_callback[, userdata])
Pass a callback function. This function gets called by libcurl to seek to a certain position in the input stream and can be used to fast forward a file in a resumed upload (instead of reading all uploaded bytes with the normal read function/callback). It is also called to rewind a stream when data has already been sent to the server and needs to be sent again. This may happen when doing an HTTP PUT or POST with a multi-pass authentication method, or when an existing HTTP connection is reused too late and the server closes the connection.

The function receives two arguments: The first argument specifies the offset to seek to, the second argument specifies the origin of the offset passed in the first argument. This will be one of the following special strings:

Offset is relative to beginning.
Offset is relative to current position.
Offset is relative to ending.

If you pass the optional userdata argument, the value you pass in userdata will be passed to your callback function as a third parameter. The userdata parameter can be of any type.

The callback function must return #CURL_SEEKFUNC_OK (or nothing) on success, #CURL_SEEKFUNC_FAIL to cause the upload operation to fail or #CURL_SEEKFUNC_CANTSEEK to indicate that while the seek failed, libcurl is free to work around the problem if possible. The latter can sometimes be done by instead reading from the input or similar.

input value
optional: user data to pass to callback function

Show TOC