From 6a0cd00e43d3eb536c2f4921aa2327a2f8288be9 Mon Sep 17 00:00:00 2001 From: Oknet Xu Date: Fri, 18 Sep 2020 20:48:20 +0800 Subject: [PATCH] If the weight is 0, the SRV record should be selected from the highest priority group --- iocore/hostdb/P_HostDBProcessor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iocore/hostdb/P_HostDBProcessor.h b/iocore/hostdb/P_HostDBProcessor.h index ba0b2075f1c..a6a3998e150 100644 --- a/iocore/hostdb/P_HostDBProcessor.h +++ b/iocore/hostdb/P_HostDBProcessor.h @@ -369,7 +369,7 @@ HostDBRoundRobin::select_best_srv(char *target, InkRand *rand, ink_time_t now, i if (len == 0) { // all failed result = &info(current++ % good); } else if (weight == 0) { // srv weight is 0 - result = &info(current++ % len); + result = infos[current++ % len]; } else { uint32_t xx = rand->random() % weight; for (i = 0; i < len - 1 && xx >= infos[i]->data.srv.srv_weight; ++i)