diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java index 12247864f81f..4ab77cb2d57e 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpClientTransportOverFCGI.java @@ -18,14 +18,12 @@ package org.eclipse.jetty.fcgi.client.http; -import java.io.IOException; import java.util.Map; import org.eclipse.jetty.client.AbstractConnectorHttpClientTransport; import org.eclipse.jetty.client.DuplexConnectionPool; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpDestination; -import org.eclipse.jetty.client.MultiplexConnectionPool; import org.eclipse.jetty.client.Origin; import org.eclipse.jetty.client.api.Connection; import org.eclipse.jetty.client.api.Request; @@ -40,35 +38,25 @@ @ManagedObject("The FastCGI/1.0 client transport") public class HttpClientTransportOverFCGI extends AbstractConnectorHttpClientTransport { - private final boolean multiplexed; private final String scriptRoot; public HttpClientTransportOverFCGI(String scriptRoot) { - this( Math.max( 1, ProcessorUtils.availableProcessors() / 2), false, scriptRoot); + this(Math.max(1, ProcessorUtils.availableProcessors() / 2), scriptRoot); } - public HttpClientTransportOverFCGI(int selectors, boolean multiplexed, String scriptRoot) + public HttpClientTransportOverFCGI(int selectors, String scriptRoot) { super(selectors); - this.multiplexed = multiplexed; this.scriptRoot = scriptRoot; setConnectionPoolFactory(destination -> { HttpClient httpClient = getHttpClient(); int maxConnections = httpClient.getMaxConnectionsPerDestination(); - return isMultiplexed() ? - new MultiplexConnectionPool(destination, maxConnections, destination, httpClient.getMaxRequestsQueuedPerDestination()) : - new DuplexConnectionPool(destination, maxConnections, destination); + return new DuplexConnectionPool(destination, maxConnections, destination); }); } - @ManagedAttribute(value = "Whether connections are multiplexed", readonly = true) - public boolean isMultiplexed() - { - return multiplexed; - } - @ManagedAttribute(value = "The scripts root directory", readonly = true) public String getScriptRoot() { @@ -78,12 +66,11 @@ public String getScriptRoot() @Override public HttpDestination newHttpDestination(Origin origin) { - return isMultiplexed() ? new MultiplexHttpDestinationOverFCGI(getHttpClient(), origin) - : new HttpDestinationOverFCGI(getHttpClient(), origin); + return new HttpDestinationOverFCGI(getHttpClient(), origin); } @Override - public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) throws IOException + public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map context) { HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY); @SuppressWarnings("unchecked") @@ -96,7 +83,7 @@ public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map promise) { - return new HttpConnectionOverFCGI(endPoint, destination, promise, isMultiplexed()); + return new HttpConnectionOverFCGI(endPoint, destination, promise); } protected void customize(Request request, HttpFields fastCGIHeaders) diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java index d9ebea6a4969..4ceaaf04026a 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java @@ -64,18 +64,16 @@ public class HttpConnectionOverFCGI extends AbstractConnection implements Connec private final AtomicBoolean closed = new AtomicBoolean(); private final HttpDestination destination; private final Promise promise; - private final boolean multiplexed; private final Flusher flusher; private final Delegate delegate; private final ClientParser parser; private ByteBuffer buffer; - public HttpConnectionOverFCGI(EndPoint endPoint, HttpDestination destination, Promise promise, boolean multiplexed) + public HttpConnectionOverFCGI(EndPoint endPoint, HttpDestination destination, Promise promise) { super(endPoint, destination.getHttpClient().getExecutor()); this.destination = destination; this.promise = promise; - this.multiplexed = multiplexed; this.flusher = new Flusher(endPoint); this.delegate = new Delegate(destination); this.parser = new ClientParser(new ResponseListener()); @@ -201,8 +199,6 @@ public boolean onIdleExpired() { long idleTimeout = getEndPoint().getIdleTimeout(); boolean close = delegate.onIdleTimeout(idleTimeout); - if (multiplexed) - close &= isFillInterested(); if (close) close(new TimeoutException("Idle timeout " + idleTimeout + " ms")); return false; @@ -257,8 +253,6 @@ public boolean isClosed() protected boolean closeByHTTP(HttpFields fields) { - if (multiplexed) - return false; if (!fields.contains(HttpHeader.CONNECTION, HttpHeaderValue.CLOSE.asString())) return false; close(); diff --git a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java index 5762414a4554..59d7b9fa8d75 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java +++ b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java @@ -245,7 +245,7 @@ private class ProxyHttpClientTransportOverFCGI extends HttpClientTransportOverFC { private ProxyHttpClientTransportOverFCGI(int selectors, String scriptRoot) { - super(selectors, false, scriptRoot); + super(selectors, scriptRoot); } @Override diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/AbstractHttpClientServerTest.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/AbstractHttpClientServerTest.java index d32d29ad87aa..37dc731578cf 100644 --- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/AbstractHttpClientServerTest.java +++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/AbstractHttpClientServerTest.java @@ -18,8 +18,6 @@ package org.eclipse.jetty.fcgi.server; -import static org.hamcrest.MatcherAssert.assertThat; - import java.util.concurrent.atomic.AtomicLong; import org.eclipse.jetty.client.HttpClient; @@ -40,6 +38,8 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; +import static org.hamcrest.MatcherAssert.assertThat; + public abstract class AbstractHttpClientServerTest { private LeakTrackingByteBufferPool serverBufferPool; @@ -67,7 +67,7 @@ public void start(Handler handler) throws Exception QueuedThreadPool executor = new QueuedThreadPool(); executor.setName(executor.getName() + "-client"); - HttpClientTransport transport = new HttpClientTransportOverFCGI(1, false, ""); + HttpClientTransport transport = new HttpClientTransportOverFCGI(1, ""); transport.setConnectionPoolFactory(destination -> new LeakTrackingConnectionPool(destination, client.getMaxConnectionsPerDestination(), destination) { @Override diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpChannelAssociationTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpChannelAssociationTest.java index d435454ec451..8a61f02bae20 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpChannelAssociationTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpChannelAssociationTest.java @@ -18,8 +18,6 @@ package org.eclipse.jetty.http.client; -import static org.junit.jupiter.api.Assertions.assertTrue; - import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -49,6 +47,8 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class HttpChannelAssociationTest extends AbstractTest { @Override @@ -173,12 +173,12 @@ public boolean associate(HttpExchange exchange) } case FCGI: { - return new HttpClientTransportOverFCGI(1, false, "") + return new HttpClientTransportOverFCGI(1, "") { @Override protected HttpConnectionOverFCGI newHttpConnection(EndPoint endPoint, HttpDestination destination, Promise promise) { - return new HttpConnectionOverFCGI(endPoint, destination, promise, isMultiplexed()) + return new HttpConnectionOverFCGI(endPoint, destination, promise) { @Override protected HttpChannelOverFCGI newHttpChannel(Request request) diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java index ab3f952f3a6b..a0ee475b519c 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java @@ -18,9 +18,6 @@ package org.eclipse.jetty.http.client; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; - import java.io.IOException; import java.io.InterruptedIOException; import java.nio.ByteBuffer; @@ -68,6 +65,9 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class HttpClientLoadTest extends AbstractTest { private final Logger logger = Log.getLogger(HttpClientLoadTest.class); @@ -402,7 +402,7 @@ protected void leaked(LeakDetector.LeakInfo leakInfo) } case FCGI: { - HttpClientTransport clientTransport = new HttpClientTransportOverFCGI(1, false, ""); + HttpClientTransport clientTransport = new HttpClientTransportOverFCGI(1, ""); clientTransport.setConnectionPoolFactory(destination -> new LeakTrackingConnectionPool(destination, client.getMaxConnectionsPerDestination(), destination) { @Override diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java index c392ab3bf7ba..3f33b705fede 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java @@ -195,7 +195,7 @@ public HttpClientTransport provideClientTransport(Transport transport) } case FCGI: { - return new HttpClientTransportOverFCGI(1, false, ""); + return new HttpClientTransportOverFCGI(1, ""); } case UNIX_SOCKET: {