Skip to content

Commit

Permalink
UNDERTOW-752 Remove SPDY support
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Jun 23, 2016
1 parent fa1fc5d commit bad866b
Show file tree
Hide file tree
Showing 55 changed files with 27 additions and 5,153 deletions.
25 changes: 0 additions & 25 deletions core/pom.xml
Expand Up @@ -267,31 +267,6 @@
<reportsDirectory>${project.build.directory}/surefire-ajp-reports</reportsDirectory> <reportsDirectory>${project.build.directory}/surefire-ajp-reports</reportsDirectory>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>proxy-spdy</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<enableAssertions>true</enableAssertions>
<runOrder>reversealphabetical</runOrder>
<systemPropertyVariables>
<test.spdy>true</test.spdy>
<test.dump>${dump}</test.dump>
<test.bufferSize>${bufferSize}</test.bufferSize>
<default.server.address>localhost</default.server.address>
<default.server.port>7777</default.server.port>
<java.util.logging.manager>org.jboss.logmanager.LogManager
</java.util.logging.manager>
<test.level>${test.level}</test.level>
<java.net.preferIPv6Addresses>${test.ipv6}</java.net.preferIPv6Addresses>
<alpn-boot-string>${alpn-boot-string}</alpn-boot-string>
<sun.net.useExclusiveBind>false</sun.net.useExclusiveBind>
</systemPropertyVariables>
<reportsDirectory>${project.build.directory}/surefire-spdy-reports</reportsDirectory>
</configuration>
</execution>
<execution> <execution>
<id>proxy-https</id> <id>proxy-https</id>
<phase>test</phase> <phase>test</phase>
Expand Down
9 changes: 1 addition & 8 deletions core/src/main/java/io/undertow/Undertow.java
Expand Up @@ -27,7 +27,6 @@
import io.undertow.server.protocol.http.AlpnOpenListener; import io.undertow.server.protocol.http.AlpnOpenListener;
import io.undertow.server.protocol.http.HttpOpenListener; import io.undertow.server.protocol.http.HttpOpenListener;
import io.undertow.server.protocol.http2.Http2OpenListener; import io.undertow.server.protocol.http2.Http2OpenListener;
import io.undertow.server.protocol.spdy.SpdyOpenListener;
import org.xnio.ChannelListener; import org.xnio.ChannelListener;
import org.xnio.ChannelListeners; import org.xnio.ChannelListeners;
import org.xnio.IoUtils; import org.xnio.IoUtils;
Expand Down Expand Up @@ -169,15 +168,9 @@ public synchronized void start() {
HttpOpenListener httpOpenListener = new HttpOpenListener(buffers, undertowOptions); HttpOpenListener httpOpenListener = new HttpOpenListener(buffers, undertowOptions);
httpOpenListener.setRootHandler(rootHandler); httpOpenListener.setRootHandler(rootHandler);


boolean spdy = serverOptions.get(UndertowOptions.ENABLE_SPDY, false);
boolean http2 = serverOptions.get(UndertowOptions.ENABLE_HTTP2, false); boolean http2 = serverOptions.get(UndertowOptions.ENABLE_HTTP2, false);
if(spdy || http2) { if(http2) {
AlpnOpenListener alpn = new AlpnOpenListener(buffers, undertowOptions, httpOpenListener); AlpnOpenListener alpn = new AlpnOpenListener(buffers, undertowOptions, httpOpenListener);
if(spdy) {
SpdyOpenListener spdyListener = new SpdyOpenListener(buffers, new DefaultByteBufferPool(false, 1024, -1, 2, 0), undertowOptions);
spdyListener.setRootHandler(rootHandler);
alpn.addProtocol(SpdyOpenListener.SPDY_3_1, spdyListener, 5);
}
if(http2) { if(http2) {
Http2OpenListener http2Listener = new Http2OpenListener(buffers, undertowOptions); Http2OpenListener http2Listener = new Http2OpenListener(buffers, undertowOptions);
http2Listener.setRootHandler(rootHandler); http2Listener.setRootHandler(rootHandler);
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/io/undertow/UndertowMessages.java
Expand Up @@ -295,8 +295,8 @@ public interface UndertowMessages {
@Message(id = 88, value = "SPDY control frames cannot have body content") @Message(id = 88, value = "SPDY control frames cannot have body content")
IOException controlFrameCannotHaveBodyContent(); IOException controlFrameCannotHaveBodyContent();


@Message(id = 89, value = "SPDY not supported") // @Message(id = 89, value = "SPDY not supported")
IOException spdyNotSupported(); // IOException spdyNotSupported();


@Message(id = 90, value = "No ALPN implementation available (tried Jetty ALPN and JDK9)") @Message(id = 90, value = "No ALPN implementation available (tried Jetty ALPN and JDK9)")
IOException alpnNotAvailable(); IOException alpnNotAvailable();
Expand All @@ -307,8 +307,8 @@ public interface UndertowMessages {
@Message(id = 92, value = "A SPDY header was too large to fit in a response buffer, if you want to support larger headers please increase the buffer size") @Message(id = 92, value = "A SPDY header was too large to fit in a response buffer, if you want to support larger headers please increase the buffer size")
IllegalStateException headersTooLargeToFitInHeapBuffer(); IllegalStateException headersTooLargeToFitInHeapBuffer();


@Message(id = 93, value = "A SPDY stream was reset by the remote endpoint") // @Message(id = 93, value = "A SPDY stream was reset by the remote endpoint")
IOException spdyStreamWasReset(); // IOException spdyStreamWasReset();


@Message(id = 94, value = "Blocking await method called from IO thread. Blocking IO must be dispatched to a worker thread or deadlocks will result.") @Message(id = 94, value = "Blocking await method called from IO thread. Blocking IO must be dispatched to a worker thread or deadlocks will result.")
IOException awaitCalledFromIoThread(); IOException awaitCalledFromIoThread();
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/io/undertow/UndertowOptions.java
Expand Up @@ -177,7 +177,10 @@ public class UndertowOptions {


/** /**
* If we should attempt to use SPDY for HTTPS connections. * If we should attempt to use SPDY for HTTPS connections.
*
* SPDY is no longer supported, use HTTP/2 instead
*/ */
@Deprecated
public static final Option<Boolean> ENABLE_SPDY = Option.simple(UndertowOptions.class, "ENABLE_SPDY", Boolean.class); public static final Option<Boolean> ENABLE_SPDY = Option.simple(UndertowOptions.class, "ENABLE_SPDY", Boolean.class);


/** /**
Expand Down
Expand Up @@ -25,7 +25,6 @@
import io.undertow.client.ClientConnection; import io.undertow.client.ClientConnection;
import io.undertow.client.ClientProvider; import io.undertow.client.ClientProvider;
import io.undertow.client.http2.Http2ClientProvider; import io.undertow.client.http2.Http2ClientProvider;
import io.undertow.client.spdy.SpdyClientProvider;
import org.xnio.ChannelListener; import org.xnio.ChannelListener;
import org.xnio.IoFuture; import org.xnio.IoFuture;
import org.xnio.OptionMap; import org.xnio.OptionMap;
Expand Down Expand Up @@ -133,17 +132,12 @@ public void handleEvent(StreamConnection connection) {


private void handleConnected(final StreamConnection connection, final ClientCallback<ClientConnection> listener, final ByteBufferPool bufferPool, final OptionMap options, URI uri) { private void handleConnected(final StreamConnection connection, final ClientCallback<ClientConnection> listener, final ByteBufferPool bufferPool, final OptionMap options, URI uri) {


boolean spdy = options.get(UndertowOptions.ENABLE_SPDY, false);
boolean h2 = options.get(UndertowOptions.ENABLE_HTTP2, false); boolean h2 = options.get(UndertowOptions.ENABLE_HTTP2, false);
if(connection instanceof SslConnection && (h2 | spdy)) { if(connection instanceof SslConnection && (h2)) {
List<ALPNClientSelector.ALPNProtocol> protocolList = new ArrayList<>(); List<ALPNClientSelector.ALPNProtocol> protocolList = new ArrayList<>();
if(h2) { if(h2) {
protocolList.add(Http2ClientProvider.alpnProtocol(listener, uri, bufferPool, options)); protocolList.add(Http2ClientProvider.alpnProtocol(listener, uri, bufferPool, options));
} }
if(spdy) {
protocolList.add(SpdyClientProvider.alpnProtocol(listener, uri, bufferPool, options, SpdyClientProvider.SPDY_3_1));
protocolList.add(SpdyClientProvider.alpnProtocol(listener, uri, bufferPool, options, SpdyClientProvider.SPDY_3));
}


ALPNClientSelector.runAlpn((SslConnection) connection, new ChannelListener<SslConnection>() { ALPNClientSelector.runAlpn((SslConnection) connection, new ChannelListener<SslConnection>() {
@Override @Override
Expand Down

0 comments on commit bad866b

Please sign in to comment.