cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: libucurl 7.21.4 CURLOPT_PROGRESSFUNCTION && CURLOPT_HEADERFUNCTION execute after curl_easy_perform(CURL*) returns

From: Mike Henshaw <mhenshaw_at_adcomtechnologies.com>
Date: Wed, 23 Feb 2011 12:27:11 -0600

Subject: Re: libucurl 7.21.4 CURLOPT_PROGRESSFUNCTION && CURLOPT_HEADERFUNCTION execute after curl_easy_perform(CURL*) returns

On Wed, 23 Feb 2011, Mike Henshaw wrote:

> Both the CURLOPT_PROGRESSFUNCTION and CURLOPT_HEADERFUNCTION execute
> after
> curl_easy_perform(CURL*) returns CURLE_OK, by then header file has
> been closed.

...

> Response message after curl_easy_perform(CURL*) returns and file
> handle
> closed: 221 Goodbye.

On Wed, 23 Feb 2011, Daniel Stenberg wrote:

> Right, those are called when curl_easy_cleanup() is called.
> We need to make sure this is properly documented. Do you have any suggestion on how it would say this to be perfectly clear?

-- 
I don't know all the curl_easy_setopt(3) functions that are executed with easy_curl_cleanup(3) but here is what I suggest.
In "libcurl-tutorial.3 -- man page under" under the "Handle the Easy libcurl" section just below:
If you then want to transfer another file, the handle is ready to be used again. Mind you, it is even preferred that you re-use an existing handle if you intend to make another transfer. libcurl will then attempt to re-use the previous connection.
-- add me
easy_curl_cleanup(3) will need to be called when the handle is finished be used.  This will close the connection and free all memory associated with the construction and use of the handle.  The functions associated with CURLOPT_PROGRESSFUNCTION and CURLOPT_HEADERFUNCTION will be called to inform of the handle connections being closed.
In "curl_easy_cleanup.3 -- man page" under the "Description" section just below:
This will effectively close all connections this handle has used and possibly has kept open until now. Don't call this function if you intend to transfer more files.
-- add me
Functions that are associated with CURLOPT_PROGRESSFUNCTION and CURLOPT_HEADERFUNCTION will be called to inform of the handle connections being closed.
In "curl_easy_setopt.3 -- man page" under the "BEHAVIOR OPTIONS" section, for sub sections "CURLOPT_PROGRESSFUNCTION", "CURLOPT_HEADERFUNCTION", and other CURLOPT functions add the following:
This function will be called during the execution of curl_easy_cleanup(3) to inform of the handle connections being closed.
I am assuming the addition for "curl_easy_cleanup.3 -- man page" would apply to "curl_multi_cleanup.3 -- man page" and the addition to "curl_easy_setopt.3 -- man page" would apply to "curl_multi_setopt.3 -- man page", both with a little rewording.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-23