From 946bcb3167f8a6d1caf2f75c3dcf5b1c4218cfaf Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 28 Oct 2024 10:32:42 +0100 Subject: [PATCH] Fixes #5888 - Limit usage of HTTP/2 connections. * Fixed maxUsage check in AbstractConnectionPool. Signed-off-by: Simone Bordet --- .../java/org/eclipse/jetty/client/AbstractConnectionPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java index 4d9171a23fad..35233d70493d 100644 --- a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java +++ b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java @@ -341,7 +341,7 @@ protected Connection activate() int maxUsage = getMaxUsage(); if (connection instanceof MaxUsable maxUsable) - maxUsage = maxUsable.getMaxUsage(); + maxUsage = Math.min(maxUsage, maxUsable.getMaxUsage()); if (maxUsage > 0) { EntryHolder holder = (EntryHolder)((Attachable)connection).getAttachment();