cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: can you throw exceptions from curl callbacks

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 9 Feb 2009 22:39:21 +0100 (CET)

On Mon, 9 Feb 2009, Peter Walker wrote:

> Is this the norm, meaning i cannot use exceptions in the callback functions?

The callback functions are pure C functions, there are no exceptions in C.

> If so, how do I indicate this error back to the calling application.

By returning the right return code you make the transfer fail. If you want to
provide something specific back from the callback I suggest you use the
user-provided pointer.

-- 
  / daniel.haxx.se
Received on 2009-02-09