cURL / Mailing Lists / curl-library / Single Mail

curl-library

Libcurl multi handle

From: stage\.nexvision <stage.nexvision_at_laposte.net>
Date: Fri, 12 Jan 2007 11:45:29 +0100

Hi,

  I'm trying to understand the libcurl multi interface.

From a program I'm trying to debug, the behaviour is like this:
Main thread calls curl_multi_init and store the multi_handle
Then main thread create 2 threads (A, B)
A thread receive a request to download a file from an FTP server
B thread receive a request to list a directory on a FTP server

The read request from Thread A, does something like
running_handles = 0
curl_multi_perform(multi_handle, &running_handles)
while (running_handles)
{
   curl_multi_fdset(...)
   select(...)
   curl_multi_perform(multi_handle, &running_handles)
}

Sometimes this loop doesn't exit, even if curl_multi_fdset set
maxfd to -1.

I was wondering, if running_handles is a good stop condition
for the loop.
How can I identify the connection's handle for the read from
the connection's handle from the Thread B ?

I've found the curl_multi_info_read function, but I don't
understand how I can tell that read started from A is
finished, while the read in B isn't.

Thanks for your answers.
Cyril

Envoyez vos cartes de voeux depuis www.laposte.net
Elles seront ensuite distribuées par le facteur : pratique et malin !
Received on 2007-01-12