cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Completed transfer (multi) question

From: Tarendash, David <David.Tarendash_at_gs.com>
Date: Tue, 17 Aug 2004 09:39:02 -0400

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.

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()?

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Tuesday, August 17, 2004 9:01 AM
To: libcurl development
Subject: RE: Completed transfer (multi) question

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

> So then comes the question, how do you know if its completed through the
> multi interface?

First, you know that when the amount of "running handles" you get back from
curl_multi_perform() decreases.

Then, curl_multi_info_read() returns a pointer to a 'struct CURLMsg'.

That CURLMsg struct has a member named 'msg' documented as "what this
message
means". And if it contains CURLMSG_DONE, it means that one transfer/easy
handle has completed its transfer. The associated easy handle is found in
the
CURLMsg struct and so is the CURLcode from the transfer.

-- 
      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