cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Completed transfer (multi) question

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 17 Aug 2004 16:18:25 +0200 (CEST)

On Tue, 17 Aug 2004, Tarendash, David wrote:

> Ok thank you, I figured that would be the answer. The problem is I wasn't
> going to keep 'state' of CURLMsg's. I guess Ill need to so I don't lose the
> messages.

I don't know your internals, but I don't see why you need to keep a state
because of this. You'll get to know what transfer that has ended, you just
need to set that mark on your own struct/flag/variable for that transfer.

You could even use CURLOPT_PRIVATE to set a pointer in each easy handle to
point to your own internall struct, and then later when you
curl_multi_info_read() what transfer that is completed, you CURLINFO_PRIVATE
the pointer and wham, you use that to mark that transfer as complete or
similar.

> What do you think about comparing the size of my read buffer and getting the
> content-length of the easy handle via curl_easy_getinfo()?

It assumes that you have a content-length, which may not always be true. There
are protocols without it, there are cases where it isn't sent and there can be
transfer errors that prevents it from arriving to you.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-08-17