cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Hello!

From: Ben Greear <greearb_at_candelatech.com>
Date: Fri, 26 Oct 2001 08:39:23 -0700

Daniel Stenberg wrote:
>
> On Thu, 25 Oct 2001, Ben Greear wrote:
>
> > > > One of the things I want to support is rate-limitation.
>
> > > Well, if you don't want full speed, your custom callbacks can just
> > > delay the operation as much as you want.
> >
> > If it's a feature that other folks would want, it might make sense to add
> > it into the library, but I doubt many people will want it...
>
> I've got the suggestion before for the 'curl' command, from people who have
> limited bandwidth who don't want their curl downloads to suck up their entire
> pipe. I haven't added anything such, and I would say that it would be outside
> of the library even then.

I have some rate-limiting logic that I can donate if I can figure out
where to place it...I'll think on it. I think it will need hooks into
the library, but it might can be a type of callback function too...

> > > See also Steve Dekorte's suggested new API for more advanced select()
> >
> > Well, I'm writing a server...it has at least one management connection
> > (descriptor) at then there's whatever is hiding in curl. Normally, I put
> > the data fd's and the management fd in the same select loop so that if no
> > data is incoming I can still get management data in... If curl has it's
> > own loop (and I'm single threaded), then I block my management connection
> > on the data connections...

> o Version A would be that the application would get the read/write FDs from
> curl and add its own FDs and then do the select() by itself. When one of
> the curl FDs are ready, you just call curl_deal_with_that_fd().

I think the API should be: curl_deal_with_fd_set(fd_set fds). That way the users don't
have to know which FDs in particular belong to curl, and curl can just ignore
any FDs that it doesn't own. The entry point is just after the normal curl
select (I imagine), so it should not disrupt the architecture too badly.

>
> o Version B would provide all the app's read/write FDs to curl and then get
> callbacks when there's any action on them.

That will especially help people who are scared of (or don't understand) select
loops all that well...

-- 
Ben Greear <greearb_at_candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
Received on 2001-10-26