cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem using c++ functors for CURLOPT_HEADERFUNCTION

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 28 May 2007 17:53:43 -0700

On Tue, May 29, 2007 at 01:44:14AM +0200, pepone.onrez wrote:
> When i set CURLOPT_HEADERFUNCTION to my fuctor i get Segmentation
> Fault form libcurl in
>
> #1 0xb6a7fcff in Curl_client_write () from /usr/lib/libcurl.so.3
>
>
>
> writeHeaderFunctor = new
> TSpecificFunctor<WebBrowser>(this,&WebBrowser::writeHeader);
> curl_easy_setopt(_handle,CURLOPT_HEADERFUNCTION ,writeHeaderFunctor);
> curl_easy_perform(_handle);
>
>
> I tes my fuctor whith the following code and its work
> void* ptr,*stream;
> size_t size,nmemb;
> (*writeHeaderFunctor)(ptr,size,nmemb,stream);
>
> Any ideas because libcurl crash when try call the writeHeaderFunctor

functor != function. libcurl takes a function pointer. Maybe the C++ curl
binding would accept otherwise, but I doubt it.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-05-29