cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_multi_perform: Is there any way to know about the end of response after doing curl multi perform

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 17 Nov 2006 11:18:33 +0100 (CET)

On Wed, 15 Nov 2006, venkat akella wrote:

(Please stop submitting this multiple times, it does not good but only annoys
us all.)

> I am calling curl_multi_perform() to send/receive the http
> request/response. curl_multi_perform() call returns CURLM_OK and
> still_running is populated with 1.

Yes, it will do that until the whole response is received.

> Q1. For HTTP1.1 persistent connections, when the running_handles of
> curl_multi_perform(multi_handle, &running_handles) is going to be zero? I am
> asking this because even after sending a request and receiving resopnse for
> that request, running_handles is set to 1. So, is running_handles will be
> set to zero only after all the connections(Even persistent connections) are
> closed?

It goes to 0 when the whole response have been received.

> Q2. With a call to curl_multi_perform(multi_handle, &running_handles), I
> sent a request to server and received the response. My question is how do I
> know whether I received the complete response or not during the
> curl_multi_perform() call in my program.

The number of "running_handles" decreases and you can read info about it with
curl_multi_info_read().

AFAIK, these details are documented.

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