cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Error and info handlers

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 4 Aug 2001 17:04:52 +0200 (MET DST)

On Tue, 2 Oct 2001, Vitlay Lipovetsky wrote:

> I think it would be better to add a special error handler to call it from
> failf()

> void Curl_failf(struct UrlData *data, char *fmt, ...)
> {
> va_list ap;
> va_start(ap, fmt);
> if(data->errorbuffer)
> vsnprintf(data->errorbuffer, CURL_ERROR_SIZE, fmt, ap);
> va_end(ap);
>
> fail_handler(data->errorbuffer);
> }
>
> And do the same thing about info messages

This is a good idea indeed. If you mean that the error handler is a function
callback set by the application?

Would it make sense to use the same function for both errors and info
messages? There could be a separate option telling which kind it is...

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
http://curl.haxx.se/libcurl/
Received on 2001-08-04