cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: Crash using WRITEDATA callback depending on CUSTOMREQUEST sent!

From: Brian Dessent <brian_at_dessent.net>
Date: Wed, 14 Mar 2007 12:51:58 -0700

Arnaud Maye wrote:

> /* Declare my call back */
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteData);
> [...]
>
> size_t ShellUpdater::WriteData(void *buffer, size_t size, size_t nmemb,
> void *userp)

You're providing a C++ function where a C one is required. Calling a
C++ function from C will always fail, because the first parameter to
every C++ function is the implicit 'this'. You need to declare your
callback 'extern "C"'.

Brian
Received on 2007-03-14

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET