cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: no output wanted (resend)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 8 Jul 2012 22:44:31 +0200 (CEST)

On Sun, 8 Jul 2012, Joe Mason wrote:

>> Well, I don't think your idea here is bad but I'm bit reluctant to change
>> details in this area as I am convinced there are existing applications in
>> the wild that set things to NULL in various combinations already to get the
>> functionality of existing libcurl. So keeping the existing ABI is more
>> important than introducing a very small short-cut to future applications I
>> think...
>
> If I'm reading this right, currently if you set CURLOPT_WRITEDATA to NULL
> without setting CURLOPT_WRITEFUNCTION, curl crashes. How can an existing
> app be depending on that?

Heh, yeah that struck me as well after I sent that mail... I clearly didn't
think that through all the way! =)

The question is if we want to make CURLOPT_WRITEDATA set to NULL with
CURLOPT_WRITEFUNCTION unset or set to NULL equal a callback that just return
the number of bytes it gets. As we can clearly do that without breaking
anything, as doing that with a current libcurl will just get you a crash...

It seems like a very small use case for another special case in the code that
isn't very easy guessable. Or what do others think? Am I just being grumpy?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-08