From 34a9e43c505da3be0f024a03af4b0d924da76702 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 14 Jul 2016 15:17:20 +1000 Subject: [PATCH 1/4] restored long test timer --- .../java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java index 3be41221eb7..7be2d788546 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java @@ -571,7 +571,7 @@ public class IdleTimeoutTest extends AbstractTest ByteBuffer data = ByteBuffer.allocate(FlowControlStrategy.DEFAULT_WINDOW_SIZE + 1); stream.data(new DataFrame(stream.getId(), data, true), Callback.NOOP); - Assert.assertTrue(latch.await(5, TimeUnit.SECONDS)); + Assert.assertTrue(latch.await(555, TimeUnit.SECONDS)); } private void sleep(long value) From 35a64828fb0967baabb3280ca1e046ce828999a6 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 14 Jul 2016 15:17:42 +1000 Subject: [PATCH 2/4] Fix #708 SslContextFactory: newSslServerSocket/newSslSocket are not customized --- .../org/eclipse/jetty/util/ssl/SslContextFactory.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java index 316dbd68e1b..82f1ed20cdd 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java @@ -399,15 +399,16 @@ public class SslContextFactory extends AbstractLifeCycle } // select the protocols and ciphers - SSLEngine sslEngine=context.createSSLEngine(); - selectCipherSuites(sslEngine.getEnabledCipherSuites(),sslEngine.getSupportedCipherSuites()); - selectProtocols(sslEngine.getEnabledProtocols(),sslEngine.getSupportedProtocols()); + SSLParameters enabled=context.getDefaultSSLParameters(); + SSLParameters supported=context.getSupportedSSLParameters(); + selectCipherSuites(enabled.getCipherSuites(),supported.getCipherSuites()); + selectProtocols(enabled.getProtocols(),enabled.getProtocols()); _factory = new Factory(keyStore,trustStore,context); if (LOG.isDebugEnabled()) { - LOG.debug("Selected Protocols {} of {}",Arrays.asList(_selectedProtocols),Arrays.asList(sslEngine.getSupportedProtocols())); - LOG.debug("Selected Ciphers {} of {}",Arrays.asList(_selectedCipherSuites),Arrays.asList(sslEngine.getSupportedCipherSuites())); + LOG.debug("Selected Protocols {} of {}",Arrays.asList(_selectedProtocols),Arrays.asList(supported.getProtocols())); + LOG.debug("Selected Ciphers {} of {}",Arrays.asList(_selectedCipherSuites),Arrays.asList(supported.getCipherSuites())); } } From f6071ca7fc662d11c917da6bdbf683c9dd3e6075 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 14 Jul 2016 18:26:51 +1000 Subject: [PATCH 3/4] Fix #708 SslContextFactory: newSslServerSocket/newSslSocket are not customized --- .../main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java index 82f1ed20cdd..d55ba20247e 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java @@ -402,7 +402,7 @@ public class SslContextFactory extends AbstractLifeCycle SSLParameters enabled=context.getDefaultSSLParameters(); SSLParameters supported=context.getSupportedSSLParameters(); selectCipherSuites(enabled.getCipherSuites(),supported.getCipherSuites()); - selectProtocols(enabled.getProtocols(),enabled.getProtocols()); + selectProtocols(enabled.getProtocols(),supported.getProtocols()); _factory = new Factory(keyStore,trustStore,context); if (LOG.isDebugEnabled()) From 2387d973ec4db6baa48cc0f2f7f4bd587c6acf0d Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 14 Jul 2016 12:41:08 +0200 Subject: [PATCH 4/4] Made test more robust on slower machines. --- .../eclipse/jetty/http2/client/IdleTimeoutTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java index 7be2d788546..b0c4f96cec4 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java @@ -528,6 +528,7 @@ public class IdleTimeoutTest extends AbstractTest @Test public void testBufferedReadsResetStreamIdleTimeout() throws Exception { + int bufferSize = 8192; long delay = 1000; start(new HttpServlet() { @@ -535,7 +536,7 @@ public class IdleTimeoutTest extends AbstractTest protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletInputStream input = request.getInputStream(); - byte[] buffer = new byte[8192]; + byte[] buffer = new byte[bufferSize]; while (true) { int read = input.read(buffer); @@ -566,12 +567,13 @@ public class IdleTimeoutTest extends AbstractTest // Send data larger than the flow control window. // The client will send bytes up to the flow control window immediately - // and they will be buffered by the server, which will read them slowly. - // Server reads should reset the idle timeout. - ByteBuffer data = ByteBuffer.allocate(FlowControlStrategy.DEFAULT_WINDOW_SIZE + 1); + // and they will be buffered by the server; the Servlet will consume them slowly. + // Servlet reads should reset the idle timeout. + int contentLength = FlowControlStrategy.DEFAULT_WINDOW_SIZE + 1; + ByteBuffer data = ByteBuffer.allocate(contentLength); stream.data(new DataFrame(stream.getId(), data, true), Callback.NOOP); - Assert.assertTrue(latch.await(555, TimeUnit.SECONDS)); + Assert.assertTrue(latch.await(2 * (contentLength / bufferSize + 1) * delay, TimeUnit.MILLISECONDS)); } private void sleep(long value)