fix: bw_tokens initialized to io_bwlimit, overflow check for --bwlimit
This commit is contained in:
1 parent
3dcaf0b79d
commit
4f8ae5bb70
2 files changed
+12
-4
No files matched your search
@@ -21,7 +21,7 @@ void io_set_fds(int read_fd, int write_fd) {
|
||||
|
||||
void io_set_bwlimit(unsigned long long bytes_per_sec) {
|
||||
io_bwlimit = bytes_per_sec;
|
||||
bw_tokens = 0;
|
||||
bw_tokens = (long long)io_bwlimit;
|
||||
clock_gettime(CLOCK_MONOTONIC, &bw_last_refill);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user