From 3ce9346ad1f3306cab3f39abcc14a21f2ac1f642 Mon Sep 17 00:00:00 2001 From: Shailesh Vashishth Date: Thu, 17 Oct 2024 14:41:19 +0530 Subject: [PATCH 1/4] changed the math expression in store_client.cc file from (a/b/c > d) to (a > b*d/c) --- src/store_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store_client.cc b/src/store_client.cc index 6288b0dcbf8..9cc2e143822 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -990,7 +990,7 @@ CheckQuickAbortIsReasonable(StoreEntry * entry) return false; } - if ((curlen / (expectlen / 100)) > (Config.quickAbort.pct)) { + if (curlen > expectlen*(Config.quickAbort.pct/100.0)) { debugs(90, 3, "quick-abort? NO past point of no return"); return false; } From b06616d0101457c61fd0d3a065f1193bb8dccc24 Mon Sep 17 00:00:00 2001 From: Shailesh Vashishth <22538656+vshailesh@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:39:54 +0530 Subject: [PATCH 2/4] removed division by zero check condition in store_client.cc --- src/store_client.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/store_client.cc b/src/store_client.cc index 9cc2e143822..12b730fc4fc 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -984,12 +984,6 @@ CheckQuickAbortIsReasonable(StoreEntry * entry) return true; } - // XXX: This is absurd! TODO: For positives, "a/(b/c) > d" is "a*c > b*d". - if (expectlen < 100) { - debugs(90, 3, "quick-abort? NO avoid FPE"); - return false; - } - if (curlen > expectlen*(Config.quickAbort.pct/100.0)) { debugs(90, 3, "quick-abort? NO past point of no return"); return false; From 52395964669f93b2ff23188d5490e5d225081126 Mon Sep 17 00:00:00 2001 From: Shailesh Vashishth <22538656+vshailesh@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:44:28 +0530 Subject: [PATCH 3/4] Added to Contributors --- CONTRIBUTORS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 26a754f17df..6466ed8c6cc 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -470,6 +470,7 @@ Thank you! Sergey Merzlikin Sergio Durigan Junior Sergio Rabellino + Shailesh Vashishth <22538656+vshailesh@users.noreply.github.com> Shigechika Aikawa Shmaya Frankel Silamael @@ -555,4 +556,4 @@ Thank you! Yuhua Wu Yuriy M. Kaminskiy Zachary Lee Andrews - Zhanpeng Chen + Zhanpeng Chen \ No newline at end of file From 14702daf7992c29e1c5c6ca0cebaa7af67c8bea1 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Fri, 25 Oct 2024 09:41:55 -0400 Subject: [PATCH 4/4] fixup: Undo unwanted out-of-scope formatting change --- CONTRIBUTORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6466ed8c6cc..8c28da61bda 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -556,4 +556,4 @@ Thank you! Yuhua Wu Yuriy M. Kaminskiy Zachary Lee Andrews - Zhanpeng Chen \ No newline at end of file + Zhanpeng Chen