Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32-bit signed int is not enough for transfer rates #7693

Open
HanabishiRecca opened this issue Jun 27, 2024 · 1 comment
Open

32-bit signed int is not enough for transfer rates #7693

HanabishiRecca opened this issue Jun 27, 2024 · 1 comment
Milestone

Comments

@HanabishiRecca
Copy link
Contributor

HanabishiRecca commented Jun 27, 2024

libtorrent version (or branch): 2.0.10

platform/architecture: Linux x86-64

compiler and compiler version: gcc 14.1.1

As the title says, I'm actually able to acheive transfers rates more than 2 GiB/s in qBittorrent and exceed the max int32 value.
This leads to weird results. See qbittorrent/qBittorrent#21003 for details.

The root of the problem is fairly straghtforward:

int download_rate = 0;
int upload_rate = 0;

int download_payload_rate = 0;
int upload_payload_rate = 0;

Maybe it's time to promote the values to int64_t.

@HanabishiRecca HanabishiRecca changed the title 32-bit signed int is not enough for transfer speeds 32-bit signed int is not enough for transfer rates Jun 27, 2024
@arvidn arvidn added this to the 2.1 milestone Jul 24, 2024
@glassez
Copy link
Contributor

glassez commented Sep 28, 2024

IMO, many of the data sizes used are already obsolete, so now problems related to speeds and sizes are becoming more common (e.g. #7735). Interestingly, in some such cases, it is clear that the algorithms used normally cope with the current needs of users, it is enough only to increase the data types used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants