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

This commit is contained in:
Simone Bordet 2019-10-01 17:37:30 +02:00
commit ea99b3ac69
1 changed files with 6 additions and 16 deletions

View File

@ -523,25 +523,15 @@ public class HttpClient extends ContainerLifeCycle
HttpDestination resolveDestination(HttpDestination.Key key)
{
HttpDestination destination = destinations.get(key);
if (destination == null)
return destinations.computeIfAbsent(key, k ->
{
destination = getTransport().newHttpDestination(key);
HttpDestination destination = getTransport().newHttpDestination(k);
// Start the destination before it's published to other threads.
addManaged(destination);
HttpDestination existing = destinations.putIfAbsent(key, destination);
if (existing != null)
{
removeBean(destination);
destination = existing;
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Created {}", destination);
}
}
return destination;
if (LOG.isDebugEnabled())
LOG.debug("Created {}", destination);
return destination;
});
}
protected boolean removeDestination(HttpDestination destination)