Improved SPDY connector to take into account confidential and integral settings.
This commit is contained in:
parent
41874b5fbe
commit
9158115a82
|
@ -16,6 +16,11 @@
|
|||
|
||||
package org.eclipse.jetty.spdy.http;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.jetty.http.HttpSchemes;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.spdy.AsyncConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.SPDYServerConnector;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
|
@ -52,4 +57,34 @@ public class HTTPSPDYServerConnector extends SPDYServerConnector
|
|||
{
|
||||
return defaultConnectionFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customize(EndPoint endPoint, Request request) throws IOException
|
||||
{
|
||||
super.customize(endPoint, request);
|
||||
if (getSslContextFactory() != null)
|
||||
request.setScheme(HttpSchemes.HTTPS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConfidential(Request request)
|
||||
{
|
||||
if (getSslContextFactory() != null)
|
||||
{
|
||||
int confidentialPort = getConfidentialPort();
|
||||
return confidentialPort == 0 || confidentialPort == request.getServerPort();
|
||||
}
|
||||
return super.isConfidential(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIntegral(Request request)
|
||||
{
|
||||
if (getSslContextFactory() != null)
|
||||
{
|
||||
int integralPort = getIntegralPort();
|
||||
return integralPort == 0 || integralPort == request.getServerPort();
|
||||
}
|
||||
return super.isIntegral(request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class SPDYServerConnector extends SelectChannelConnector
|
|||
return bufferPool;
|
||||
}
|
||||
|
||||
protected Executor getExecutor()
|
||||
public Executor getExecutor()
|
||||
{
|
||||
final ThreadPool threadPool = getThreadPool();
|
||||
if (threadPool instanceof Executor)
|
||||
|
@ -91,11 +91,16 @@ public class SPDYServerConnector extends SelectChannelConnector
|
|||
};
|
||||
}
|
||||
|
||||
protected ScheduledExecutorService getScheduler()
|
||||
public ScheduledExecutorService getScheduler()
|
||||
{
|
||||
return scheduler;
|
||||
}
|
||||
|
||||
public SslContextFactory getSslContextFactory()
|
||||
{
|
||||
return sslContextFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doStart() throws Exception
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue