cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Serious problem with CURLOPT_WRITEDATA

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 24 Jun 2013 09:49:41 +0200 (CEST)

On Mon, 24 Jun 2013, nights_at_unku.us wrote:

> The following code will work fine...
>
> my_curl_easy_setopt(TestApp.CurlInfo.curl, CURLOPT_WRITEFUNCTION, &TestWriteFunction);
> my_curl_easy_setopt (TestApp.CurlInfo.curl, CURLOPT_WRITEDATA, &TestApp);
> my_curl_easy_perform(TestApp->CurlInfo.curl);
>
> But if I repeat the perform command in order to collect the stream data,
> "TestApp" will not be sent and in its place will be a NULL...

You didn't say which libcurl version you use and you don't show your own code
for this. It is not possible for us to tell you where the problem lies with
any certainty.

The logic to pass on the WRITEDATA pointer to the callback is a very
fundamental piece of libcurl that virtually every single user of libcurl will
take advantage from and that I don't think has ever not worked.

I'm not excluding the possiblity that there's a bug in there, especially
perhaps in code that is specific for RTSP which isn't one of the most
frequently used protocols by libcurl users, but we need much more details to
properly tell if this is truly the case.

Experience tells us that almost every time someone points out a flaw like
this, the source of it is within the application that uses libcurl. Do use
valgrind to verify that your app is doing the right thing, and if it does and
this case still fails, please write up a smallish example program that repeats
the problem with a modern libcurl and post that example here!

Alternatively, you can debug the case yourself by figuring out where in the
chain that pointer is set to NULL.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-24