curl-library
PATCH: Fix tftp rate limitation logic.
Date: Wed, 03 Mar 2010 13:43:48 -0800
Attached is a patch that implements tftp rate limitation logic.
The change to transfer.c is just a white-space indentation fixup.
This has been lightly tested and could use some review.
[greearb@ben-dt2 curl]$ ./src/curl --limit-rate 8k -o /dev/null tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 5304k 0 46080 0 0 7544 0 0:12:00 0:00:06 0:11:54 8147^C
[greearb@ben-dt2 curl]$ ./src/curl --limit-rate 80k -o /dev/null tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
5 5304k 5 293k 0 0 80874 0 0:01:07 0:00:03 0:01:04 80871^C
[greearb@ben-dt2 curl]$ ./src/curl --limit-rate 800k -o /dev/null tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
44 5304k 44 2347k 0 0 798k 0 0:00:06 0:00:02 0:00:04 798k^C
[greearb@ben-dt2 curl]$ ./src/curl -o /dev/null tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5304k 100 5304k 0 0 2482k 0 0:00:02 0:00:02 --:--:-- 2482k
[greearb@ben-dt2 curl]$ ./src/curl --limit-rate 8k -T "config.log" tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 10.3M 0 0 0 34304 0 7485 0:12:05 0:00:04 0:12:01 7488^C
[greearb@ben-dt2 curl]$ ./src/curl --limit-rate 80k -T "config.log" tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
2 10.3M 0 0 5 273k 0 80964 0:01:07 0:00:03 0:01:04 80966^C
[greearb@ben-dt2 curl]$ ./src/curl --limit-rate 800k -T "config.log" tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
26 10.3M 0 0 52 2806k 0 799k 0:00:06 0:00:03 0:00:03 799k^C
[greearb@ben-dt2 curl]$ ./src/curl -T "config.log" tftp://192.168.100.6/bthelper
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
50 10.3M 0 0 100 5304k 0 2458k 0:00:02 0:00:02 --:--:-- 2458k
Thanks,
Ben
-- Ben Greear <greearb_at_candelatech.com> Candela Technologies Inc http://www.candelatech.com
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/plain attachment: curl_tftp_rate.patch