alibaba / xquic

XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.
Apache License 2.0
1.65k stars 326 forks source link

[Bug]: cubic拥塞控制算法数据溢出 #194

Closed padanes closed 1 year ago

padanes commented 2 years ago

What happened?

在计算offs的三次方时,数据大于2^64次方,导致数据溢出

offs:15974185, delta:7842627 tcp:234196 delta3:8623060531908964872 origin:271164 cwnd:935716 offs:16720817, delta:13108 tcp:234205 delta3:14412724670035656 origin:271164 cwnd:284272

应改为 if(offs > 10241024){ offs = offs>>10 delta = (XQC_CUBIC_C offs offs offs XQC_CUBIC_MSS)>>10; } else delta = (XQC_CUBIC_C offs offs offs * XQC_CUBIC_MSS) >> XQC_CUBE_SCALE;

Steps To Reproduce

运行cubic算法即可

Relevant log output

No response