cURL / Mailing Lists / curl-library / Single Mail


Re: can you throw exceptions from curl callbacks

From: Daniel Stenberg <>
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.

Received on 2009-02-09