cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Where should I put post-transferring logic?

From: Saqib Ali <saqib.ali.75_at_gmail.com>
Date: Fri, 3 Jun 2011 16:48:55 -0400

On Fri, Jun 3, 2011 at 4:26 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 3 Jun 2011, Saqib Ali wrote:
>
> I am sending files using the Curl (7.21.6) multi interface via SFTP.
>>
>> I want to make sure that I perform some logic exactly once IFF the files
>> were transferred successfully. So where should I place this logic?
>>
>
> When curl_multi_info_read() returns and identifies that the specific handle
> has completed its operation I'd say.
>
>
curl_multi_info_read() returns a pointer to a struct that looks like this:

struct CURLMsg
{
CURLMSG msg; /* what this message means */
CURL *easy_handle; /* the handle it concerns */
union {void *whatever; /* message-specific data */ CURLcode result; /*
return code for transfer */} data;
};

When the transfer succeeds, does msg == CURLEMSG_DONE and result ==
CURLE_OK?

- Saqib

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-06-03