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

[Bug]: Error in shift operation and arithmetic operation #243

Closed
adcen0107 opened this issue Sep 19, 2022 · 0 comments
Closed

[Bug]: Error in shift operation and arithmetic operation #243

adcen0107 opened this issue Sep 19, 2022 · 0 comments

Comments

@adcen0107
Copy link

What happened?

在xqc_cubic.c的xqc_cubic_update函数实现中,line 66 ~ 70:
/*
* t = elapsed_time * 1024 / 1000000, convert microseconds to milliseconds,
* multiply by 1024 in order to be able to use bit operations later.
*/
t = (now + cubic->min_rtt - cubic->epoch_start) << XQC_CUBIC_TIME_SCALE / XQC_MICROS_PER_SECOND;

结合注释和上下文逻辑,很明显编码者相要的实现是
t =( (now + cubic->min_rtt - cubic->epoch_start) << XQC_CUBIC_TIME_SCALE) / XQC_MICROS_PER_SECOND;
所以,当前实现是一个bug。

Steps To Reproduce

查看xqc_cubic.c的xqc_cubic_update函数源码或添加打印。

Relevant log output

No response

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

2 participants