cURL / Mailing Lists / curl-library / Single Mail


Re: Transaction??

From: Daniel Stenberg <>
Date: Thu, 29 Mar 2001 08:55:45 +0200 (MET DST)

On Thu, 29 Mar 2001, Jaepil wrote:

> What do i have to do to stop a transaction?
> I figured out that i can stop by returning non zero value from
> Is it the only way?

No, you can also return an error from the CUROPT_WRITEFUNCTION.

There has been discussions about adding a separate function that could be
called to cease the operation immediately. But I don't currently have any
plans of adding one, and I don't even know of any portable way to implement

> If it is, what sort of return codes do i get after stoping the
> transaction?

If you return from the progress callback, libcurl returns
CURLE_ABORTED_BY_CALLBACK, but if you return error from the write callback
it'll return CURLE_WRITE_ERROR.

> How can i handle connection failures?

The same way to handle any other failure. You check the return code.

> What kind of errors do i get from the library?

CURLE_COULDNT_CONNECT if the connect() itself failed. include/curl/curl.h
includes 49 different error codes that libcurl can return for various kinds
of failures.

  Daniel Stenberg -- curl project maintainer --
Curl-library mailing list
Received on 2001-03-29