From b15d3c252decf7a32eeaf99da2df6c9ee3014c77 Mon Sep 17 00:00:00 2001 From: Santiago Pericasgeertsen Date: Wed, 1 Nov 2023 09:41:33 -0400 Subject: [PATCH] If a single candidate, use it without trying to identify the connection. Signed-off-by: Santiago Pericasgeertsen --- .../main/java/io/helidon/webserver/ConnectionHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webserver/webserver/src/main/java/io/helidon/webserver/ConnectionHandler.java b/webserver/webserver/src/main/java/io/helidon/webserver/ConnectionHandler.java index c4bb7ab11b0..673b2861b42 100644 --- a/webserver/webserver/src/main/java/io/helidon/webserver/ConnectionHandler.java +++ b/webserver/webserver/src/main/java/io/helidon/webserver/ConnectionHandler.java @@ -227,6 +227,11 @@ public Router router() { } private ServerConnection identifyConnection() { + // if just one candidate, take a chance with it + if (providerCandidates.size() == 1) { + return providerCandidates.getFirst().connection(this); + } + try { reader.ensureAvailable(); } catch (DataReader.InsufficientDataAvailableException e) {