nghttpx: Fix max distance in weight group/address cycle comparison

This commit is contained in:
Tatsuhiro Tsujikawa 2021-07-14 23:26:33 +09:00
parent 40af31da4c
commit fa16e66a6d
1 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ struct DownstreamAddrEntryGreater {
if (d == 0) { if (d == 0) {
return rhs.seq < lhs.seq; return rhs.seq < lhs.seq;
} }
return d <= MAX_DOWNSTREAM_ADDR_WEIGHT; return d <= 2 * MAX_DOWNSTREAM_ADDR_WEIGHT - 1;
} }
}; };
@ -182,7 +182,7 @@ struct WeightGroupEntryGreater {
if (d == 0) { if (d == 0) {
return rhs.seq < lhs.seq; return rhs.seq < lhs.seq;
} }
return d <= MAX_DOWNSTREAM_ADDR_WEIGHT; return d <= 2 * MAX_DOWNSTREAM_ADDR_WEIGHT - 1;
} }
}; };