cURL / Mailing Lists / curl-library / Single Mail

curl-library

Bug in curl_multi_info_read

From: Abe Lederman <abe_at_deepwebtech.com>
Date: Sun, 26 May 2002 12:10:04 -0600

I'm new to using curl, and believe that I have found a bug in
curl_multi_info_read.
 
I'm trying to port an application from libwww to libcURL, and I'm using
multi to retrieve multiple URLs in parallel.
 
I believe that there is a bug in curl_multi_info_read, if you call this
function repeatedly, while curml_multi_perform is doing its work.
 
The first time that you call curl_multi_info_read, after a message is
successfully retrieved, if there are no messages in the queue at the
time, you will never get messages again because the read_ptr is now
NULL.
 
What I did is the following:
 
After the statement:
 
   if(!multi->readptr && !multi->num_read)
      multi->readptr = multi->msgs;
 
I added these lines:
 
    if (multi->num_read) {
      if (multi->readptr->next)
        multi->readptr = multi->readptr->next;
      else {
        *msgs_in_queue = 0;
        return NULL;
      }
    }
 
And I commented out the line:
 
   multi->readptr = multi->readptr->next;
 
 
Let me know if this makes sense.
 
Thanks,
 
Abe
 
 

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Received on 2002-05-26