cURL / Mailing Lists / curl-users / Single Mail


RE: speed limit / speed time / limit rate

From: David Byron <>
Date: Thu, 19 Feb 2004 14:43:04 -0800

On Thu, 19 Feb 2004, Daniel Stenberg wrote:

> On Thu, 19 Feb 2004, David Byron wrote:
> > How's this? I need to do some more testing, and the MIN
> > macro almostcertainly goes somewhere else, but at least to check
> > the concept...
> What if no low_speed_time is set? Then that variable will be
> 0 and that MIN check looks bad.

I'll fix that. What about the basic concept though? This should make it
harder for the bandwidth limiting to trigger the speed limit, but not
impossible. It also makes it hard to explain what --limit-rate and
--speed-limit really do when they're used together.

For example if curl needs to sleep for 35 seconds to satisfy the bandwidth
limit, but only sleeps for 29 seconds because speed-time is 30, the
speed-limit could trigger after only 1 second of a stalled connection when
the user asked it to only trigger after 30.

I guess what I'm saying is that I think this solution (when properly
written) may help, and is simple to write, but may be complicated enough to
document that we need something better. Trouble is, the better thing
probably means moving the --limit-rate into libcurl so we can teach the
speed limit code when curl is sleeping to limit bandwidth. If the speed
limit code was aware of that, we could make sure it didn't fire because of
the sleeping.

> > This patch doesn't change my testsuite results on cygwin.
> But then there's no --limit-rate tests either! ;-)

Not sure I'm signing up for that just yet :)

Received on 2004-02-19