cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to know whether a http task done?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 14 Aug 2006 15:17:32 +0200 (CEST)

On Mon, 14 Aug 2006, Victor wrote:

> I want to know a task that manage by curl_multi is finished or not.

Allow me to quote the manual for curl_multi_perform():

   When you call curl_multi_perform() and the amount of running_handles is
   changed from the previous call (or is less than the amount of easy handles
   you've added to the multi handle), you know that there is one or more
   transfers less "running". You can then call curl_multi_info_read(3) to get
   information about each individual completed transfer, and that returned info
   includes CURLcode and more.

> I used curl_easy_getinfo()
> <http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html> to get response code
> to check,but as soon as first data package arrive then the response code
> will be set.

That's a completely insane and very inreliable way to assume anything.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-08-14