yzaki / verus

Verus is an adaptive congestion control protocol that is custom designed for cellular networks.
MIT License
20 stars 17 forks source link

Divide by 0 Error #3

Closed francisyyan closed 7 years ago

francisyyan commented 8 years ago

Starting from the line 508 of verus_server.cpp

wBar += 1.0/wBar;

if(haveSpline)
    dEst = fmin (dEst, calcDelayCurveInv (wBar));

wBar can be 0 such that wBar then becomes infinity, which makes calcDelayCurveInv throw an exception "Spline1DCalc: infinite X!"

The error can be easily reproduced by running several times of client-server connection for 10 seconds. It can also be easily fixed by changing line 558 of verus_server.cpp into

wBar = fmax(1.0, fmin( wBar, VERUS_M_DECREASE * pdu->w));

because it is the pdu->w that makes wBar be 0 sometimes.

yzaki commented 7 years ago

Thanks for pointing this out. We have fixed the issue.