cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_STDERR option not customizable

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 13 Mar 2002 09:54:13 +0100 (MET)

On Mon, 11 Mar 2002, Jean-Philippe Barrette-LaPierre wrote:

> > > I saw that the option CURLOPT_STDERR need a FILE *. I suggest to put a
> > > CURLOPT_STDERRFUNCTION to be able to set a customized function.
> > >
> > > I can set this but I need to know if this FILE * is just used in
> > > Curl_infof
> >
> > How would you suggest that the prototype for such a callback would look
> > like?
>
> I sugget to set the prototype exactly like the others write functions using
> (normaly) a FILE *:
>
> size_t function( void *ptr, size_t size, size_t nmemb, void *stream)

I don't like the prototype of the regular write function, so I would suggest
that we make it slightly different.

(There's also another minor effort slowly starting to change the read and
write callback prototypes.)

 I'd prefer something like this:

  int info_function(CURL *easyhandle, size_t size, char *data, void *userp);

But, this wouldn't cover everything we output today.

Currently, we output "<" and ">" before outgoing or incoming data, and we
output "*" before texts that are purely informational.

How would that information be passed to this function? Should we just write
those prefixes like ordinary data?

In order to make a good suggestion, I think it would help if you would
describe your use case for this function.

This suggestion function also duplicates some of the things I was planning
for the data_sent_to_peer callback:

        http://curl.haxx.se/mail/lib-2002-03/0012.html

We might be able to work out a solution for all of this.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-03-13