curl-library
Re: Transaction??
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
> CURLOPT_PROGRESSFUNCTION.
>
> 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
one.
> 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 -- http://curl.haxx.se/ _______________________________________________ Curl-library mailing list Curl-library_at_lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/curl-libraryReceived on 2001-03-29