Skip to content

更新maxack时判断ts使用的是大于,导致一些情况fastack未正确更新 #438

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

Open
xhz636 opened this issue Feb 18, 2025 · 0 comments

Comments

@xhz636
Copy link

xhz636 commented Feb 18, 2025

ikcp_input函数中,处理IKCP_CMD_ACK这段逻辑,在更新maxack时,由于比较tslatest_ts使用的是>,会导致maxack未更新到最新的sn
举例:在一次ikcp_flush中,发送了4个包,则这4个包的ts都是一致的,假设这4个包的sn分别是1,2,3,4,此时如果对端只收到了sn为2,4的包,并返回了ack,本地在处理ack时,第1个ack会将maxack设置为2,latest_ts设置为ts,而第2个ack由于ts一致,导致无法将maxack更新到4,因此在ikcp_parse_fastack中更新faskack时,sn为3的包不会触发fastack++
因此,对比latest_ts的逻辑应该需要使用>=比较合理?

Image

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

1 participant