diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java index da21c0c02d1..eef6e2b38f8 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java @@ -184,9 +184,12 @@ public abstract class HttpDestination extends ContainerLifeCycle implements Dest int port = request.getPort(); if (port >= 0 && getPort() != port) throw new IllegalArgumentException("Invalid request port " + port + " for destination " + this); + send(new HttpExchange(this, request, listeners)); + } - HttpExchange exchange = new HttpExchange(this, request, listeners); - + public void send(HttpExchange exchange) + { + HttpRequest request = exchange.getRequest(); if (client.isRunning()) { if (enqueue(exchanges, exchange)) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexHttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexHttpDestination.java index b97c094ba78..5eb013b6b9c 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexHttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexHttpDestination.java @@ -147,11 +147,9 @@ public abstract class MultiplexHttpDestination extends Htt LOG.debug("Send failed {} for {}", result, exchange); requestsPerConnection.decrementAndGet(); if (result.retry) - { - if (enqueue(getHttpExchanges(), exchange)) - return true; - } - request.abort(result.failure); + send(exchange); + else + request.abort(result.failure); } } return getHttpExchanges().peek() != null; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java index 582f47dd138..b40597c0228 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/PoolingHttpDestination.java @@ -159,12 +159,9 @@ public abstract class PoolingHttpDestination extends HttpD if (LOG.isDebugEnabled()) LOG.debug("Send failed {} for {}", result, exchange); if (result.retry) - { - if (enqueue(getHttpExchanges(), exchange)) - return true; - } - - request.abort(result.failure); + send(exchange); + else + request.abort(result.failure); } } return getHttpExchanges().peek() != null;