cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Simpel questions for curl_multi (Delphi) or C

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Wed, 14 Oct 2015 08:13:15 -0500

On Wed, Oct 14, 2015 at 6:11 AM, michael <michael_at_fyn13.dk> wrote:

> Has found a way around my delphi curl_multi download, so now I have a new
> problem knowing which Page the downloaded data comes from.

> Is there a way to Add some info into UserData, for instance a number so I
> can track with handle there is doing the download ???

The value passed to CURLOPT_WRITEDATA can be a pointer to anything you want,
as long as it remains valid and in scope while the handle is running.

If you just want to track the handle itself, then pass the handle as the
third argument to curl_easy_setopt.

If you want an integer index you can either typecast the integer to a pointer
or use a pointer to the index variable.

If you want to pass a complex structure you can create a Pascal "record"
containing whatever information you need, then use a pointer to that
record for curl_easy_setopt, and dereference that pointer from
inside your MyWriteFunction.

 - Jeff
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-10-14