curl_easy_perform

Syntax

#include <curl/curl.h>

CURLcode curl_easy_perform(CURL * handle );

Parameters

handle Handle to a curl session.

Return Values

If the operation was successful, CURLE_OK is returned. If the CURLOPT_ERRORBUFFER was set with curl_easy_setopt, there will be a readable error message in the error buffer when nonzero is returned.

Description

This function is called after the init and all the curl_easy_setopt calls are made, and will perform the transfer as described in the options. It must be called with the same handle as input as the curl_easy_init call returned.

Any amount of calls to curl_easy_perform while using the same handle can be made. If intending to transfer more than one file, it is encouraged to do so. libcurl will then attempt to reuse the same connection for the following transfers, making the operations faster, less CPU intensive and using less network resources. Use curl_easy_setopt between the invokes to set options for the following curl_easy_perform.

Do not call this function simultaneously from two places using the same handle. Allow the function to return first before invoking it another time. For parallel transfers, use several curl handles.

NOTE:
The resolver inside curl_easy_perform allocates memory from the user stack during name resolution. Refer to SOGetAddrInfo for the amount.

Do Not Call From

None.

See Also

HTTP Client Library (libcurl)
libcurl API Functions
libcurl Error Codes
curl_easy_init
curl_easy_setopt

Revision History

2014/03/19 Note about stack consumption.
2013/09/18 Conversion
2013/05/08 Automated cleanup pass.
2012/05/04 Initial version.


CONFIDENTIAL