cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: About multi interface

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 16 Aug 2012 23:15:45 +0200 (CEST)

On Thu, 16 Aug 2012, Ning Dong wrote:

> I'm testing the multi interface and write a simple test program based on
> multi-app.c. The test program try to access 3 web sites in parallel, and
> each site will be accessed 10 times.
>
> To limit the connections and handles num, only three handles being pushed
> into mutli stack, and after each handle finished one access, it will be
> removed from the multi stack then be pushed again(So we have chance to
> change the url, but it's not the condition of the test prorgam).

Ok, I'll be blunt and just skip directly to commenting the example code.

The test program looks a bit confused to me.

A) Why does it call curl_multi_perform() in so many places?

B) Why doesn't it check the curl_multi_perform() return codes?

C) Due to (A), you also call curl_multi_info_read() on several places and to
    my surprise the code acts differently on different places which seems like
    a recipe for trouble.

D) The end result being that a small and simple source code becomes almost
    impossible to understand and follow...

I don't think you've identified a libcurl bug. I think your program just is
wrong.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-08-16