smbget: Adds a rate limiting option --limit-rate in KB/s
commitb3292b541ec1feb3162a514a0493054a1a5318ab
authorvporpo <v.porpodas@gmail.com>
Sat, 1 Oct 2022 21:45:18 +0000 (1 14:45 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 2 Nov 2022 22:47:10 +0000 (2 22:47 +0000)
tree94174594e02bf526ec2ffaf9a11bd03f08932778
parentbf446bcf612791c7fcf8284cca4061b651b7d4f6
smbget: Adds a rate limiting option --limit-rate in KB/s

This patch implements a very simple rate limiter. It works by pausing the main
download loop whenever the bytes transferred are more than what we would get
with if it were transferred at the rate set by the user.
Please note that this may reduce the blocksize if the limit is too small.

Signed-off-by: Vasileios Porpodas <v.porpodas@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov  2 22:47:10 UTC 2022 on sn-devel-184
docs-xml/manpages/smbget.1.xml
source3/script/tests/test_smbget.sh
source3/utils/smbget.c