cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Throttling Curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 29 May 2002 11:36:03 +0200 (MET DST)

On Tue, 28 May 2002, Stuart Halliday wrote:

> > > Is there someway to have a switch added to Curl so that instead of it
> > > trying to claim all the available bandwidth a switch limits it to X
> > > KBytes/sec?

> > You up to writing a patch for this?

> Sorry, I'm a RISC OS programmer but I don't use C/C++.

Ok, I figure the basics for this would be a function that does:

 MAX [ bytes/sec ]
 TIME [ elapsed time in seconds ]
 SIZE [ total number of bytes transferred so far ]

 if( SIZE > (MAX * TIME)) {

    WAIT ( SIZE/MAX - TIME )

 }

This will give a "statistical" maximum through put of MAX. I mean, it'll of
course read and write bursts faster than the given MAX, but over time it'll
average in MAX.

I intend to make an attempt to implement this soon. Possibly it'll be in the
7.9.8 release.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Received on 2002-05-29