From fa16e66a6df498acd60b37d01814bceb8b361957 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 14 Jul 2021 23:26:33 +0900 Subject: [PATCH] nghttpx: Fix max distance in weight group/address cycle comparison --- src/shrpx_worker.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shrpx_worker.h b/src/shrpx_worker.h index 53f37cb3..9e256a00 100644 --- a/src/shrpx_worker.h +++ b/src/shrpx_worker.h @@ -153,7 +153,7 @@ struct DownstreamAddrEntryGreater { if (d == 0) { 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) { return rhs.seq < lhs.seq; } - return d <= MAX_DOWNSTREAM_ADDR_WEIGHT; + return d <= 2 * MAX_DOWNSTREAM_ADDR_WEIGHT - 1; } };