cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_multi_perform - how to know if data is entirely sent.

From: Alan Wolfe <alan.wolfe_at_gmail.com>
Date: Thu, 19 May 2011 21:35:39 -0700

the still_running int will drop to 0 when the request is complete.

just have a loop something like this...

while(still_running > 0)
{
  Sleep(50); //yield the processor
  //dont forget to pump libcurl in this loop (i forget the function name)
}

or of course, you can do work inside the while loop if you have work to do

On Thu, May 19, 2011 at 9:23 PM, swathi upadhyaya <swathih9_at_gmail.com> wrote:
> Hi,
>
>
> I have a send function where i would be posting HTTP request. I am using
> curl_multi_perform to send the request .
>
> sendhttpRequest()  {
>
> res = curl_multi_perform(curl);
>
> while(still_running) {
>
> .....
>
> if(dataAvailable()) {
>
> curl_multi_perform<http://curl.haxx.se/libcurl/c/curl_multi_perform.html>(curl,
> &still_running); . } } .
> return (SendStatus);   // This function should return only after entire data
> is sent .
>
> }
>
> But this approach will block till the http response is received.
>
> I tried curl_multi_info_read, but this also gives CURLMSG_DONE only when
> HTTP-Response is done.
>
> I just want to make sure that data is entirely sent on socket before comming
> out of send function,. but donot want to wait for HTTP response. Is there
> any way to acheive this?
>
>
> Thanks
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-20