cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Is the progress callback called while libcURL tries to connect?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 20 Mar 2002 23:58:27 +0100 (MET)

On Wed, 20 Mar 2002, Noel Byron wrote:

> > Uh, no. But I can't think of any good reason why we shouldn't start doing
> > it. Are you up for adding the call and providing a patch?
>
> I will do my best. But it may take one or two weeks since my C skills are a
> little bit 'rusty' at the moment.

Sure, take your time, there's no rush here! ;-)

> I could also add a parameter to set the time intervall for the progress
> function? Until now it is one second, I think. It could be userfull to
> change it... for information freaks like me... :o)

Maybe we should consider shorten that timeout for everyone (a little
depending on exactly how fast you want this). I'm not convinced adding a new
option for this is what people actually want.

> > > Furthermore, is there a callback for a 'connected' event?
> > Nope. You think we need one?
>
> Well, I dazzlingly thought it might be usefull in the following
> circumstance: libcURL got the connection to the remote host, but the host
> does not send data in time. In this situation I would abort the transfer in
> the progress function. But what shall I report to the user? Could not
> connect or the server has not send any data in time? I'm no networking geek
> and I don't know how often this happens. But this happens quite often when
> I browse through the internet with Netscape.
>
> Or is it possible to gather this status (connected or not) in the progress
> function? Maybe by the use of the CURL handle? Is a status associated with
> the CURL handle... I will look at the code.

We could do this in two ways, we either make an "event" callback for certain
events, or we make it possible to figure out exactly at which point a timeout
or progress callback abort happened.

The first approach seems much more flexible and also allows programs to
dynamicly display that information, if wanted. As the first could be used to
implement the second, but not vice versa.

Would it be good enough if we made a "generic" event callback with a "event
identifier" parameter for various pre-defined events?

> You should know, I want to use libcURL in a multithreaded GUI app. And I
> want to provide as much information as possible to the user (hostname
> resolved, connected, download status and so on...).

Aha! Let me know if you have any data I can put on my "libcurl using app
list" over at: http://curl.haxx.se/libcurl/using/apps.html

> BTW: great library, easy to build, easy to use and reliable.

Thanks. The more people that use it, the more people contribute to it and the
better it gets the more people will use it...

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-03-21