Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'.

This commit is contained in:
Simone Bordet 2020-06-01 17:24:36 +02:00
commit b8b88b238e
2 changed files with 6 additions and 3 deletions

View File

@ -53,6 +53,11 @@ public abstract class AbstractConnectionPool implements ConnectionPool, Dumpable
this.requester = requester;
}
protected HttpDestination getHttpDestination()
{
return destination;
}
@ManagedAttribute(value = "The max number of connections", readonly = true)
public int getMaxConnectionCount()
{

View File

@ -40,7 +40,6 @@ public class MultiplexConnectionPool extends AbstractConnectionPool implements C
{
private static final Logger LOG = LoggerFactory.getLogger(MultiplexConnectionPool.class);
private final HttpDestination destination;
private final Deque<Holder> idleConnections;
private final Map<Connection, Holder> activeConnections;
private int maxMultiplex;
@ -48,7 +47,6 @@ public class MultiplexConnectionPool extends AbstractConnectionPool implements C
public MultiplexConnectionPool(HttpDestination destination, int maxConnections, Callback requester, int maxMultiplex)
{
super(destination, maxConnections, requester);
this.destination = destination;
this.idleConnections = new ArrayDeque<>(maxConnections);
this.activeConnections = new LinkedHashMap<>(maxConnections);
this.maxMultiplex = maxMultiplex;
@ -60,7 +58,7 @@ public class MultiplexConnectionPool extends AbstractConnectionPool implements C
Connection connection = activate();
if (connection == null)
{
int queuedRequests = destination.getQueuedRequestCount();
int queuedRequests = getHttpDestination().getQueuedRequestCount();
int maxMultiplex = getMaxMultiplex();
int maxPending = ceilDiv(queuedRequests, maxMultiplex);
tryCreate(maxPending);