Skip to content

Commit

Permalink
Issue #7277 - Reverting predefined Local Authority
Browse files Browse the repository at this point in the history
+ Breaks ...
  - DetectorConnectionTest
  - ProxyEndPoint
  - ForwardedRequestCustomizerTest

Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Dec 17, 2021
1 parent 8b41067 commit e18861a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,13 @@ public void beanRemoved(Container parent, Object bean)
* This is equivalent to a listener that iterates over the individual
* listeners returned from <code>getBeans(HttpChannel.Listener.class);</code>,
* except that: <ul>
* <li>The result is precomputed, so it is more efficient</li>
* <li>The result is ordered by the order added.</li>
* <li>The result is immutable.</li>
* <li>The result is precomputed, so it is more efficient</li>
* <li>The result is ordered by the order added.</li>
* <li>The result is immutable.</li>
* </ul>
* @see #getBeans(Class)
*
* @return An unmodifiable list of EventListener beans
* @see #getBeans(Class)
*/
public HttpChannel.Listener getHttpChannelListeners()
{
Expand Down Expand Up @@ -313,10 +314,13 @@ public void setLocalAuthority(HostPort authority)
if (isStarted())
throw new IllegalStateException(getState());

if (!authority.hasHost())
// Unset the local authority to use default behaviors
if (authority == null)
_localAuthority = null;
else if (!authority.hasHost())
throw new IllegalStateException("Local Authority must have host declared");

_localAuthority = authority;
else
_localAuthority = authority;
}

@Override
Expand All @@ -340,10 +344,6 @@ protected void doStart() throws Exception

_lease = ThreadPoolBudget.leaseFrom(getExecutor(), this, _acceptors.length);

// default the local authority if unset by connector implementation or user
if (_localAuthority == null)
setLocalAuthority(new HostPort("localhost"));

super.doStart();

_stopping = new CountDownLatch(_acceptors.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.concurrent.Future;

import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.HostPort;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.thread.Scheduler;
Expand Down Expand Up @@ -83,9 +82,6 @@ public int getLocalPort()
protected void doStart() throws Exception
{
open();
// define a default local authority if unspecified by user
if (getLocalAuthority() == null)
setLocalAuthority(new HostPort(getLocalName(), getLocalPort()));
super.doStart();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public CloseableServer(Server server, ServerConnector connector)

public String getConnectorLocalName()
{
return HostPort.normalizeHost(this.connector.getLocalName());
return "127.0.0.1";
}

public int getConnectorLocalPort()
Expand Down

0 comments on commit e18861a

Please sign in to comment.