Skip to content

libcURL.EasyHandle.DataNeeded

Andrew Lambert edited this page Dec 24, 2022 · 23 revisions

libcURL.EasyHandle.DataNeeded

Event Signature

 Event Function DataNeeded(Buffer As MemoryBlock, MaxLength As Integer) As Integer

Parameters

Name Type Comment
Buffer MemoryBlock A buffer into which uploaded data should be copied.
MaxLength Integer The maximum number of bytes requested.

Return value

The number of bytes actually copied, or 0 to indicate the end of the stream. You may also return CURL_READFUNC_ABORT or CURL_READFUNC_PAUSE to abort or pause the transfer, respectively. If you abort or pause the transfer then any data copied to the buffer will be ignored.

Remarks

This event handles the CURLOPT_READFUNCTION callback if no UploadStream is specified. It is raised by EasyHandle.ReadCallback. This event means that the upload stream requires additional data.

Fill the Buffer with no more than MaxLength bytes of data, and return the actual number of bytes provided.

See also

Clone this wiki locally