cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

Re: wanted generic CURLcode value

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 23 Nov 2009 10:32:29 +0100 (CET)

On Mon, 23 Nov 2009, Marco Maggi wrote:

> I create a default callback function which in turn invokes a function
> selected by the client code.
>
> When the language raises an exception, I catch it in the default callback
> and I need to return an error code; an unexpected exception (like a type
> error) cannot be automatically translated into a meaningful "CURLcode"
> value, so I would need a generic error code meaning "things gone bad", but I
> find no such value in the "enum CURLcode" definition. Right now I have
> selected "CURLE_OBSOLETE10" and documented it in my package; is there a
> better option?

I suggest you then use CURLE_ABORTED_BY_CALLBACK or something, and pass on
some kind of private data/info using a struct you passed to pointer to to your
callback.

The CURLE_OBSOLETE* defines cannot be reused officially without careful
considerations and possibly even an ABI number bump.

If you would add a completely new define, what would you call it and how would
you document it?

> P.S. The documentation says CURLOPT_TFTPBLKSIZE, but it is
> CURLOPT_TFTP_BLKSIZE. <http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>

Oops, thanks! Fixed now.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-23

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET