cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Image Downloads

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 17 Oct 2004 20:25:03 +0200 (CEST)

On Sun, 17 Oct 2004, Nishant Mittal wrote:

> I have been writing a small C program that uses libcurl to
> download HTML pages (and images). I noticed that while pages downloaded very
> quickly, images take a LOT of time. I then tried downloading images from the
> command line tool and still it took a lot of time. Please see below.

(You didn't mention what libcurl version or what operating system you're
using.)

It makes no sense. libcurl does everything exactly the same, no matter if the
target is HTML or an image, and it doesn't even know there is any difference.

The differences here MUST be because of issues outside of libcurl's source
code, such as your network or the remote server.

> As you can see the download took 31 secs. I tried the same thing with wget
> and the download was less then 2 secs. I tried with several other images
> (from Yahoo and CNN, with the same result)

What if you try to make the curl request look more like the wget one? HTTP 1.0
for example.

> Can someone tell me whats wrong ? Is there a problem with my installation ?

I recommend using ethereal when you issue a request and then you analyze the
captured traffic to see what particular network packets that were sent/not
sent just before the very long delay.

It sounds like a slow dns lookup or something, but it seems weird that you
only see that for images and only for curl...

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-10-17