Lasso Soft Inc. > Home

[ curl_easy_cleanup ]


[curl_easy_cleanup] ends a libcurl easy session.

It must be the last method to call for an easy session. It is the opposite of the [curl_easy_init] method and must be called with the same [curltoken] as input that the [curl_easy_init] call returned.

This will effectively close all connections this [curltoken] has used and possibly has kept open until now. Don't call this function if you intend to transfer more files.

Any uses of the [curltoken] after this function has been called are illegal. This kills the [curltoken] and all memory associated with it!

  • Syntax
  • Intermediate

To obtain the status codes for multiple URLs


local(ctoken, err, data, headerBytes = bytes, bodyBytes = bytes, ready = false)
local(urllist = array('', '', ''))
local(results = array)
iterate(#urllist, local('url'))
     #ctoken = curl_easy_init
     #err = curl_easy_setopt(#ctoken, curlopt_url, "")
     while(!#ready) => {
          #data = curl_multi_perform(#ctoken)
          #data->second->isa(::bytes) ? #headerBytes->append(#data->second)
          #data->last->isa(::bytes) ? #bodyBytes->append(#data->last)
          #ready = !#data->first
          !#ready ? sleep(10)
//#headerBytes contains the http headers returned
//#bodyBytes contains the data returned from the request

#results     //shows the status messages from each URL request


array(HTTP/1.1 200 OK, HTTP/1.1 200 OK, HTTP/1.1 200 OK)

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft