diff --git a/Jenkinsfile b/Jenkinsfile index 20a937eb1fe..57685b5fda3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,8 +41,9 @@ def getFullBuild(jdk, os) { maven: 'maven3', jdk: "$jdk", publisherStrategy: 'EXPLICIT', + globalMavenSettingsConfig: 'oss-settings.xml', mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") { - sh "mvn -V -B clean install -Dtest=None -T6" + sh "mvn -V -B clean install -DskipTests -T6" } } @@ -62,6 +63,7 @@ def getFullBuild(jdk, os) { maven: 'maven3', jdk: "$jdk", publisherStrategy: 'EXPLICIT', + globalMavenSettingsConfig: 'oss-settings.xml', mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") { sh "mvn -V -B javadoc:javadoc -T5" } @@ -83,6 +85,7 @@ def getFullBuild(jdk, os) { maven: 'maven3', jdk: "$jdk", publisherStrategy: 'EXPLICIT', + globalMavenSettingsConfig: 'oss-settings.xml', mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") { // sh "mvn -V -B install -Dmaven.test.failure.ignore=true -Prun-its -T3 -e -Dmaven.repo.local=${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}" @@ -137,6 +140,7 @@ def getFullBuild(jdk, os) { maven: 'maven3', jdk: "$jdk", publisherStrategy: 'EXPLICIT', + globalMavenSettingsConfig: 'oss-settings.xml', mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") { sh "mvn -V -B -Pcompact3 clean install -T5" } diff --git a/apache-jsp/src/main/config/modules/apache-jsp.mod b/apache-jsp/src/main/config/modules/apache-jsp.mod index 5fa57f7c85c..62ea32b33c0 100644 --- a/apache-jsp/src/main/config/modules/apache-jsp.mod +++ b/apache-jsp/src/main/config/modules/apache-jsp.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables use of the apache implementation of JSP diff --git a/apache-jstl/src/main/config/modules/apache-jstl.mod b/apache-jstl/src/main/config/modules/apache-jstl.mod index 37e6f7757f5..55c89366ade 100644 --- a/apache-jstl/src/main/config/modules/apache-jstl.mod +++ b/apache-jstl/src/main/config/modules/apache-jstl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the apache version of JSTL diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl.mod index d726e163d24..181d668a67d 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Selects an ALPN (Application Layer Protocol Negotiation) implementation by java version. diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod index 91fea30cd0e..bbcca55ad48 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod index 91fea30cd0e..bbcca55ad48 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod index eebd2a92550..d940468a7ff 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod index eebd2a92550..d940468a7ff 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod index 91fea30cd0e..bbcca55ad48 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod index eebd2a92550..d940468a7ff 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod index 3887113d09b..e244e3bed3d 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.10.v20161026/alpn-boot-8.1.10.v20161026.jar|lib/alpn/alpn-boot-8.1.10.v20161026.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod index eb50f520252..6afa18151a4 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod index eb50f520252..6afa18151a4 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod index eb50f520252..6afa18151a4 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod index eb50f520252..6afa18151a4 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod index eb50f520252..6afa18151a4 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod index eb50f520252..6afa18151a4 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod index b50a352334d..e2e91808cd3 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod index b50a352334d..e2e91808cd3 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod index 91fea30cd0e..bbcca55ad48 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod index 55f736902df..f34b1841244 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] maven://org.mortbay.jetty.alpn/alpn-boot/8.1.2.v20141202|lib/alpn/alpn-boot-8.1.2.v20141202.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod index 030029db54d..9ffca1a9699 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] maven://org.mortbay.jetty.alpn/alpn-boot/8.1.3.v20150130|lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod index ebd06d4dda6..3d5c1aeb044 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod index ebd06d4dda6..3d5c1aeb044 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod index a0472beca95..51a8dbb518d 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.4.v20150727/alpn-boot-8.1.4.v20150727.jar|lib/alpn/alpn-boot-8.1.4.v20150727.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod index 0751b15b093..4f639da61a1 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.5.v20150921/alpn-boot-8.1.5.v20150921.jar|lib/alpn/alpn-boot-8.1.5.v20150921.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod index 32ae03ea282..80d1541775d 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod index 32ae03ea282..80d1541775d 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod index 47bc2df34c1..bf0de731394 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod index 47bc2df34c1..bf0de731394 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod index 47bc2df34c1..bf0de731394 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod index 47bc2df34c1..bf0de731394 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod index 47bc2df34c1..bf0de731394 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod index 47bc2df34c1..bf0de731394 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod index 10d83db2181..267aa41ea37 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [files] http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.8.v20160420/alpn-boot-8.1.8.v20160420.jar|lib/alpn/alpn-boot-8.1.8.v20160420.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-10.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-10.mod new file mode 100644 index 00000000000..689601a4197 --- /dev/null +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-10.mod @@ -0,0 +1,4 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[depend] +alpn-impl/alpn-9 diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-11.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-11.mod new file mode 100644 index 00000000000..689601a4197 --- /dev/null +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-11.mod @@ -0,0 +1,4 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[depend] +alpn-impl/alpn-9 diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod index 6ace07a2e6b..84454089e27 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides ALPN support for JDK 8, modifying the sun.security.ssl classes and adding them to the JVM boot classpath. diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-9.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-9.mod index 9a2708ba89a..e1de6726af9 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-9.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-9.mod @@ -1,5 +1,7 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] -Provides support for ALPN based on JDK 9 APIs. +Provides support for ALPN based on JDK 9+ APIs. [lib] lib/jetty-alpn-java-server-${jetty.version}.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod index cb02222ed89..a245331f71f 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the ALPN (Application Layer Protocol Negotiation) TLS extension. diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_144.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_144.mod deleted file mode 100644 index fdd3868701d..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_144.mod +++ /dev/null @@ -1,8 +0,0 @@ -[name] -protonego-boot - -[files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-annotations/src/main/config/modules/annotations.mod b/jetty-annotations/src/main/config/modules/annotations.mod index 4217be54fb3..ca8c3bad139 100644 --- a/jetty-annotations/src/main/config/modules/annotations.mod +++ b/jetty-annotations/src/main/config/modules/annotations.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables Annotation scanning for deployed webapplications. diff --git a/jetty-bom/pom.xml b/jetty-bom/pom.xml index d5f3567437a..9248c4ea8fc 100644 --- a/jetty-bom/pom.xml +++ b/jetty-bom/pom.xml @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.0-M1 + 3.0.0 true diff --git a/jetty-cdi/cdi-2/src/main/config/modules/cdi2.mod b/jetty-cdi/cdi-2/src/main/config/modules/cdi2.mod index da019048ad7..df6ee4135cd 100644 --- a/jetty-cdi/cdi-2/src/main/config/modules/cdi2.mod +++ b/jetty-cdi/cdi-2/src/main/config/modules/cdi2.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Jetty setup to support Weld/CDI2 with WELD inside the webapp diff --git a/jetty-cdi/cdi-servlet/src/main/config/modules/cdi.mod b/jetty-cdi/cdi-servlet/src/main/config/modules/cdi.mod index c05530d631e..26262df8dd4 100644 --- a/jetty-cdi/cdi-servlet/src/main/config/modules/cdi.mod +++ b/jetty-cdi/cdi-servlet/src/main/config/modules/cdi.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Experimental CDI/Weld integration diff --git a/jetty-cdi/cdi-servlet/src/main/config/modules/cdi1.mod b/jetty-cdi/cdi-servlet/src/main/config/modules/cdi1.mod index e2b7105427f..c2deb6124f3 100644 --- a/jetty-cdi/cdi-servlet/src/main/config/modules/cdi1.mod +++ b/jetty-cdi/cdi-servlet/src/main/config/modules/cdi1.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Experimental CDI/Weld integration Deprecated in favour of cdi2 module. diff --git a/jetty-client/src/main/config/modules/client.mod b/jetty-client/src/main/config/modules/client.mod index e9d13c8c689..ccc1d50db83 100644 --- a/jetty-client/src/main/config/modules/client.mod +++ b/jetty-client/src/main/config/modules/client.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds the Jetty HTTP client to the server classpath. diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java index 448dd426d16..aa359c69b80 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java @@ -19,6 +19,8 @@ package org.eclipse.jetty.client; import java.nio.channels.Selector; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; @@ -30,14 +32,37 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.SocketAddressResolver; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +@RunWith(Parameterized.class) public class LivelockTest { + @Parameterized.Parameters(name = "server={0}, client={1}") + public static List data() + { + List data = new ArrayList<>(); + // Server-live-lock, Client-live-lock + data.add(new Object[] { true, true }); + data.add(new Object[] { true, false }); + data.add(new Object[] { false, true }); + data.add(new Object[] { false, false }); + return data; + } + + @Parameterized.Parameter(0) + public boolean serverLiveLock; + + @Parameterized.Parameter(1) + public boolean clientLiveLock; + private Server server; private ServerConnector connector; private HttpClient client; @@ -73,7 +98,7 @@ public class LivelockTest // ManagedSelectors that submit themselves in an attempt to cause a live lock // as there will always be an action available to run. - int count = 25; + int count = 5; HttpClientTransport transport = new HttpClientTransportOverHTTP(1); client = new HttpClient(transport, null); client.setMaxConnectionsPerDestination(2 * count); @@ -88,34 +113,21 @@ public class LivelockTest AtomicBoolean busy = new AtomicBoolean(true); - ManagedSelector clientSelector = client.getContainedBeans(ManagedSelector.class).stream().findAny().get(); - ManagedSelector.SelectorUpdate clientLivelock = new ManagedSelector.SelectorUpdate() + if (clientLiveLock) { - @Override - public void update(Selector selector) - { - sleep(10); - if (busy.get()) - clientSelector.submit(this); - } - }; - clientSelector.submit(clientLivelock); - - ManagedSelector serverSelector = connector.getContainedBeans(ManagedSelector.class).stream().findAny().get(); - ManagedSelector.SelectorUpdate serverLivelock = new ManagedSelector.SelectorUpdate() + ManagedSelector clientSelector = client.getContainedBeans(ManagedSelector.class).stream().findAny().get(); + busyLiveLock(busy, clientSelector); + } + + if (serverLiveLock) { - @Override - public void update(Selector selector) - { - sleep(10); - if (busy.get()) - serverSelector.submit(this); - } - }; - serverSelector.submit(serverLivelock); + ManagedSelector serverSelector = connector.getContainedBeans(ManagedSelector.class).stream().findAny().get(); + busyLiveLock(busy, serverSelector); + } int requestRate = 5; long pause = 1000 / requestRate; + Logger clientLog = Log.getLogger("TESTClient"); CountDownLatch latch = new CountDownLatch(count); for (int i = 0; i < count; ++i) { @@ -125,6 +137,13 @@ public class LivelockTest { if (result.isSucceeded() && result.getResponse().getStatus() == HttpStatus.OK_200) latch.countDown(); + else + { + if(result.getRequestFailure() != null) + clientLog.warn(result.getRequestFailure()); + if(result.getResponseFailure() != null) + clientLog.warn(result.getResponseFailure()); + } }); sleep(pause); } @@ -134,11 +153,26 @@ public class LivelockTest busy.set(false); } - private void sleep(long time) + private void busyLiveLock(AtomicBoolean busy, ManagedSelector managedSelector) + { + ManagedSelector.SelectorUpdate liveLock = new ManagedSelector.SelectorUpdate() + { + @Override + public void update(Selector selector) + { + sleep(10); + if (busy.get()) + managedSelector.submit(this); + } + }; + managedSelector.submit(liveLock); + } + + private void sleep(long millis) { try { - Thread.sleep(time); + TimeUnit.MILLISECONDS.sleep(millis); } catch (InterruptedException x) { diff --git a/jetty-client/src/test/resources/jetty-logging.properties b/jetty-client/src/test/resources/jetty-logging.properties index a2296dfdf69..3f7f23333ae 100644 --- a/jetty-client/src/test/resources/jetty-logging.properties +++ b/jetty-client/src/test/resources/jetty-logging.properties @@ -1,5 +1,5 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -#org.eclipse.jetty.LEVEL=DEBUG +class=org.eclipse.jetty.util.log.StdErrLog +#org.eclipse.jetty.LEVEL=INFO #org.eclipse.jetty.client.LEVEL=DEBUG #org.eclipse.jetty.io.ChannelEndPoint.LEVEL=DEBUG #org.eclipse.jetty.http.LEVEL=DEBUG diff --git a/jetty-deploy/src/main/config/modules/deploy.mod b/jetty-deploy/src/main/config/modules/deploy.mod index 737e24f2e5d..6321ae50496 100644 --- a/jetty-deploy/src/main/config/modules/deploy.mod +++ b/jetty-deploy/src/main/config/modules/deploy.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables webapplication deployment from the webapps directory. diff --git a/jetty-deploy/src/main/config/modules/global-webapp-common.mod b/jetty-deploy/src/main/config/modules/global-webapp-common.mod index 2785fef3c8c..59b7386f05a 100644 --- a/jetty-deploy/src/main/config/modules/global-webapp-common.mod +++ b/jetty-deploy/src/main/config/modules/global-webapp-common.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables Deployer to apply common configuration to all webapp deployments diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml index 8c92a955625..32a051f13e7 100644 --- a/jetty-distribution/pom.xml +++ b/jetty-distribution/pom.xml @@ -398,29 +398,37 @@ + org.eclipse.jetty jetty-home ${project.version} pom + true org.eclipse.jetty test-jetty-webapp war ${project.version} + true org.eclipse.jetty test-proxy-webapp war ${project.version} + true org.eclipse.jetty.example-async-rest example-async-rest-webapp ${project.version} war + true org.eclipse.jetty @@ -428,6 +436,7 @@ ${project.version} html zip + true diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/screen-empty-base-listconfig.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/screen-empty-base-listconfig.adoc index 113f785ded3..712487db306 100644 --- a/jetty-documentation/src/main/asciidoc/administration/startup/screen-empty-base-listconfig.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/startup/screen-empty-base-listconfig.adoc @@ -59,10 +59,6 @@ System Properties: Properties: ----------- java.version = 1.8.0_92 - java.version.major = 1 - java.version.minor = 8 - java.version.revision = 0 - java.version.update = 92 Jetty Server Classpath: ----------------------- diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc index 4b38f264772..b63440dda76 100644 --- a/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/startup/screen-http-webapp-deploy-listconfig.adoc @@ -59,10 +59,6 @@ System Properties: Properties: ----------- java.version = 1.8.0_92 - java.version.major = 1 - java.version.minor = 8 - java.version.revision = 0 - java.version.update = 92 Jetty Server Classpath: ----------------------- diff --git a/jetty-documentation/src/main/asciidoc/administration/startup/startup-modules.adoc b/jetty-documentation/src/main/asciidoc/administration/startup/startup-modules.adoc index e198222ee56..ee2ff06ebe3 100644 --- a/jetty-documentation/src/main/asciidoc/administration/startup/startup-modules.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/startup/startup-modules.adoc @@ -148,6 +148,14 @@ This is done by editing the associated ini file for the module. If your server setup is using a centralized ini configuration, you will edit the `${jetty.base}/server.ini` file. If you have elected to manage each module within it's own ini file, you can find these files in the `${jetty.base}/start.d` directory. +____ +[IMPORTANT] +It is important that you *do not* modify the module files in the `$JETTY_HOME/modules` directory. +$JETTY_HOME should always remain a standard of truth. +If you want to make a change to an actual module file (not the values in its `ini-template`), either edit its associated `ini` file in the `$JETTY_BASE/start.d` directory or make a copy of the desired module file and copy it to the `$JETTY_BASE` directory and edit it there. +The start.jar reads local `$JETTY_BASE/modules` files (if they exist) before scanning `$JETTY_HOME`. +____ + When a module is activated, a number of properties are set by default. To view these defaults, open up the associated ini file. Listed in the ini file is the associated module file and any properties that can be set. diff --git a/jetty-documentation/src/main/asciidoc/configuring/connectors/configuring-ssl.adoc b/jetty-documentation/src/main/asciidoc/configuring/connectors/configuring-ssl.adoc index 14534ce8886..41408190c55 100644 --- a/jetty-documentation/src/main/asciidoc/configuring/connectors/configuring-ssl.adoc +++ b/jetty-documentation/src/main/asciidoc/configuring/connectors/configuring-ssl.adoc @@ -719,10 +719,10 @@ This is _not_ a recommended usage. ____ [[conscrypt]] -===== Conscrypt SSL +==== Conscrypt SSL -Jetty also includes support for Google's https://github.com/google/conscrypt/[Conscrypt SSL], which is built on their fork of https://www.openssl.org/[OpenSSL], https://boringssl.googlesource.com/boringssl/[BoringSSL]. -Implementing Conscrypt is very straightforward process - simply instantiate an instance of Conscrypt's `OpenSSLProvider` and set `Conscrypt` as a provider for Jetty's `SslContextFactory`: +Jetty includes support for Google's https://github.com/google/conscrypt/[Conscrypt SSL], which is built on their fork of https://www.openssl.org/[OpenSSL], https://boringssl.googlesource.com/boringssl/[BoringSSL]. +Implementing Conscrypt for the link:{GITBROWSEURL}/jetty-alpn/jetty-alpn-conscrypt-server/src/test/java/org/eclipse/jetty/alpn/conscrypt/server/ConscryptHTTP2Server.java[server] or link:{GITBROWSEURL}/jetty-alpn/jetty-alpn-conscrypt-client/src/test/java/org/eclipse/jetty/alpn/java/client/ConscryptHTTP2Client.java[client] is very straightforward process - simply instantiate an instance of Conscrypt's `OpenSSLProvider` and set `Conscrypt` as a provider for Jetty's `SslContextFactory`: [source, java, subs="{sub-order}"] ---- diff --git a/jetty-documentation/src/main/asciidoc/development/clients/http/http-client-authentication.adoc b/jetty-documentation/src/main/asciidoc/development/clients/http/http-client-authentication.adoc index 52c7b224bf4..fa954e06721 100644 --- a/jetty-documentation/src/main/asciidoc/development/clients/http/http-client-authentication.adoc +++ b/jetty-documentation/src/main/asciidoc/development/clients/http/http-client-authentication.adoc @@ -75,6 +75,17 @@ URI uri = URI.create("http://domain.com/secure"); auth.addAuthenticationResult(new BasicAuthentication.BasicResult(uri, "username", "password")); ---- -In this way, the original request is enriched by `HttpClient` immediately with the `Authorization` header, and the server should respond with a 200 and the resource content rather than with the 401 and the challenge. +In this way, requests for the given URI are enriched by `HttpClient` immediately with the `Authorization` header, and the server should respond with a 200 and the resource content rather than with the 401 and the challenge. + +It is also possible to preempt the authentication for a single request only, in this way: + +[source, java, subs="{sub-order}"] +---- +URI uri = URI.create("http://domain.com/secure"); +Authentication.Result authn = new BasicAuthentication.BasicResult(uri, "username", "password") +Request request = httpClient.newRequest(uri); +authn.apply(request); +request.send(); +---- See also the link:#http-client-proxy-authentication[proxy authentication section] for further information about how authentication works with HTTP proxies. diff --git a/jetty-fcgi/fcgi-server/src/main/config/modules/fcgi.mod b/jetty-fcgi/fcgi-server/src/main/config/modules/fcgi.mod index 6a4beaf1ab1..9cb340d4387 100644 --- a/jetty-fcgi/fcgi-server/src/main/config/modules/fcgi.mod +++ b/jetty-fcgi/fcgi-server/src/main/config/modules/fcgi.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds the FastCGI implementation to the classpath. diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod index c65ccd33704..9415b77ed9d 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables GCloud Datastore API and implementation diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod index 454bd6e5581..64e1fb2df00 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Control GCloud API classpath diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/session-store-gcloud.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/session-store-gcloud.mod index 1d21cff1b68..69054019de9 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/session-store-gcloud.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/session-store-gcloud.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables GCloudDatastore session management. diff --git a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod index daa55012162..2263ae0807b 100644 --- a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod +++ b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-embedded.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables session data store in an embedded Hazelcast Map diff --git a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod index 55baa0e3d68..c6a26fc7123 100644 --- a/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod +++ b/jetty-hazelcast/src/main/config/modules/session-store-hazelcast-remote.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables session data store in a remote Hazelcast Map diff --git a/jetty-home/src/main/resources/modules/conscrypt.mod b/jetty-home/src/main/resources/modules/conscrypt.mod index 0dfe600461e..85b885a89c5 100644 --- a/jetty-home/src/main/resources/modules/conscrypt.mod +++ b/jetty-home/src/main/resources/modules/conscrypt.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Installs the Conscrypt JSSE provider diff --git a/jetty-home/src/main/resources/modules/hawtio.mod b/jetty-home/src/main/resources/modules/hawtio.mod index fd0358ec0a6..a64f8327a0c 100644 --- a/jetty-home/src/main/resources/modules/hawtio.mod +++ b/jetty-home/src/main/resources/modules/hawtio.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Deploys the Hawtio console as a webapplication. diff --git a/jetty-home/src/main/resources/modules/jamon.mod b/jetty-home/src/main/resources/modules/jamon.mod index c8207f9af82..db81214f3e0 100644 --- a/jetty-home/src/main/resources/modules/jamon.mod +++ b/jetty-home/src/main/resources/modules/jamon.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Deploys the JAMon webapplication diff --git a/jetty-home/src/main/resources/modules/jminix.mod b/jetty-home/src/main/resources/modules/jminix.mod index 2e250ddeef3..7f2ff89e3a2 100644 --- a/jetty-home/src/main/resources/modules/jminix.mod +++ b/jetty-home/src/main/resources/modules/jminix.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Deploys the Jminix JMX Console within the server diff --git a/jetty-home/src/main/resources/modules/jolokia.mod b/jetty-home/src/main/resources/modules/jolokia.mod index 1edc38668a2..17ec799906c 100644 --- a/jetty-home/src/main/resources/modules/jolokia.mod +++ b/jetty-home/src/main/resources/modules/jolokia.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Deploys the Jolokia console as a web application. diff --git a/jetty-home/src/main/resources/modules/jsp.mod b/jetty-home/src/main/resources/modules/jsp.mod index 2bc7ba85225..12bbcd05b3c 100644 --- a/jetty-home/src/main/resources/modules/jsp.mod +++ b/jetty-home/src/main/resources/modules/jsp.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables JSP for all webapplications deployed on the server. diff --git a/jetty-home/src/main/resources/modules/jstl.mod b/jetty-home/src/main/resources/modules/jstl.mod index dedb2c052c1..7311f47315a 100644 --- a/jetty-home/src/main/resources/modules/jstl.mod +++ b/jetty-home/src/main/resources/modules/jstl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables JSTL for all webapplications deployed on the server diff --git a/jetty-home/src/main/resources/modules/setuid.mod b/jetty-home/src/main/resources/modules/setuid.mod index c1174ccba8d..be4f8476714 100644 --- a/jetty-home/src/main/resources/modules/setuid.mod +++ b/jetty-home/src/main/resources/modules/setuid.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the unix setUID configuration so that the server may be started as root to open privileged ports/files before diff --git a/jetty-home/src/main/resources/modules/stop.mod b/jetty-home/src/main/resources/modules/stop.mod index 6a86c04f4d7..a7b8c966c4d 100644 --- a/jetty-home/src/main/resources/modules/stop.mod +++ b/jetty-home/src/main/resources/modules/stop.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] This module causes jetty to stop immediately after starting. This is good for testing configuration and/or precompiling quickstart webapps diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java index d6884effcdf..30d8fc9d974 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java @@ -36,6 +36,7 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import static org.eclipse.jetty.http.HttpTokens.CARRIAGE_RETURN; +import static org.eclipse.jetty.http.HttpTokens.COLON; import static org.eclipse.jetty.http.HttpTokens.LINE_FEED; import static org.eclipse.jetty.http.HttpTokens.SPACE; import static org.eclipse.jetty.http.HttpTokens.TAB; @@ -1074,7 +1075,7 @@ public class HttpParser throw new BadMessageException(HttpStatus.BAD_REQUEST_400,"Header Folding"); // header value without name - continuation? - if (_valueString==null) + if (_valueString==null || _valueString.isEmpty()) { _string.setLength(0); _length=0; @@ -1166,10 +1167,6 @@ public class HttpParser default: { - // now handle the ch - if (bHttpTokens.SPACE && b!=HttpTokens.COLON) + switch(b) { - if (_header!=null) - { - setString(_header.asString()); - _header=null; - _headerString=null; - } - - _string.append((char)b); - _length=_string.length(); - break; - } - - // Fallthrough - - case WS_AFTER_NAME: - if (b==HttpTokens.COLON) - { - if (_headerString==null) - { + case SPACE: + case TAB: + //Ignore trailing whitespaces ? + if (!complianceViolation(HttpComplianceSection.NO_WS_AFTER_FIELD_NAME,null)) + { + _headerString=takeString(); + _header=HttpHeader.CACHE.get(_headerString); + _length=-1; + setState(FieldState.WS_AFTER_NAME); + break; + } + throw new IllegalCharacterException(_state,b,buffer); + + case COLON: _headerString=takeString(); _header=HttpHeader.CACHE.get(_headerString); - } - _length=-1; - - setState(FieldState.VALUE); - break; - } - - if (b==HttpTokens.LINE_FEED) - { - if (_headerString==null) - { - _headerString=takeString(); - _header=HttpHeader.CACHE.get(_headerString); - } - _string.setLength(0); - _valueString=""; - _length=-1; - - if (!complianceViolation(HttpComplianceSection.FIELD_COLON,_headerString)) - { - setState(FieldState.FIELD); + _length=-1; + setState(FieldState.VALUE); break; - } - } + + case LINE_FEED: + _headerString=takeString(); + _header=HttpHeader.CACHE.get(_headerString); + _string.setLength(0); + _valueString=""; + _length=-1; - //Ignore trailing whitespaces - if (b==HttpTokens.SPACE && !complianceViolation(HttpComplianceSection.NO_WS_AFTER_FIELD_NAME,null)) + if (!complianceViolation(HttpComplianceSection.FIELD_COLON,_headerString)) + { + setState(FieldState.FIELD); + break; + } + throw new IllegalCharacterException(_state,b,buffer); + + default: + if (b<0) + throw new IllegalCharacterException(_state,b,buffer); + + _string.append((char)b); + _length=_string.length(); + break; + } + break; + + case WS_AFTER_NAME: + + switch(b) { - setState(FieldState.WS_AFTER_NAME); - break; - } + case SPACE: + case TAB: + break; - throw new IllegalCharacterException(_state,b,buffer); + case COLON: + setState(FieldState.VALUE); + break; + + case LINE_FEED: + if (!complianceViolation(HttpComplianceSection.FIELD_COLON,_headerString)) + { + setState(FieldState.FIELD); + break; + } + throw new IllegalCharacterException(_state,b,buffer); + + default: + throw new IllegalCharacterException(_state,b,buffer); + } + break; case VALUE: - if (b>HttpTokens.SPACE || b<0) + switch(b) { - _string.append((char)(0xff&b)); - _length=_string.length(); - setState(FieldState.IN_VALUE); - break; - } - - if (b==HttpTokens.SPACE || b==HttpTokens.TAB) - break; - - if (b==HttpTokens.LINE_FEED) - { - _string.setLength(0); - _valueString=""; - _length=-1; - - setState(FieldState.FIELD); - break; - } - throw new IllegalCharacterException(_state,b,buffer); - - case IN_VALUE: - if (b>=HttpTokens.SPACE || b<0 || b==HttpTokens.TAB) - { - if (_valueString!=null) - { - setString(_valueString); - _valueString=null; - _field=null; - } - _string.append((char)(0xff&b)); - if (b>HttpTokens.SPACE || b<0) - _length=_string.length(); - break; - } - - if (b==HttpTokens.LINE_FEED) - { - if (_length > 0) - { - _valueString=takeString(); + case LINE_FEED: + _string.setLength(0); + _valueString=""; _length=-1; - } - setState(FieldState.FIELD); + + setState(FieldState.FIELD); + break; + + case SPACE: + case TAB: + break; + + default: + _string.append((char)(0xff&b)); + _length=_string.length(); + setState(FieldState.IN_VALUE); break; } - - throw new IllegalCharacterException(_state,b,buffer); - + break; + + case IN_VALUE: + switch(b) + { + case LINE_FEED: + if (_length > 0) + { + _valueString=takeString(); + _length=-1; + } + setState(FieldState.FIELD); + break; + + case SPACE: + case TAB: + _string.append((char)(0xff&b)); + break; + + default: + _string.append((char)(0xff&b)); + _length=_string.length(); + break; + } + break; + default: throw new IllegalStateException(_state.toString()); diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java index c6a428b8571..1df966dfbba 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java @@ -18,6 +18,7 @@ package org.eclipse.jetty.http; +import static org.eclipse.jetty.http.HttpComplianceSection.NO_FIELD_FOLDING; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -261,6 +262,8 @@ public class HttpParserTest "Host: localhost\r\n" + "Name: value\r\n" + " extra\r\n" + + "Name2: \r\n" + + "\tvalue2\r\n" + "\r\n"); HttpParser.RequestHandler handler = new Handler(); @@ -270,10 +273,12 @@ public class HttpParserTest Assert.assertThat(_bad, Matchers.nullValue()); Assert.assertEquals("Host", _hdr[0]); Assert.assertEquals("localhost", _val[0]); + Assert.assertEquals(2, _headers); Assert.assertEquals("Name", _hdr[1]); Assert.assertEquals("value extra", _val[1]); - Assert.assertEquals(1, _headers); - Assert.assertThat(_complianceViolation, contains(HttpComplianceSection.NO_FIELD_FOLDING)); + Assert.assertEquals("Name2", _hdr[2]); + Assert.assertEquals("value2", _val[2]); + Assert.assertThat(_complianceViolation, contains(NO_FIELD_FOLDING,NO_FIELD_FOLDING)); } @Test @@ -399,7 +404,7 @@ public class HttpParserTest ByteBuffer buffer = BufferUtil.toBuffer( "HTTP/1.1 204 No Content\r\n" + "Access-Control-Allow-Headers : Origin\r\n" + - "Other: value\r\n" + + "Other\t : value\r\n" + "\r\n"); HttpParser.ResponseHandler handler = new Handler(); @@ -422,7 +427,7 @@ public class HttpParserTest Assert.assertEquals("Other", _hdr[1]); Assert.assertEquals("value", _val[1]); - Assert.assertThat(_complianceViolation, contains(HttpComplianceSection.NO_WS_AFTER_FIELD_NAME)); + Assert.assertThat(_complianceViolation, contains(HttpComplianceSection.NO_WS_AFTER_FIELD_NAME,HttpComplianceSection.NO_WS_AFTER_FIELD_NAME)); } @Test @@ -709,7 +714,9 @@ public class HttpParserTest public void testBadHeaderEncoding() throws Exception { ByteBuffer buffer = BufferUtil.toBuffer( - "GET / HTTP/1.0\r\nH\u00e6der0: value0\r\n\n\n"); + "GET / HTTP/1.0\r\n" + + "H\u00e6der0: value0\r\n" + + "\n\n"); HttpParser.RequestHandler handler = new Handler(); HttpParser parser = new HttpParser(handler); diff --git a/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties b/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties index a7ef5da7827..287d28319e0 100644 --- a/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties +++ b/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties @@ -1,5 +1,5 @@ org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -org.eclipse.jetty.client.LEVEL=DEBUG +#org.eclipse.jetty.client.LEVEL=DEBUG org.eclipse.jetty.http2.hpack.LEVEL=INFO #org.eclipse.jetty.http2.LEVEL=DEBUG #org.eclipse.jetty.io.ssl.LEVEL=DEBUG diff --git a/jetty-http2/http2-server/src/main/config/modules/http2.mod b/jetty-http2/http2-server/src/main/config/modules/http2.mod index e5def621a6a..2ca6596e578 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables HTTP2 protocol support on the TLS(SSL) Connector, using the ALPN extension to select which protocol to use. diff --git a/jetty-http2/http2-server/src/main/config/modules/http2c.mod b/jetty-http2/http2-server/src/main/config/modules/http2c.mod index 228d5a8ca31..b109a8c4ce8 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2c.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2c.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the HTTP2C protocol on the HTTP Connector The connector will accept both HTTP/1 and HTTP/2 connections. diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod index 96b6acb23e1..e7c8f425f8a 100644 --- a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables session data store in a local Infinispan cache diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod index 1110aaadbd3..21dc1e65c9b 100644 --- a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables session data store in a local Infinispan cache diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod index 36493531d38..93903bd41a3 100644 --- a/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables session data store in a remote Infinispan cache diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod index 0ad03b4f512..844b47323cb 100644 --- a/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables session data store in a remote Infinispan cache diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java index 5695e988e45..105bbd74584 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java @@ -62,6 +62,8 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint protected final void shutdownInput() { + if (LOG.isDebugEnabled()) + LOG.debug("shutdownInput {}",this); while(true) { State s = _state.get(); @@ -114,6 +116,8 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint @Override public final void shutdownOutput() { + if (LOG.isDebugEnabled()) + LOG.debug("shutdownOutput {}",this); while(true) { State s = _state.get(); @@ -166,11 +170,15 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint @Override public final void close() { + if (LOG.isDebugEnabled()) + LOG.debug("close {}",this); close(null); } protected final void close(Throwable failure) { + if (LOG.isDebugEnabled()) + LOG.debug("close({}) {}",failure,this); while(true) { State s = _state.get(); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java index 36900ba547f..eb18828a44e 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java @@ -42,7 +42,6 @@ import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import org.eclipse.jetty.io.ManagedSelector.Connect; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; @@ -246,16 +245,15 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable @Override public void dump(Appendable out, String indent) throws IOException { + List keys; + List updates; Selector selector = _selector; - List keys = null; - List updates = null; if (selector != null && selector.isOpen()) { DumpKeys dump = new DumpKeys(); - String updatesAt; + String updatesAt = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now()); synchronized(ManagedSelector.this) { - updatesAt = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now()); updates = new ArrayList<>(_updates); _updates.addFirst(dump); _selecting = false; @@ -322,7 +320,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable return task; processUpdates(); - + updateKeys(); if (!select()) @@ -372,7 +370,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable LOG.debug("updates {}",updates); if (selector != null) - selector.wakeup(); + selector.wakeup(); } private boolean select() @@ -385,6 +383,8 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable if (LOG.isDebugEnabled()) LOG.debug("Selector {} waiting on select", selector); int selected = selector.select(); + if (selected == 0) + selected = selector.selectNow(); if (LOG.isDebugEnabled()) LOG.debug("Selector {} woken up from select, {}/{} selected", selector, selected, selector.keys().size()); @@ -397,7 +397,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable } _keys = selector.selectedKeys(); - _cursor = _keys.iterator(); + _cursor = _keys.isEmpty() ? Collections.emptyIterator() : _keys.iterator(); if (LOG.isDebugEnabled()) LOG.debug("Selector {} processing {} keys, {} updates", selector, _keys.size(), updates); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java index 1ac15fe0ce1..07441e3e4bb 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java @@ -81,7 +81,8 @@ import org.eclipse.jetty.util.thread.Invocable; public class SslConnection extends AbstractConnection { private static final Logger LOG = Log.getLogger(SslConnection.class); - + private static final ThreadLocal __tryWriteAgain = new ThreadLocal<>(); + private final List handshakeListeners = new ArrayList<>(); private final ByteBufferPool _bufferPool; private final SSLEngine _sslEngine; @@ -95,7 +96,7 @@ public class SslConnection extends AbstractConnection private int _renegotiationLimit = -1; private boolean _closedOutbound; private boolean _allowMissingCloseMessage = true; - + private abstract class RunnableTask implements Runnable, Invocable { private final String _operation; @@ -506,11 +507,12 @@ public class SslConnection extends AbstractConnection } else { + // TODO This should not be required and we should be able to do all retries within flush // We can get here because the WriteFlusher might not see progress // when it has just flushed the encrypted data, but not consumed anymore // of the application buffers. This is mostly avoided by another iteration - // within DecryptedEndPoint flush(), but I cannot convince myself that - // this is never ever the case. + // within DecryptedEndPoint flush(), but this still occurs sometime on some + // tests on some systems??? More investigation is needed! try_again = true; } } @@ -526,12 +528,35 @@ public class SslConnection extends AbstractConnection { // don't bother writing, just notify of close getWriteFlusher().onClose(); + return; + } + + // TODO this ugly recursion protection is only needed until we remove the try again + // logic from this method and make flush do the try again. + Boolean tryWriteAgain = __tryWriteAgain.get(); + if (tryWriteAgain==null) + { + try + { + // Keep running complete write until + __tryWriteAgain.set(Boolean.FALSE); + do + { + _runCompleteWrite.run(); + } + while (Boolean.TRUE.equals(__tryWriteAgain.get())); + } + finally + { + __tryWriteAgain.remove(); + } } else { - // Try again - _runCompleteWrite.run(); + // Don't recurse but get top caller to iterate + __tryWriteAgain.set(Boolean.TRUE); } + } } diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/ByteArrayEndPointTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/ByteArrayEndPointTest.java index 98acf13a35b..e50cf959623 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/ByteArrayEndPointTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/ByteArrayEndPointTest.java @@ -293,9 +293,9 @@ public class ByteArrayEndPointTest assertEquals("test", BufferUtil.toString(buffer)); // Wait for a read timeout. + long start = System.nanoTime(); fcb = new FutureCallback(); endp.fillInterested(fcb); - long start = System.nanoTime(); try { fcb.get(); @@ -308,40 +308,5 @@ public class ByteArrayEndPointTest assertThat(TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start), greaterThan(halfIdleTimeout)); assertThat("Endpoint open", endp.isOpen(), is(true)); - // We need to delay the write timeout test below from the read timeout test above. - // The reason is that the scheduler thread that fails the endPoint WriteFlusher - // because of the read timeout above runs concurrently with the write below, and - // if it runs just after the write below, the test fails because the write callback - // below fails immediately rather than after the idle timeout. - Thread.sleep(halfIdleTimeout); - - // Write more than the output capacity, then wait for idle timeout. - fcb = new FutureCallback(); - start = System.nanoTime(); - endp.write(fcb, BufferUtil.toBuffer("This is too long")); - try - { - fcb.get(); - fail(); - } - catch (ExecutionException t) - { - assertThat(t.getCause(), instanceOf(TimeoutException.class)); - } - assertThat(TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start), greaterThan(halfIdleTimeout)); - // Still open because it has not been oshut or closed explicitly. - assertThat("Endpoint open", endp.isOpen(), is(true)); - - // Make sure the endPoint is closed when the callback fails. - endp.fillInterested(new Closer(endp)); - Thread.sleep(halfIdleTimeout); - // Still open because it has not been oshut or closed explicitly. - assertThat("Endpoint open", endp.isOpen(), is(true)); - - // Shutdown output. - endp.shutdownOutput(); - - Thread.sleep(idleTimeout); - assertThat("Endpoint closed", endp.isOpen(), is(false)); } } diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointTest.java deleted file mode 100644 index dcaa5f7982c..00000000000 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointTest.java +++ /dev/null @@ -1,833 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2018 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.io; - -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.lessThan; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.Socket; -import java.net.SocketTimeoutException; -import java.nio.ByteBuffer; -import java.nio.channels.SelectableChannel; -import java.nio.channels.SelectionKey; -import java.nio.channels.ServerSocketChannel; -import java.nio.channels.SocketChannel; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.thread.QueuedThreadPool; -import org.eclipse.jetty.util.thread.Scheduler; -import org.eclipse.jetty.util.thread.TimerScheduler; -import org.hamcrest.Matchers; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -public class SelectChannelEndPointTest -{ - private static final Logger LOG = Log.getLogger(SelectChannelEndPointTest.class); - protected CountDownLatch _lastEndPointLatch; - protected volatile EndPoint _lastEndPoint; - protected ServerSocketChannel _connector; - protected QueuedThreadPool _threadPool = new QueuedThreadPool(); - protected Scheduler _scheduler = new TimerScheduler(); - protected SelectorManager _manager = new SelectorManager(_threadPool, _scheduler) - { - @Override - public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment) - { - return SelectChannelEndPointTest.this.newConnection(channel, endpoint); - } - - @Override - protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key) throws IOException - { - SocketChannelEndPoint endp = new SocketChannelEndPoint(channel, selector, key, getScheduler()); - endp.setIdleTimeout(60000); - _lastEndPoint = endp; - _lastEndPointLatch.countDown(); - return endp; - } - - }; - - // Must be volatile or the test may fail spuriously - protected volatile int _blockAt = 0; - private volatile int _writeCount = 1; - - @Before - public void startManager() throws Exception - { - System.gc(); - _writeCount = 1; - _lastEndPoint = null; - _lastEndPointLatch = new CountDownLatch(1); - _connector = ServerSocketChannel.open(); - _connector.socket().bind(null); - _scheduler.start(); - _threadPool.start(); - _manager.start(); - } - - @After - public void stopManager() throws Exception - { - _scheduler.stop(); - _manager.stop(); - _threadPool.stop(); - _connector.close(); - } - - protected Socket newClient() throws IOException - { - return new Socket(_connector.socket().getInetAddress(), _connector.socket().getLocalPort()); - } - - protected Connection newConnection(SelectableChannel channel, EndPoint endpoint) - { - return new TestConnection(endpoint); - } - - public class TestConnection extends AbstractConnection - { - volatile FutureCallback _blockingRead; - ByteBuffer _in = BufferUtil.allocate(32 * 1024); - ByteBuffer _out = BufferUtil.allocate(32 * 1024); - long _last = -1; - final CountDownLatch _latch; - - public TestConnection(EndPoint endp) - { - super(endp, _threadPool); - _latch=null; - } - - public TestConnection(EndPoint endp,CountDownLatch latch) - { - super(endp, _threadPool); - _latch=latch; - } - - @Override - public void onOpen() - { - super.onOpen(); - fillInterested(); - } - - @Override - public void onFillInterestedFailed(Throwable cause) - { - Callback blocking = _blockingRead; - if (blocking!=null) - { - _blockingRead=null; - blocking.failed(cause); - return; - } - super.onFillInterestedFailed(cause); - } - - @Override - public void onFillable() - { - if (_latch!=null) - { - try - { - _latch.await(); - } - catch (InterruptedException e) - { - e.printStackTrace(); - } - } - - Callback blocking = _blockingRead; - if (blocking!=null) - { - _blockingRead=null; - blocking.succeeded(); - return; - } - - EndPoint _endp = getEndPoint(); - try - { - _last = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - boolean progress = true; - while (progress) - { - progress = false; - - // Fill the input buffer with everything available - BufferUtil.compact(_in); - if (BufferUtil.isFull(_in)) - throw new IllegalStateException("FULL " + BufferUtil.toDetailString(_in)); - int filled = _endp.fill(_in); - if (filled > 0) - progress = true; - - // If the tests wants to block, then block - while (_blockAt > 0 && _endp.isOpen() && _in.remaining() < _blockAt) - { - FutureCallback future = _blockingRead = new FutureCallback(); - fillInterested(); - future.get(); - filled = _endp.fill(_in); - progress |= filled > 0; - } - - // Copy to the out buffer - if (BufferUtil.hasContent(_in) && BufferUtil.append(_out, _in) > 0) - progress = true; - - // Blocking writes - if (BufferUtil.hasContent(_out)) - { - ByteBuffer out = _out.duplicate(); - BufferUtil.clear(_out); - for (int i = 0; i < _writeCount; i++) - { - FutureCallback blockingWrite = new FutureCallback(); - _endp.write(blockingWrite, out.asReadOnlyBuffer()); - blockingWrite.get(); - } - progress = true; - } - - // are we done? - if (_endp.isInputShutdown()) - _endp.shutdownOutput(); - } - - if (_endp.isOpen()) - fillInterested(); - } - catch (ExecutionException e) - { - // Timeout does not close, so echo exception then shutdown - try - { - FutureCallback blockingWrite = new FutureCallback(); - _endp.write(blockingWrite, BufferUtil.toBuffer("EE: " + BufferUtil.toString(_in))); - blockingWrite.get(); - _endp.shutdownOutput(); - } - catch (Exception e2) - { - // e2.printStackTrace(); - } - } - catch (InterruptedException | EofException e) - { - Log.getRootLogger().ignore(e); - } - catch (Exception e) - { - Log.getRootLogger().warn(e); - } - finally - { - } - } - } - - @Test - public void testEcho() throws Exception - { - Socket client = newClient(); - - client.setSoTimeout(60000); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - // Write client to server - client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); - - // Verify echo server to client - for (char c : "HelloWorld".toCharArray()) - { - int b = client.getInputStream().read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - - // wait for read timeout - client.setSoTimeout(500); - long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - try - { - client.getInputStream().read(); - Assert.fail(); - } - catch (SocketTimeoutException e) - { - long duration = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start; - Assert.assertThat("timeout duration", duration, greaterThanOrEqualTo(400L)); - } - - // write then shutdown - client.getOutputStream().write("Goodbye Cruel TLS".getBytes(StandardCharsets.UTF_8)); - - // Verify echo server to client - for (char c : "Goodbye Cruel TLS".toCharArray()) - { - int b = client.getInputStream().read(); - Assert.assertThat("expect valid char integer", b, greaterThan(0)); - assertEquals("expect characters to be same", c, (char)b); - } - client.close(); - - for (int i = 0; i < 10; ++i) - { - if (server.isOpen()) - Thread.sleep(10); - else - break; - } - assertFalse(server.isOpen()); - } - - @Test - public void testShutdown() throws Exception - { - Socket client = newClient(); - - client.setSoTimeout(500); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - // Write client to server - client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); - - // Verify echo server to client - for (char c : "HelloWorld".toCharArray()) - { - int b = client.getInputStream().read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - - // wait for read timeout - long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - try - { - client.getInputStream().read(); - Assert.fail(); - } - catch (SocketTimeoutException e) - { - assertTrue(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start >= 400); - } - - // write then shutdown - client.getOutputStream().write("Goodbye Cruel TLS".getBytes(StandardCharsets.UTF_8)); - client.shutdownOutput(); - - // Verify echo server to client - for (char c : "Goodbye Cruel TLS".toCharArray()) - { - int b = client.getInputStream().read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - - // Read close - assertEquals(-1, client.getInputStream().read()); - } - - @Test - public void testReadBlocked() throws Exception - { - Socket client = newClient(); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - OutputStream clientOutputStream = client.getOutputStream(); - InputStream clientInputStream = client.getInputStream(); - - int specifiedTimeout = 1000; - client.setSoTimeout(specifiedTimeout); - - // Write 8 and cause block waiting for 10 - _blockAt = 10; - clientOutputStream.write("12345678".getBytes(StandardCharsets.UTF_8)); - clientOutputStream.flush(); - - Assert.assertTrue(_lastEndPointLatch.await(1, TimeUnit.SECONDS)); - _lastEndPoint.setIdleTimeout(10 * specifiedTimeout); - Thread.sleep((11 * specifiedTimeout) / 10); - - long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - try - { - int b = clientInputStream.read(); - Assert.fail("Should have timed out waiting for a response, but read " + b); - } - catch (SocketTimeoutException e) - { - int elapsed = Long.valueOf(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start).intValue(); - Assert.assertThat("Expected timeout", elapsed, greaterThanOrEqualTo(3 * specifiedTimeout / 4)); - } - - // write remaining characters - clientOutputStream.write("90ABCDEF".getBytes(StandardCharsets.UTF_8)); - clientOutputStream.flush(); - - // Verify echo server to client - for (char c : "1234567890ABCDEF".toCharArray()) - { - int b = clientInputStream.read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - } - - @Test - public void testIdle() throws Exception - { - int idleTimeout = 2000; - - Socket client = newClient(); - - client.setSoTimeout(idleTimeout*10); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - // Write client to server - long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); - - // Verify echo server to client - for (char c : "HelloWorld".toCharArray()) - { - int b = client.getInputStream().read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - - Assert.assertTrue(_lastEndPointLatch.await(1, TimeUnit.SECONDS)); - _lastEndPoint.setIdleTimeout(idleTimeout); - - // read until idle shutdown received - int b = client.getInputStream().read(); - assertEquals(-1, b); - long idle = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start; - assertThat(idle, greaterThan(idleTimeout / 2L)); - assertThat(idle, lessThan(idleTimeout * 2L)); - - // But endpoint may still be open for a little bit. - for (int i = 0; i < 20; ++i) - { - if (_lastEndPoint.isOpen()) - Thread.sleep(2 * idleTimeout / 10); - else - break; - } - assertFalse(_lastEndPoint.isOpen()); - } - - @Test - public void testBlockedReadIdle() throws Exception - { - Socket client = newClient(); - InputStream clientInputStream = client.getInputStream(); - OutputStream clientOutputStream = client.getOutputStream(); - - client.setSoTimeout(5000); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - // Write client to server - clientOutputStream.write("HelloWorld".getBytes(StandardCharsets.UTF_8)); - - // Verify echo server to client - for (char c : "HelloWorld".toCharArray()) - { - int b = clientInputStream.read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - - Assert.assertTrue(_lastEndPointLatch.await(1, TimeUnit.SECONDS)); - int idleTimeout = 500; - _lastEndPoint.setIdleTimeout(idleTimeout); - - // Write 8 and cause block waiting for 10 - _blockAt = 10; - clientOutputStream.write("12345678".getBytes(StandardCharsets.UTF_8)); - clientOutputStream.flush(); - - // read until idle shutdown received - long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - int b = clientInputStream.read(); - assertEquals('E', b); - long idle = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start; - assertTrue(idle > idleTimeout / 2); - assertTrue(idle < idleTimeout * 2); - - for (char c : "E: 12345678".toCharArray()) - { - b = clientInputStream.read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - b = clientInputStream.read(); - assertEquals(-1,b); - - // But endpoint is still open. - if(_lastEndPoint.isOpen()) - // Wait for another idle callback - Thread.sleep(idleTimeout * 2); - - // endpoint is closed. - assertFalse(_lastEndPoint.isOpen()); - } - - @Test - public void testStress() throws Exception - { - Socket client = newClient(); - client.setSoTimeout(30000); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - final int writes = 200000; - - final byte[] bytes = "HelloWorld-".getBytes(StandardCharsets.UTF_8); - byte[] count = "0\n".getBytes(StandardCharsets.UTF_8); - BufferedOutputStream out = new BufferedOutputStream(client.getOutputStream()); - final CountDownLatch latch = new CountDownLatch(writes); - final InputStream in = new BufferedInputStream(client.getInputStream()); - final long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - out.write(bytes); - out.write(count); - out.flush(); - - Assert.assertTrue(_lastEndPointLatch.await(1, TimeUnit.SECONDS)); - _lastEndPoint.setIdleTimeout(5000); - - new Thread() - { - @Override - public void run() - { - Thread.currentThread().setPriority(MAX_PRIORITY); - long last = -1; - int count = -1; - try - { - while (latch.getCount() > 0) - { - // Verify echo server to client - for (byte b0 : bytes) - { - int b = in.read(); - Assert.assertThat(b, greaterThan(0)); - assertEquals(0xff & b0, b); - } - - count = 0; - int b = in.read(); - while (b > 0 && b != '\n') - { - count = count * 10 + (b - '0'); - b = in.read(); - } - last = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - - //if (latch.getCount()%1000==0) - // System.out.println(writes-latch.getCount()); - - latch.countDown(); - } - } - catch (Throwable e) - { - - long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - System.err.println("count=" + count); - System.err.println("latch=" + latch.getCount()); - System.err.println("time=" + (now - start)); - System.err.println("last=" + (now - last)); - System.err.println("endp=" + _lastEndPoint); - System.err.println("conn=" + _lastEndPoint.getConnection()); - - e.printStackTrace(); - } - } - }.start(); - - // Write client to server - for (int i = 1; i < writes; i++) - { - out.write(bytes); - out.write(Integer.toString(i).getBytes(StandardCharsets.ISO_8859_1)); - out.write('\n'); - if (i % 1000 == 0) - { - //System.err.println(i+"/"+writes); - out.flush(); - } - Thread.yield(); - } - out.flush(); - - long last = latch.getCount(); - while (!latch.await(5, TimeUnit.SECONDS)) - { - //System.err.println(latch.getCount()); - if (latch.getCount() == last) - Assert.fail(); - last = latch.getCount(); - } - - assertEquals(0, latch.getCount()); - } - - @Test - public void testWriteBlocked() throws Exception - { - Socket client = newClient(); - - client.setSoTimeout(10000); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - // Write client to server - _writeCount = 10000; - String data = "Now is the time for all good men to come to the aid of the party"; - client.getOutputStream().write(data.getBytes(StandardCharsets.UTF_8)); - BufferedInputStream in = new BufferedInputStream(client.getInputStream()); - - int byteNum = 0; - try - { - for (int i = 0; i < _writeCount; i++) - { - if (i % 1000 == 0) - TimeUnit.MILLISECONDS.sleep(200); - - // Verify echo server to client - for (int j = 0; j < data.length(); j++) - { - char c = data.charAt(j); - int b = in.read(); - byteNum++; - assertTrue(b > 0); - assertEquals("test-" + i + "/" + j,c,(char)b); - } - - if (i == 0) - _lastEndPoint.setIdleTimeout(60000); - } - } - catch (SocketTimeoutException e) - { - System.err.println("SelectorManager.dump() = " + _manager.dump()); - LOG.warn("Server: " + server); - LOG.warn("Error reading byte #" + byteNum,e); - throw e; - } - - client.close(); - - for (int i = 0; i < 10; ++i) - { - if (server.isOpen()) - Thread.sleep(10); - else - break; - } - assertFalse(server.isOpen()); - } - - - // TODO make this test reliable - @Test - @Ignore - public void testRejectedExecution() throws Exception - { - _manager.stop(); - _threadPool.stop(); - - final CountDownLatch latch = new CountDownLatch(1); - - BlockingQueue q = new ArrayBlockingQueue<>(4); - _threadPool = new QueuedThreadPool(4,4,60000,q); - _manager = new SelectorManager(_threadPool, _scheduler, 1) - { - - @Override - protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) throws IOException - { - SocketChannelEndPoint endp = new SocketChannelEndPoint(channel,selector,selectionKey,getScheduler()); - _lastEndPoint = endp; - _lastEndPointLatch.countDown(); - return endp; - } - - @Override - public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment) throws IOException - { - return new TestConnection(endpoint,latch); - } - }; - - _threadPool.start(); - _manager.start(); - - AtomicInteger timeout = new AtomicInteger(); - AtomicInteger rejections = new AtomicInteger(); - AtomicInteger echoed = new AtomicInteger(); - - CountDownLatch closed = new CountDownLatch(20); - for (int i=0;i<20;i++) - { - new Thread() - { - @Override - public void run() - { - try(Socket client = newClient();) - { - client.setSoTimeout(5000); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - // Write client to server - client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); - client.getOutputStream().flush(); - client.shutdownOutput(); - - // Verify echo server to client - for (char c : "HelloWorld".toCharArray()) - { - int b = client.getInputStream().read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - assertEquals(-1,client.getInputStream().read()); - echoed.incrementAndGet(); - } - catch(SocketTimeoutException x) - { - x.printStackTrace(); - timeout.incrementAndGet(); - } - catch(Throwable x) - { - rejections.incrementAndGet(); - } - finally - { - closed.countDown(); - } - } - }.start(); - } - - // unblock the handling - latch.countDown(); - - // wait for all clients to complete or fail - closed.await(); - - // assert some clients must have been rejected - Assert.assertThat(rejections.get(),Matchers.greaterThan(0)); - // but not all of them - Assert.assertThat(rejections.get(),Matchers.lessThan(20)); - // none should have timed out - Assert.assertThat(timeout.get(),Matchers.equalTo(0)); - // and the rest should have worked - Assert.assertThat(echoed.get(),Matchers.equalTo(20-rejections.get())); - - // and the selector is still working for new requests - try(Socket client = newClient();) - { - client.setSoTimeout(5000); - - SocketChannel server = _connector.accept(); - server.configureBlocking(false); - - _manager.accept(server); - - // Write client to server - client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); - client.getOutputStream().flush(); - client.shutdownOutput(); - - // Verify echo server to client - for (char c : "HelloWorld".toCharArray()) - { - int b = client.getInputStream().read(); - assertTrue(b > 0); - assertEquals(c, (char)b); - } - assertEquals(-1,client.getInputStream().read()); - } - - } -} diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointInterestsTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointInterestsTest.java similarity index 99% rename from jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointInterestsTest.java rename to jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointInterestsTest.java index 1a6ad99f879..04e17c9e4a0 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointInterestsTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointInterestsTest.java @@ -43,7 +43,7 @@ import org.junit.After; import org.junit.Assert; import org.junit.Test; -public class SelectChannelEndPointInterestsTest +public class SocketChannelEndPointInterestsTest { private QueuedThreadPool threadPool; private Scheduler scheduler; diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/EndPointTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointOpenCloseTest.java similarity index 81% rename from jetty-io/src/test/java/org/eclipse/jetty/io/EndPointTest.java rename to jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointOpenCloseTest.java index 794ab2d69a7..3ba75ca4684 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/EndPointTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointOpenCloseTest.java @@ -23,25 +23,51 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.nio.ByteBuffer; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; import org.eclipse.jetty.util.BufferUtil; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; -public abstract class EndPointTest +public class SocketChannelEndPointOpenCloseTest { - public static class EndPointPair + public static class EndPointPair { - public T client; - public T server; + public SocketChannelEndPoint client; + public SocketChannelEndPoint server; } - protected abstract EndPointPair newConnection() throws Exception; + static ServerSocketChannel connector; + @BeforeClass + public static void open() throws Exception + { + connector = ServerSocketChannel.open(); + connector.socket().bind(null); + } + + @AfterClass + public static void close() throws Exception + { + connector.close(); + connector=null; + } + + private EndPointPair newConnection() throws Exception + { + EndPointPair c = new EndPointPair(); + + c.client=new SocketChannelEndPoint(SocketChannel.open(connector.socket().getLocalSocketAddress()),null,null,null); + c.server=new SocketChannelEndPoint(connector.accept(),null,null,null); + return c; + } @Test public void testClientServerExchange() throws Exception { - EndPointPair c = newConnection(); + EndPointPair c = newConnection(); ByteBuffer buffer = BufferUtil.allocate(4096); // Client sends a request @@ -110,15 +136,12 @@ public abstract class EndPointTest assertTrue(c.client.isOutputShutdown()); assertFalse(c.server.isOpen()); assertTrue(c.server.isOutputShutdown()); - } - - @Test public void testClientClose() throws Exception { - EndPointPair c = newConnection(); + EndPointPair c = newConnection(); ByteBuffer buffer = BufferUtil.allocate(4096); c.client.flush(BufferUtil.toBuffer("request")); diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java index 691b7ee1e68..017104b7954 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java @@ -18,49 +18,832 @@ package org.eclipse.jetty.io; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.nio.ByteBuffer; +import java.nio.channels.SelectableChannel; +import java.nio.channels.SelectionKey; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLSocket; -public class SocketChannelEndPointTest extends EndPointTest +import org.eclipse.jetty.io.ssl.SslConnection; +import org.eclipse.jetty.toolchain.test.MavenTestingUtils; +import org.eclipse.jetty.toolchain.test.TestTracker; +import org.eclipse.jetty.util.BufferUtil; +import org.eclipse.jetty.util.Callback; +import org.eclipse.jetty.util.FutureCallback; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.eclipse.jetty.util.thread.Scheduler; +import org.eclipse.jetty.util.thread.TimerScheduler; +import org.hamcrest.Matchers; +import org.junit.After; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@SuppressWarnings("Duplicates") +@RunWith(Parameterized.class) +public class SocketChannelEndPointTest { - static ServerSocketChannel connector; + private static final Logger LOG = Log.getLogger(SocketChannelEndPoint.class); - @BeforeClass - public static void open() throws Exception + public interface Scenario { - connector = ServerSocketChannel.open(); - connector.socket().bind(null); + Socket newClient(ServerSocketChannel connector) throws IOException; + + Connection newConnection(SelectableChannel channel, EndPoint endPoint, Executor executor, AtomicInteger blockAt, AtomicInteger writeCount); + + boolean supportsHalfCloses(); } - @AfterClass - public static void close() throws Exception + @Parameterized.Parameters(name = "{0}") + public static List data() throws Exception { - connector.close(); - connector=null; + List ret = new ArrayList<>(); + + NormalScenario normalScenario = new NormalScenario(); + ret.add(new Object[]{normalScenario}); + ret.add(new Object[]{new SslScenario(normalScenario)}); + + return ret; } - @Override - protected EndPointPair newConnection() throws Exception - { - EndPointPair c = new EndPointPair<>(); + @Rule + public TestTracker tracker = new TestTracker(); - c.client=new SocketChannelEndPoint(SocketChannel.open(connector.socket().getLocalSocketAddress()),null,null,null); - c.server=new SocketChannelEndPoint(connector.accept(),null,null,null); - return c; + private final Scenario _scenario; + + private ServerSocketChannel _connector; + private QueuedThreadPool _threadPool; + private Scheduler _scheduler; + private SelectorManager _manager; + private volatile EndPoint _lastEndPoint; + private CountDownLatch _lastEndPointLatch; + + // Must be volatile or the test may fail spuriously + private AtomicInteger _blockAt = new AtomicInteger(0); + private AtomicInteger _writeCount = new AtomicInteger(1); + + public SocketChannelEndPointTest(Scenario scenario) throws Exception + { + _scenario = scenario; + _threadPool = new QueuedThreadPool(); + _scheduler = new TimerScheduler(); + _manager = new ScenarioSelectorManager(_threadPool, _scheduler); + + _lastEndPointLatch = new CountDownLatch(1); + _connector = ServerSocketChannel.open(); + _connector.socket().bind(null); + _scheduler.start(); + _threadPool.start(); + _manager.start(); } - @Override - public void testClientClose() throws Exception + @After + public void stopManager() throws Exception { - super.testClientClose(); + _scheduler.stop(); + _manager.stop(); + _threadPool.stop(); + _connector.close(); } - @Override - public void testClientServerExchange() throws Exception + @Test + public void testEcho() throws Exception { - super.testClientServerExchange(); + Socket client = _scenario.newClient(_connector); + + client.setSoTimeout(60000); + + SocketChannel server = _connector.accept(); + server.configureBlocking(false); + + _manager.accept(server); + + // Write client to server + client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); + + // Verify echo server to client + for (char c : "HelloWorld".toCharArray()) + { + int b = client.getInputStream().read(); + assertTrue(b > 0); + assertEquals(c, (char) b); + } + + // wait for read timeout + client.setSoTimeout(500); + long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + try + { + client.getInputStream().read(); + Assert.fail(); + } + catch (SocketTimeoutException e) + { + long duration = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start; + Assert.assertThat("timeout duration", duration, greaterThanOrEqualTo(400L)); + } + + // write then shutdown + client.getOutputStream().write("Goodbye Cruel TLS".getBytes(StandardCharsets.UTF_8)); + + // Verify echo server to client + for (char c : "Goodbye Cruel TLS".toCharArray()) + { + int b = client.getInputStream().read(); + Assert.assertThat("expect valid char integer", b, greaterThan(0)); + assertEquals("expect characters to be same", c, (char) b); + } + client.close(); + + for (int i = 0; i < 10; ++i) + { + if (server.isOpen()) + Thread.sleep(10); + else + break; + } + assertFalse(server.isOpen()); + } + + @Test + public void testShutdown() throws Exception + { + assumeTrue("Scenario supports half-close", _scenario.supportsHalfCloses()); + + Socket client = _scenario.newClient(_connector); + + client.setSoTimeout(500); + + SocketChannel server = _connector.accept(); + server.configureBlocking(false); + + _manager.accept(server); + + // Write client to server + client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); + + // Verify echo server to client + for (char c : "HelloWorld".toCharArray()) + { + int b = client.getInputStream().read(); + assertTrue(b > 0); + assertEquals(c, (char) b); + } + + // wait for read timeout + long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + try + { + client.getInputStream().read(); + Assert.fail(); + } + catch (SocketTimeoutException e) + { + assertTrue(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start >= 400); + } + + // write then shutdown + client.getOutputStream().write("Goodbye Cruel TLS".getBytes(StandardCharsets.UTF_8)); + client.shutdownOutput(); + + // Verify echo server to client + for (char c : "Goodbye Cruel TLS".toCharArray()) + { + int b = client.getInputStream().read(); + assertTrue(b > 0); + assertEquals(c, (char) b); + } + + // Read close + assertEquals(-1, client.getInputStream().read()); + } + + @Test + public void testReadBlocked() throws Exception + { + Socket client = _scenario.newClient(_connector); + + SocketChannel server = _connector.accept(); + server.configureBlocking(false); + + _manager.accept(server); + + OutputStream clientOutputStream = client.getOutputStream(); + InputStream clientInputStream = client.getInputStream(); + + int specifiedTimeout = 1000; + client.setSoTimeout(specifiedTimeout); + + // Write 8 and cause block waiting for 10 + _blockAt.set(10); + clientOutputStream.write("12345678".getBytes(StandardCharsets.UTF_8)); + clientOutputStream.flush(); + + Assert.assertTrue(_lastEndPointLatch.await(1, TimeUnit.SECONDS)); + _lastEndPoint.setIdleTimeout(10 * specifiedTimeout); + Thread.sleep((11 * specifiedTimeout) / 10); + + long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + try + { + int b = clientInputStream.read(); + Assert.fail("Should have timed out waiting for a response, but read " + b); + } + catch (SocketTimeoutException e) + { + int elapsed = Long.valueOf(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start).intValue(); + Assert.assertThat("Expected timeout", elapsed, greaterThanOrEqualTo(3 * specifiedTimeout / 4)); + } + + // write remaining characters + clientOutputStream.write("90ABCDEF".getBytes(StandardCharsets.UTF_8)); + clientOutputStream.flush(); + + // Verify echo server to client + for (char c : "1234567890ABCDEF".toCharArray()) + { + int b = clientInputStream.read(); + assertTrue(b > 0); + assertEquals(c, (char) b); + } + } + + @Test + public void testStress() throws Exception + { + Socket client = _scenario.newClient(_connector); + client.setSoTimeout(30000); + + SocketChannel server = _connector.accept(); + server.configureBlocking(false); + + _manager.accept(server); + final int writes = 200000; + + final byte[] bytes = "HelloWorld-".getBytes(StandardCharsets.UTF_8); + byte[] count = "0\n".getBytes(StandardCharsets.UTF_8); + BufferedOutputStream out = new BufferedOutputStream(client.getOutputStream()); + final CountDownLatch latch = new CountDownLatch(writes); + final InputStream in = new BufferedInputStream(client.getInputStream()); + final long start = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + out.write(bytes); + out.write(count); + out.flush(); + + Assert.assertTrue(_lastEndPointLatch.await(1, TimeUnit.SECONDS)); + _lastEndPoint.setIdleTimeout(5000); + + new Thread() + { + @Override + public void run() + { + Thread.currentThread().setPriority(MAX_PRIORITY); + long last = -1; + int count = -1; + try + { + while (latch.getCount() > 0) + { + // Verify echo server to client + for (byte b0 : bytes) + { + int b = in.read(); + Assert.assertThat(b, greaterThan(0)); + assertEquals(0xff & b0, b); + } + + count = 0; + int b = in.read(); + while (b > 0 && b != '\n') + { + count = count * 10 + (b - '0'); + b = in.read(); + } + last = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + + //if (latch.getCount()%1000==0) + // System.out.println(writes-latch.getCount()); + + latch.countDown(); + } + } + catch (Throwable e) + { + + long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + System.err.println("count=" + count); + System.err.println("latch=" + latch.getCount()); + System.err.println("time=" + (now - start)); + System.err.println("last=" + (now - last)); + System.err.println("endp=" + _lastEndPoint); + System.err.println("conn=" + _lastEndPoint.getConnection()); + + e.printStackTrace(); + } + } + }.start(); + + // Write client to server + for (int i = 1; i < writes; i++) + { + out.write(bytes); + out.write(Integer.toString(i).getBytes(StandardCharsets.ISO_8859_1)); + out.write('\n'); + if (i % 1000 == 0) + { + //System.err.println(i+"/"+writes); + out.flush(); + } + Thread.yield(); + } + out.flush(); + + long last = latch.getCount(); + while (!latch.await(5, TimeUnit.SECONDS)) + { + //System.err.println(latch.getCount()); + if (latch.getCount() == last) + Assert.fail(); + last = latch.getCount(); + } + + assertEquals(0, latch.getCount()); + } + + @Test + public void testWriteBlocked() throws Exception + { + Socket client = _scenario.newClient(_connector); + + client.setSoTimeout(10000); + + SocketChannel server = _connector.accept(); + server.configureBlocking(false); + + _manager.accept(server); + + // Write client to server + _writeCount.set(10000); + String data = "Now is the time for all good men to come to the aid of the party"; + client.getOutputStream().write(data.getBytes(StandardCharsets.UTF_8)); + BufferedInputStream in = new BufferedInputStream(client.getInputStream()); + + int byteNum = 0; + try + { + for (int i = 0; i < _writeCount.get(); i++) + { + if (i % 1000 == 0) + TimeUnit.MILLISECONDS.sleep(200); + + // Verify echo server to client + for (int j = 0; j < data.length(); j++) + { + char c = data.charAt(j); + int b = in.read(); + byteNum++; + assertTrue(b > 0); + assertEquals("test-" + i + "/" + j, c, (char) b); + } + + if (i == 0) + _lastEndPoint.setIdleTimeout(60000); + } + } + catch (SocketTimeoutException e) + { + System.err.println("SelectorManager.dump() = " + _manager.dump()); + LOG.warn("Server: " + server); + LOG.warn("Error reading byte #" + byteNum, e); + throw e; + } + + client.close(); + + for (int i = 0; i < 10; ++i) + { + if (server.isOpen()) + Thread.sleep(10); + else + break; + } + assertFalse(server.isOpen()); + } + + + // TODO make this test reliable + @Test + @Ignore + public void testRejectedExecution() throws Exception + { + _manager.stop(); + _threadPool.stop(); + + final CountDownLatch latch = new CountDownLatch(1); + + BlockingQueue q = new ArrayBlockingQueue<>(4); + _threadPool = new QueuedThreadPool(4, 4, 60000, q); + _manager = new SelectorManager(_threadPool, _scheduler, 1) + { + + @Override + protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) throws IOException + { + SocketChannelEndPoint endp = new SocketChannelEndPoint(channel, selector, selectionKey, getScheduler()); + _lastEndPoint = endp; + _lastEndPointLatch.countDown(); + return endp; + } + + @Override + public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment) throws IOException + { + return new TestConnection(endpoint, latch, getExecutor(), _blockAt, _writeCount); + } + }; + + _threadPool.start(); + _manager.start(); + + AtomicInteger timeout = new AtomicInteger(); + AtomicInteger rejections = new AtomicInteger(); + AtomicInteger echoed = new AtomicInteger(); + + CountDownLatch closed = new CountDownLatch(20); + for (int i = 0; i < 20; i++) + { + new Thread() + { + @Override + public void run() + { + try (Socket client = _scenario.newClient(_connector);) + { + client.setSoTimeout(5000); + + SocketChannel server = _connector.accept(); + server.configureBlocking(false); + + _manager.accept(server); + + // Write client to server + client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); + client.getOutputStream().flush(); + client.shutdownOutput(); + + // Verify echo server to client + for (char c : "HelloWorld".toCharArray()) + { + int b = client.getInputStream().read(); + assertTrue(b > 0); + assertEquals(c, (char) b); + } + assertEquals(-1, client.getInputStream().read()); + echoed.incrementAndGet(); + } + catch (SocketTimeoutException x) + { + x.printStackTrace(); + timeout.incrementAndGet(); + } + catch (Throwable x) + { + rejections.incrementAndGet(); + } + finally + { + closed.countDown(); + } + } + }.start(); + } + + // unblock the handling + latch.countDown(); + + // wait for all clients to complete or fail + closed.await(); + + // assert some clients must have been rejected + Assert.assertThat(rejections.get(), Matchers.greaterThan(0)); + // but not all of them + Assert.assertThat(rejections.get(), Matchers.lessThan(20)); + // none should have timed out + Assert.assertThat(timeout.get(), Matchers.equalTo(0)); + // and the rest should have worked + Assert.assertThat(echoed.get(), Matchers.equalTo(20 - rejections.get())); + + // and the selector is still working for new requests + try (Socket client = _scenario.newClient(_connector)) + { + client.setSoTimeout(5000); + + SocketChannel server = _connector.accept(); + server.configureBlocking(false); + + _manager.accept(server); + + // Write client to server + client.getOutputStream().write("HelloWorld".getBytes(StandardCharsets.UTF_8)); + client.getOutputStream().flush(); + client.shutdownOutput(); + + // Verify echo server to client + for (char c : "HelloWorld".toCharArray()) + { + int b = client.getInputStream().read(); + assertTrue(b > 0); + assertEquals(c, (char) b); + } + assertEquals(-1, client.getInputStream().read()); + } + } + + public class ScenarioSelectorManager extends SelectorManager + { + protected ScenarioSelectorManager(Executor executor, Scheduler scheduler) + { + super(executor, scheduler); + } + + protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key) throws IOException + { + SocketChannelEndPoint endp = new SocketChannelEndPoint(channel, selector, key, getScheduler()); + endp.setIdleTimeout(60000); + _lastEndPoint = endp; + _lastEndPointLatch.countDown(); + return endp; + } + + @Override + public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment) throws IOException + { + return _scenario.newConnection(channel, endpoint, getExecutor(), _blockAt, _writeCount); + } + } + + public static class NormalScenario implements Scenario + { + @Override + public Socket newClient(ServerSocketChannel connector) throws IOException + { + return new Socket(connector.socket().getInetAddress(), connector.socket().getLocalPort()); + } + + @Override + public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Executor executor, AtomicInteger blockAt, AtomicInteger writeCount) + { + return new TestConnection(endpoint, executor, blockAt, writeCount); + } + + @Override + public boolean supportsHalfCloses() + { + return true; + } + + @Override + public String toString() + { + return "normal"; + } + } + + public static class SslScenario implements Scenario + { + private final NormalScenario _normalScenario; + private final SslContextFactory __sslCtxFactory = new SslContextFactory(); + private final ByteBufferPool __byteBufferPool = new MappedByteBufferPool(); + + public SslScenario(NormalScenario normalScenario) throws Exception + { + _normalScenario = normalScenario; + File keystore = MavenTestingUtils.getTestResourceFile("keystore"); + __sslCtxFactory.setKeyStorePath(keystore.getAbsolutePath()); + __sslCtxFactory.setKeyStorePassword("storepwd"); + __sslCtxFactory.setKeyManagerPassword("keypwd"); + __sslCtxFactory.setEndpointIdentificationAlgorithm(""); + __sslCtxFactory.start(); + } + + @Override + public Socket newClient(ServerSocketChannel connector) throws IOException + { + SSLSocket socket = __sslCtxFactory.newSslSocket(); + socket.connect(connector.socket().getLocalSocketAddress()); + return socket; + } + + @Override + public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Executor executor, AtomicInteger blockAt, AtomicInteger writeCount) + { + SSLEngine engine = __sslCtxFactory.newSSLEngine(); + engine.setUseClientMode(false); + SslConnection sslConnection = new SslConnection(__byteBufferPool, executor, endpoint, engine); + sslConnection.setRenegotiationAllowed(__sslCtxFactory.isRenegotiationAllowed()); + sslConnection.setRenegotiationLimit(__sslCtxFactory.getRenegotiationLimit()); + Connection appConnection = _normalScenario.newConnection(channel, sslConnection.getDecryptedEndPoint(), executor, blockAt, writeCount); + sslConnection.getDecryptedEndPoint().setConnection(appConnection); + return sslConnection; + } + + @Override + public boolean supportsHalfCloses() + { + return false; + } + + @Override + public String toString() + { + return "ssl"; + } + } + + @SuppressWarnings("Duplicates") + public static class TestConnection extends AbstractConnection + { + private static final Logger LOG = Log.getLogger(TestConnection.class); + + volatile FutureCallback _blockingRead; + final AtomicInteger _blockAt; + final AtomicInteger _writeCount; + // volatile int _blockAt = 0; + ByteBuffer _in = BufferUtil.allocate(32 * 1024); + ByteBuffer _out = BufferUtil.allocate(32 * 1024); + long _last = -1; + final CountDownLatch _latch; + + public TestConnection(EndPoint endp, Executor executor, AtomicInteger blockAt, AtomicInteger writeCount) + { + super(endp, executor); + _latch = null; + this._blockAt = blockAt; + this._writeCount = writeCount; + } + + public TestConnection(EndPoint endp, CountDownLatch latch, Executor executor, AtomicInteger blockAt, AtomicInteger writeCount) + { + super(endp, executor); + _latch = latch; + this._blockAt = blockAt; + this._writeCount = writeCount; + } + + @Override + public void onOpen() + { + super.onOpen(); + fillInterested(); + } + + @Override + public void onFillInterestedFailed(Throwable cause) + { + Callback blocking = _blockingRead; + if (blocking != null) + { + _blockingRead = null; + blocking.failed(cause); + return; + } + super.onFillInterestedFailed(cause); + } + + @Override + public void onFillable() + { + if (_latch != null) + { + try + { + _latch.await(); + } + catch (InterruptedException e) + { + e.printStackTrace(); + } + } + + Callback blocking = _blockingRead; + if (blocking != null) + { + _blockingRead = null; + blocking.succeeded(); + return; + } + + EndPoint _endp = getEndPoint(); + try + { + _last = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); + boolean progress = true; + while (progress) + { + progress = false; + + // Fill the input buffer with everything available + BufferUtil.compact(_in); + if (BufferUtil.isFull(_in)) + throw new IllegalStateException("FULL " + BufferUtil.toDetailString(_in)); + int filled = _endp.fill(_in); + if (filled > 0) + progress = true; + + // If the tests wants to block, then block + while (_blockAt.get() > 0 && _endp.isOpen() && _in.remaining() < _blockAt.get()) + { + FutureCallback future = _blockingRead = new FutureCallback(); + fillInterested(); + future.get(); + filled = _endp.fill(_in); + progress |= filled > 0; + } + + // Copy to the out buffer + if (BufferUtil.hasContent(_in) && BufferUtil.append(_out, _in) > 0) + progress = true; + + // Blocking writes + if (BufferUtil.hasContent(_out)) + { + ByteBuffer out = _out.duplicate(); + BufferUtil.clear(_out); + for (int i = 0; i < _writeCount.get(); i++) + { + FutureCallback blockingWrite = new FutureCallback(); + _endp.write(blockingWrite, out.asReadOnlyBuffer()); + blockingWrite.get(); + } + progress = true; + } + + // are we done? + if (_endp.isInputShutdown()) + _endp.shutdownOutput(); + } + + if (_endp.isOpen()) + fillInterested(); + } + catch (ExecutionException e) + { + // Timeout does not close, so echo exception then shutdown + try + { + FutureCallback blockingWrite = new FutureCallback(); + _endp.write(blockingWrite, BufferUtil.toBuffer("EE: " + BufferUtil.toString(_in))); + blockingWrite.get(); + _endp.shutdownOutput(); + } + catch (Exception e2) + { + // e2.printStackTrace(); + } + } + catch (InterruptedException | EofException e) + { + LOG.info(e); + } + catch (Exception e) + { + LOG.warn(e); + } + } } } diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointSslTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SslEngineBehaviorTest.java similarity index 56% rename from jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointSslTest.java rename to jetty-io/src/test/java/org/eclipse/jetty/io/SslEngineBehaviorTest.java index da7139002aa..2113f0feabe 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointSslTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SslEngineBehaviorTest.java @@ -18,110 +18,46 @@ package org.eclipse.jetty.io; -import java.io.File; -import java.io.IOException; -import java.net.Socket; -import java.nio.ByteBuffer; -import java.nio.channels.SelectableChannel; -import java.nio.channels.SocketChannel; - -import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLEngineResult; -import javax.net.ssl.SSLEngineResult.HandshakeStatus; -import javax.net.ssl.SSLSocket; - -import org.eclipse.jetty.io.ssl.SslConnection; -import org.eclipse.jetty.toolchain.test.JDK; -import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.toolchain.test.annotation.Stress; -import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - import static org.hamcrest.Matchers.greaterThan; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; +import java.io.File; +import java.nio.ByteBuffer; -public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; + +import org.eclipse.jetty.toolchain.test.JDK; +import org.eclipse.jetty.toolchain.test.MavenTestingUtils; +import org.eclipse.jetty.util.BufferUtil; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.BeforeClass; +import org.junit.Test; + +public class SslEngineBehaviorTest { - private static SslContextFactory __sslCtxFactory=new SslContextFactory(); - private static ByteBufferPool __byteBufferPool = new MappedByteBufferPool(); + private static SslContextFactory sslCtxFactory; @BeforeClass - public static void initSslEngine() throws Exception + public static void startSsl() throws Exception { + sslCtxFactory = new SslContextFactory(); File keystore = MavenTestingUtils.getTestResourceFile("keystore"); - __sslCtxFactory.setKeyStorePath(keystore.getAbsolutePath()); - __sslCtxFactory.setKeyStorePassword("storepwd"); - __sslCtxFactory.setKeyManagerPassword("keypwd"); - __sslCtxFactory.setEndpointIdentificationAlgorithm(""); - __sslCtxFactory.start(); + sslCtxFactory.setKeyStorePath(keystore.getAbsolutePath()); + sslCtxFactory.setKeyStorePassword("storepwd"); + sslCtxFactory.setKeyManagerPassword("keypwd"); + sslCtxFactory.setEndpointIdentificationAlgorithm(""); + sslCtxFactory.start(); } - @Override - protected Socket newClient() throws IOException + @AfterClass + public static void stopSsl() throws Exception { - SSLSocket socket = __sslCtxFactory.newSslSocket(); - socket.connect(_connector.socket().getLocalSocketAddress()); - return socket; - } - - @Override - protected Connection newConnection(SelectableChannel channel, EndPoint endpoint) - { - SSLEngine engine = __sslCtxFactory.newSSLEngine(); - engine.setUseClientMode(false); - SslConnection sslConnection = new SslConnection(__byteBufferPool, _threadPool, endpoint, engine); - sslConnection.setRenegotiationAllowed(__sslCtxFactory.isRenegotiationAllowed()); - sslConnection.setRenegotiationLimit(__sslCtxFactory.getRenegotiationLimit()); - Connection appConnection = super.newConnection(channel,sslConnection.getDecryptedEndPoint()); - sslConnection.getDecryptedEndPoint().setConnection(appConnection); - return sslConnection; - } - - @Test - @Override - public void testEcho() throws Exception - { - super.testEcho(); - } - - @Ignore // SSL does not do half closes - @Override - public void testShutdown() throws Exception - { - } - - @Test - @Override - public void testWriteBlocked() throws Exception - { - super.testWriteBlocked(); - } - - @Override - public void testReadBlocked() throws Exception - { - super.testReadBlocked(); - } - - @Override - public void testIdle() throws Exception - { - super.testIdle(); - } - - @Test - @Override - @Stress("Requires a relatively idle (network wise) environment") - public void testStress() throws Exception - { - super.testStress(); + sslCtxFactory.stop(); } @Test @@ -129,8 +65,8 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest { Assume.assumeFalse(JDK.IS_9); - SSLEngine server = __sslCtxFactory.newSSLEngine(); - SSLEngine client = __sslCtxFactory.newSSLEngine(); + SSLEngine server = sslCtxFactory.newSSLEngine(); + SSLEngine client = sslCtxFactory.newSSLEngine(); ByteBuffer netC2S = ByteBuffer.allocate(server.getSession().getPacketBufferSize()); ByteBuffer netS2C = ByteBuffer.allocate(server.getSession().getPacketBufferSize()); @@ -143,7 +79,7 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest // start the client client.setUseClientMode(true); client.beginHandshake(); - Assert.assertEquals(HandshakeStatus.NEED_WRAP,client.getHandshakeStatus()); + Assert.assertEquals(SSLEngineResult.HandshakeStatus.NEED_WRAP,client.getHandshakeStatus()); // what if we try an unwrap? netS2C.flip(); @@ -152,7 +88,7 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest assertEquals(SSLEngineResult.Status.OK,result.getStatus()); assertEquals(0,result.bytesConsumed()); assertEquals(0,result.bytesProduced()); - assertEquals(HandshakeStatus.NEED_WRAP,result.getHandshakeStatus()); + assertEquals(SSLEngineResult.HandshakeStatus.NEED_WRAP,result.getHandshakeStatus()); netS2C.clear(); // do the needed WRAP of empty buffer @@ -161,14 +97,14 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest assertEquals(SSLEngineResult.Status.OK,result.getStatus()); assertEquals(0,result.bytesConsumed()); assertThat(result.bytesProduced(),greaterThan(0)); - assertEquals(HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); + assertEquals(SSLEngineResult.HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); netC2S.flip(); assertEquals(netC2S.remaining(),result.bytesProduced()); // start the server server.setUseClientMode(false); server.beginHandshake(); - Assert.assertEquals(HandshakeStatus.NEED_UNWRAP,server.getHandshakeStatus()); + Assert.assertEquals(SSLEngineResult.HandshakeStatus.NEED_UNWRAP,server.getHandshakeStatus()); // what if we try a needless wrap? serverOut.put(BufferUtil.toBuffer("Hello World")); @@ -178,14 +114,14 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest assertEquals(SSLEngineResult.Status.OK,result.getStatus()); assertEquals(0,result.bytesConsumed()); assertEquals(0,result.bytesProduced()); - assertEquals(HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); + assertEquals(SSLEngineResult.HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); // Do the needed unwrap, to an empty buffer result=server.unwrap(netC2S,BufferUtil.EMPTY_BUFFER); assertEquals(SSLEngineResult.Status.BUFFER_OVERFLOW,result.getStatus()); assertEquals(0,result.bytesConsumed()); assertEquals(0,result.bytesProduced()); - assertEquals(HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); + assertEquals(SSLEngineResult.HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); // Do the needed unwrap, to a full buffer serverIn.position(serverIn.limit()); @@ -193,7 +129,7 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest assertEquals(SSLEngineResult.Status.BUFFER_OVERFLOW,result.getStatus()); assertEquals(0,result.bytesConsumed()); assertEquals(0,result.bytesProduced()); - assertEquals(HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); + assertEquals(SSLEngineResult.HandshakeStatus.NEED_UNWRAP,result.getHandshakeStatus()); // Do the needed unwrap, to an empty buffer serverIn.clear(); @@ -201,10 +137,10 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest assertEquals(SSLEngineResult.Status.OK,result.getStatus()); assertThat(result.bytesConsumed(),greaterThan(0)); assertEquals(0,result.bytesProduced()); - assertEquals(HandshakeStatus.NEED_TASK,result.getHandshakeStatus()); + assertEquals(SSLEngineResult.HandshakeStatus.NEED_TASK,result.getHandshakeStatus()); server.getDelegatedTask().run(); - assertEquals(HandshakeStatus.NEED_WRAP,server.getHandshakeStatus()); + assertEquals(SSLEngineResult.HandshakeStatus.NEED_WRAP,server.getHandshakeStatus()); } } diff --git a/jetty-jaas/src/main/config/modules/jaas.mod b/jetty-jaas/src/main/config/modules/jaas.mod index 26c68fff54b..d8c78b63869 100644 --- a/jetty-jaas/src/main/config/modules/jaas.mod +++ b/jetty-jaas/src/main/config/modules/jaas.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable JAAS for deployed webapplications. diff --git a/jetty-jaspi/src/main/config/modules/jaspi.mod b/jetty-jaspi/src/main/config/modules/jaspi.mod index 0d552730346..372c00e07bd 100644 --- a/jetty-jaspi/src/main/config/modules/jaspi.mod +++ b/jetty-jaspi/src/main/config/modules/jaspi.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable JASPI authentication for deployed webapplications. diff --git a/jetty-jmx/src/main/config/modules/jmx-remote.mod b/jetty-jmx/src/main/config/modules/jmx-remote.mod index 438f3368ef9..bf6b200471c 100644 --- a/jetty-jmx/src/main/config/modules/jmx-remote.mod +++ b/jetty-jmx/src/main/config/modules/jmx-remote.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables remote RMI access to JMX diff --git a/jetty-jmx/src/main/config/modules/jmx.mod b/jetty-jmx/src/main/config/modules/jmx.mod index a59c6dd9c1b..969b5f167fb 100644 --- a/jetty-jmx/src/main/config/modules/jmx.mod +++ b/jetty-jmx/src/main/config/modules/jmx.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables JMX instrumentation for server beans and enables JMX agent. diff --git a/jetty-jndi/src/main/jndi-config/modules/jndi.mod b/jetty-jndi/src/main/jndi-config/modules/jndi.mod index 023ff9845a4..d65f31095b6 100644 --- a/jetty-jndi/src/main/jndi-config/modules/jndi.mod +++ b/jetty-jndi/src/main/jndi-config/modules/jndi.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds the Jetty JNDI implementation to the classpath. diff --git a/jetty-jndi/src/main/jndi-config/modules/mail.mod b/jetty-jndi/src/main/jndi-config/modules/mail.mod index 69e8470f9c9..99214ad5cd8 100644 --- a/jetty-jndi/src/main/jndi-config/modules/mail.mod +++ b/jetty-jndi/src/main/jndi-config/modules/mail.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds the javax.mail implementation to the classpath. diff --git a/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-webapp/src/base/modules/testmod.mod b/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-webapp/src/base/modules/testmod.mod index e1ee0758792..e451df43f4a 100644 --- a/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-webapp/src/base/modules/testmod.mod +++ b/jetty-maven-plugin/src/it/jetty-run-distro-mojo-it/jetty-simple-webapp/src/base/modules/testmod.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables test setup diff --git a/jetty-maven-plugin/src/main/resources/maven.mod b/jetty-maven-plugin/src/main/resources/maven.mod index ee54ce0ebbb..0fd52cdeb80 100644 --- a/jetty-maven-plugin/src/main/resources/maven.mod +++ b/jetty-maven-plugin/src/main/resources/maven.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables an unassembled maven webapp to run in a jetty distro diff --git a/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod b/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod index e1e71817158..0618c02950a 100644 --- a/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod +++ b/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Memcache cache for SessionData diff --git a/jetty-nosql/src/main/config/modules/session-store-mongo.mod b/jetty-nosql/src/main/config/modules/session-store-mongo.mod index a0df7bafdcb..e3ffafdd42d 100644 --- a/jetty-nosql/src/main/config/modules/session-store-mongo.mod +++ b/jetty-nosql/src/main/config/modules/session-store-mongo.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables NoSql session management with a MongoDB driver. diff --git a/jetty-nosql/src/main/config/modules/sessions/mongo/address.mod b/jetty-nosql/src/main/config/modules/sessions/mongo/address.mod index 15fcfeae6d2..333877d8cb4 100644 --- a/jetty-nosql/src/main/config/modules/sessions/mongo/address.mod +++ b/jetty-nosql/src/main/config/modules/sessions/mongo/address.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Server/port address connections for session storage diff --git a/jetty-nosql/src/main/config/modules/sessions/mongo/uri.mod b/jetty-nosql/src/main/config/modules/sessions/mongo/uri.mod index fc43772b0b3..813904e4f8f 100644 --- a/jetty-nosql/src/main/config/modules/sessions/mongo/uri.mod +++ b/jetty-nosql/src/main/config/modules/sessions/mongo/uri.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] MongoURI connections for session storage diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index 88310a81aad..88d59ec7162 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -17,6 +17,7 @@ 4.11.0 2.5.2 1.0 + true @@ -424,31 +425,17 @@ - - - maven-surefire-plugin - - true - - ${settings.localRepository} - - - - - org.apache.servicemix.tooling - depends-maven-plugin - - - generate-depends-file - - generate-depends-file - - - - - + + maven-surefire-plugin + + ${skipTests} + + ${settings.localRepository} + + + org.eclipse.m2e @@ -476,6 +463,20 @@ + + + org.apache.servicemix.tooling + depends-maven-plugin + + + generate-depends-file + + generate-depends-file + + + + + @@ -515,20 +516,23 @@ test + + false + - - maven-surefire-plugin - - false - - **/TestJettyOSGiBootHTTP2JDK9* - - - - -Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar - - + + maven-surefire-plugin + + + + **/TestJettyOSGiBootHTTP2JDK9* + + + + -Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar + + @@ -569,12 +573,15 @@ test + + false + maven-surefire-plugin - false + ${skipTests} **/TestJettyOSGiBootHTTP2 diff --git a/jetty-overlay-deployer/src/main/config/modules/overlay.mod b/jetty-overlay-deployer/src/main/config/modules/overlay.mod index 1c95193c1de..8522e997103 100644 --- a/jetty-overlay-deployer/src/main/config/modules/overlay.mod +++ b/jetty-overlay-deployer/src/main/config/modules/overlay.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable the jetty overlay deployer that allows webapplications to be dynamically composed of layers. diff --git a/jetty-plus/src/main/plus-config/modules/plus.mod b/jetty-plus/src/main/plus-config/modules/plus.mod index 7058a5969ca..1c43a34ae42 100644 --- a/jetty-plus/src/main/plus-config/modules/plus.mod +++ b/jetty-plus/src/main/plus-config/modules/plus.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables JNDI and resource injection for webapplications and other servlet 3.x features not supported in the core diff --git a/jetty-plus/src/main/plus-config/modules/transactions.mod b/jetty-plus/src/main/plus-config/modules/transactions.mod index 9b692f2f755..5433cfa5343 100644 --- a/jetty-plus/src/main/plus-config/modules/transactions.mod +++ b/jetty-plus/src/main/plus-config/modules/transactions.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Puts javax.transaction api on the classpath diff --git a/jetty-proxy/src/main/config/modules/proxy.mod b/jetty-proxy/src/main/config/modules/proxy.mod index c14ee0cba76..b1be24399cf 100644 --- a/jetty-proxy/src/main/config/modules/proxy.mod +++ b/jetty-proxy/src/main/config/modules/proxy.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable the Jetty Proxy, that allows the server to act as a non-transparent proxy for browsers. diff --git a/jetty-quickstart/src/main/config/modules/quickstart.mod b/jetty-quickstart/src/main/config/modules/quickstart.mod index cefa5f16887..102801714b6 100644 --- a/jetty-quickstart/src/main/config/modules/quickstart.mod +++ b/jetty-quickstart/src/main/config/modules/quickstart.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the Jetty Quickstart module for rapid deployment of preconfigured webapplications. diff --git a/jetty-rewrite/src/main/config/modules/rewrite-compactpath.mod b/jetty-rewrite/src/main/config/modules/rewrite-compactpath.mod index f51f05d30af..bdd63f1f4e6 100644 --- a/jetty-rewrite/src/main/config/modules/rewrite-compactpath.mod +++ b/jetty-rewrite/src/main/config/modules/rewrite-compactpath.mod @@ -1,6 +1,5 @@ -# -# Jetty Rewrite CompactPath module -# +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Add a rule to the rewrite module to compact paths so that double slashes in the path are treated as a single slash. diff --git a/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod b/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod index 2546654f000..5caea6942c8 100644 --- a/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod +++ b/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod @@ -1,6 +1,5 @@ -# -# Jetty Rewrite Customizer module -# +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables a rewrite Rules container as a request customizer on the servers default HttpConfiguration instance diff --git a/jetty-rewrite/src/main/config/modules/rewrite.mod b/jetty-rewrite/src/main/config/modules/rewrite.mod index 3d61531dba2..60c229dfae9 100644 --- a/jetty-rewrite/src/main/config/modules/rewrite.mod +++ b/jetty-rewrite/src/main/config/modules/rewrite.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the jetty-rewrite handler. Specific rewrite rules must be added to either to etc/jetty-rewrite.xml or a custom xml/module diff --git a/jetty-security/src/main/config/modules/security.mod b/jetty-security/src/main/config/modules/security.mod index 3955fcfee84..ea56fdd6b6d 100644 --- a/jetty-security/src/main/config/modules/security.mod +++ b/jetty-security/src/main/config/modules/security.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds servlet standard security handling to the classpath. diff --git a/jetty-server/src/main/config/modules/connectionlimit.mod b/jetty-server/src/main/config/modules/connectionlimit.mod index b51829bfee7..997f38905a9 100644 --- a/jetty-server/src/main/config/modules/connectionlimit.mod +++ b/jetty-server/src/main/config/modules/connectionlimit.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable a server wide connection limit diff --git a/jetty-server/src/main/config/modules/continuation.mod b/jetty-server/src/main/config/modules/continuation.mod index af03ae41ced..a2aba820c14 100644 --- a/jetty-server/src/main/config/modules/continuation.mod +++ b/jetty-server/src/main/config/modules/continuation.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables support for Continuation style asynchronous Servlets. Now deprecated in favour of Servlet 3.1 diff --git a/jetty-server/src/main/config/modules/debug.mod b/jetty-server/src/main/config/modules/debug.mod index 9462422ff3c..b0cac1f827b 100644 --- a/jetty-server/src/main/config/modules/debug.mod +++ b/jetty-server/src/main/config/modules/debug.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the DebugListener to generate additional logging regarding detailed request handling events. diff --git a/jetty-server/src/main/config/modules/debuglog.mod b/jetty-server/src/main/config/modules/debuglog.mod index 28e6d8c725d..860733475ef 100644 --- a/jetty-server/src/main/config/modules/debuglog.mod +++ b/jetty-server/src/main/config/modules/debuglog.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Deprecated Debug Log using the DebugHandle. Replaced with the debug module. diff --git a/jetty-server/src/main/config/modules/ext.mod b/jetty-server/src/main/config/modules/ext.mod index 3834181a301..103336000c6 100644 --- a/jetty-server/src/main/config/modules/ext.mod +++ b/jetty-server/src/main/config/modules/ext.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds all jar files discovered in $JETTY_HOME/lib/ext and $JETTY_BASE/lib/ext to the servers classpath. diff --git a/jetty-server/src/main/config/modules/gzip.mod b/jetty-server/src/main/config/modules/gzip.mod index b210a8c0fa8..63a8b99e9ba 100644 --- a/jetty-server/src/main/config/modules/gzip.mod +++ b/jetty-server/src/main/config/modules/gzip.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable GzipHandler for dynamic gzip compression for the entire server. diff --git a/jetty-server/src/main/config/modules/home-base-warning.mod b/jetty-server/src/main/config/modules/home-base-warning.mod index 3e599f0788f..ee342355272 100644 --- a/jetty-server/src/main/config/modules/home-base-warning.mod +++ b/jetty-server/src/main/config/modules/home-base-warning.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Generates a warning that server has been run from $JETTY_HOME rather than from a $JETTY_BASE. diff --git a/jetty-server/src/main/config/modules/http-forwarded.mod b/jetty-server/src/main/config/modules/http-forwarded.mod index b84ca7ce3b1..34e25642b2c 100644 --- a/jetty-server/src/main/config/modules/http-forwarded.mod +++ b/jetty-server/src/main/config/modules/http-forwarded.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds a forwarded request customizer to the HTTP Connector to process forwarded-for style headers from a proxy. diff --git a/jetty-server/src/main/config/modules/http.mod b/jetty-server/src/main/config/modules/http.mod index c288d6ab5d9..aca43d87d9d 100644 --- a/jetty-server/src/main/config/modules/http.mod +++ b/jetty-server/src/main/config/modules/http.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables a HTTP connector on the server. By default HTTP/1 is support, but HTTP2C can diff --git a/jetty-server/src/main/config/modules/https.mod b/jetty-server/src/main/config/modules/https.mod index ad13224e2f8..8136579de2c 100644 --- a/jetty-server/src/main/config/modules/https.mod +++ b/jetty-server/src/main/config/modules/https.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds HTTPS protocol support to the TLS(SSL) Connector diff --git a/jetty-server/src/main/config/modules/ipaccess.mod b/jetty-server/src/main/config/modules/ipaccess.mod index 0a985c917d9..d4bc71bdb1f 100644 --- a/jetty-server/src/main/config/modules/ipaccess.mod +++ b/jetty-server/src/main/config/modules/ipaccess.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable the ipaccess handler to apply a white/black list control of the remote IP of requests. diff --git a/jetty-server/src/main/config/modules/jvm.mod b/jetty-server/src/main/config/modules/jvm.mod index 30b0d966b96..e8262f99028 100644 --- a/jetty-server/src/main/config/modules/jvm.mod +++ b/jetty-server/src/main/config/modules/jvm.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] A noop module that creates an ini template useful for setting JVM arguments (eg -Xmx ) diff --git a/jetty-server/src/main/config/modules/logback-access.mod b/jetty-server/src/main/config/modules/logback-access.mod index 9d5da6e144a..ee5ec462218 100644 --- a/jetty-server/src/main/config/modules/logback-access.mod +++ b/jetty-server/src/main/config/modules/logback-access.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables logback request log. diff --git a/jetty-server/src/main/config/modules/lowresources.mod b/jetty-server/src/main/config/modules/lowresources.mod index c68db526cbe..b1e91d7f7aa 100644 --- a/jetty-server/src/main/config/modules/lowresources.mod +++ b/jetty-server/src/main/config/modules/lowresources.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables a low resource monitor on the server that can take actions if threads and/or connections diff --git a/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod b/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod index a33efe84a99..7fb3d53e694 100644 --- a/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod +++ b/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the Proxy Protocol on the TLS(SSL) Connector. http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt diff --git a/jetty-server/src/main/config/modules/proxy-protocol.mod b/jetty-server/src/main/config/modules/proxy-protocol.mod index 48820e5c145..38bcd8f96c0 100644 --- a/jetty-server/src/main/config/modules/proxy-protocol.mod +++ b/jetty-server/src/main/config/modules/proxy-protocol.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the Proxy Protocol on the HTTP Connector. http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt diff --git a/jetty-server/src/main/config/modules/requestlog.mod b/jetty-server/src/main/config/modules/requestlog.mod index ef8630eb477..e8e971be87b 100644 --- a/jetty-server/src/main/config/modules/requestlog.mod +++ b/jetty-server/src/main/config/modules/requestlog.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables a NCSA style request log. diff --git a/jetty-server/src/main/config/modules/resources.mod b/jetty-server/src/main/config/modules/resources.mod index 00a5de93ba1..aebfebeeb70 100644 --- a/jetty-server/src/main/config/modules/resources.mod +++ b/jetty-server/src/main/config/modules/resources.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds the $JETTY_HOME/resources and/or $JETTY_BASE/resources directory to the server classpath. Useful for configuration diff --git a/jetty-server/src/main/config/modules/server.mod b/jetty-server/src/main/config/modules/server.mod index cee335be34a..441a463bea2 100644 --- a/jetty-server/src/main/config/modules/server.mod +++ b/jetty-server/src/main/config/modules/server.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the core Jetty server on the classpath. diff --git a/jetty-server/src/main/config/modules/session-cache-hash.mod b/jetty-server/src/main/config/modules/session-cache-hash.mod index 2236405fc55..32ab705c7a2 100644 --- a/jetty-server/src/main/config/modules/session-cache-hash.mod +++ b/jetty-server/src/main/config/modules/session-cache-hash.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable first level session cache in ConcurrentHashMap. If not enabled, sessions will use a HashSessionCache by default, so enabling diff --git a/jetty-server/src/main/config/modules/session-cache-null.mod b/jetty-server/src/main/config/modules/session-cache-null.mod index 1574ffdd73a..abdf2d7e076 100644 --- a/jetty-server/src/main/config/modules/session-cache-null.mod +++ b/jetty-server/src/main/config/modules/session-cache-null.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] A trivial SessionCache that does not actually cache sessions. diff --git a/jetty-server/src/main/config/modules/session-store-cache.mod b/jetty-server/src/main/config/modules/session-store-cache.mod index db717d4276b..72c012aad63 100644 --- a/jetty-server/src/main/config/modules/session-store-cache.mod +++ b/jetty-server/src/main/config/modules/session-store-cache.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables caching of SessionData in front of a SessionDataStore. diff --git a/jetty-server/src/main/config/modules/session-store-file.mod b/jetty-server/src/main/config/modules/session-store-file.mod index 93370659fc9..f704d619352 100644 --- a/jetty-server/src/main/config/modules/session-store-file.mod +++ b/jetty-server/src/main/config/modules/session-store-file.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables session persistent storage in files. diff --git a/jetty-server/src/main/config/modules/session-store-jdbc.mod b/jetty-server/src/main/config/modules/session-store-jdbc.mod index e154f17bb91..eab2799cf18 100644 --- a/jetty-server/src/main/config/modules/session-store-jdbc.mod +++ b/jetty-server/src/main/config/modules/session-store-jdbc.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables JDBC peristent/distributed session storage. diff --git a/jetty-server/src/main/config/modules/sessions.mod b/jetty-server/src/main/config/modules/sessions.mod index ee3d734df69..c1bcad083d0 100644 --- a/jetty-server/src/main/config/modules/sessions.mod +++ b/jetty-server/src/main/config/modules/sessions.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] The session management. By enabling this module, it allows session management to be configured via the ini templates diff --git a/jetty-server/src/main/config/modules/sessions/jdbc/datasource.mod b/jetty-server/src/main/config/modules/sessions/jdbc/datasource.mod index c4d003b0469..be665ff9f3b 100644 --- a/jetty-server/src/main/config/modules/sessions/jdbc/datasource.mod +++ b/jetty-server/src/main/config/modules/sessions/jdbc/datasource.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] JDBC Datasource connections for session storage diff --git a/jetty-server/src/main/config/modules/sessions/jdbc/driver.mod b/jetty-server/src/main/config/modules/sessions/jdbc/driver.mod index efd084a668b..eb7391a807d 100644 --- a/jetty-server/src/main/config/modules/sessions/jdbc/driver.mod +++ b/jetty-server/src/main/config/modules/sessions/jdbc/driver.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] JDBC Driver connections for session storage diff --git a/jetty-server/src/main/config/modules/ssl.mod b/jetty-server/src/main/config/modules/ssl.mod index b9e530f3d25..0584460531c 100644 --- a/jetty-server/src/main/config/modules/ssl.mod +++ b/jetty-server/src/main/config/modules/ssl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables a TLS(SSL) Connector on the server. This may be used for HTTPS and/or HTTP2 by enabling diff --git a/jetty-server/src/main/config/modules/stats.mod b/jetty-server/src/main/config/modules/stats.mod index 4b80d520697..8f213c2d651 100644 --- a/jetty-server/src/main/config/modules/stats.mod +++ b/jetty-server/src/main/config/modules/stats.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable detailed statistics collection for the server, available via JMX. diff --git a/jetty-server/src/main/config/modules/threadpool.mod b/jetty-server/src/main/config/modules/threadpool.mod index 591ddebb94f..c0201b3c7e0 100644 --- a/jetty-server/src/main/config/modules/threadpool.mod +++ b/jetty-server/src/main/config/modules/threadpool.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the Server thread pool. diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index df4dcebe050..9ab2ba49179 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -566,7 +566,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor if (LOG.isDebugEnabled()) LOG.debug(_request.getRequestURI(), failure); else - LOG.warn("{} {}",_request.getRequestURI(), failure); + LOG.warn(_request.getRequestURI(), failure); } else { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 9577392af53..fc10d546594 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -243,6 +243,8 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http int filled = fillRequestBuffer(); if (filled>0) bytesIn.add(filled); + else if (filled==-1 && getEndPoint().isOutputShutdown()) + close(); // Parse the request buffer. boolean handle = parseRequestBuffer(); @@ -252,13 +254,6 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http if (getEndPoint().getConnection()!=this) break; - // Handle closed parser. - if (_parser.isClose() || _parser.isClosed()) - { - close(); - break; - } - // Handle channel event if (handle) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java index 989dbdf004c..a7f2c15f9d6 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java @@ -371,7 +371,7 @@ public class Server extends HandlerWrapper implements Attributes String gitHash = Jetty.GIT_HASH; String timestamp = Jetty.BUILD_TIMESTAMP; - LOG.info("jetty-{}; built: {}; git: {}; jvm {}", getVersion(), timestamp, gitHash, JavaVersion.VERSION); + LOG.info("jetty-{}; built: {}; git: {}; jvm {}", getVersion(), timestamp, gitHash, System.getProperty("java.runtime.version",System.getProperty("java.version"))); if (!Jetty.STABLE) { LOG.warn("THIS IS NOT A STABLE RELEASE! DO NOT USE IN PRODUCTION!"); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java index bf073a6188c..417571ad94a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java @@ -49,13 +49,102 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; /** - * A Handler that can dynamically GZIP compress responses. Unlike - * previous and 3rd party GzipFilters, this mechanism works with asynchronously - * generated responses and does not need to wrap the response or it's output - * stream. Instead it uses the efficient {@link org.eclipse.jetty.server.HttpOutput.Interceptor} mechanism. + * A Handler that can dynamically GZIP uncompress requests, and compress responses. *

- * The handler can be applied to the entire server (a gzip.mod is included in - * the distribution) or it may be applied to individual contexts. + * The GzipHandler can be applied to the entire server (a {@code gzip.mod} is included in + * the {@code jetty-home}) or it may be applied to individual contexts. + *

+ *

+ * Both Request uncompress and Response compress are gated by a configurable + * {@link DispatcherType} check on the GzipHandler. + * (This is similar in behavior to a {@link javax.servlet.Filter} configuration + * you would find in a Servlet Descriptor file ({@code WEB-INF/web.xml}) + *
(Default: {@link DispatcherType#REQUEST}). + *

+ *

+ * Requests with a {@code Content-Encoding} header with the value {@code gzip} will + * be uncompressed by a {@link GzipHttpInputInterceptor} for any API that uses + * {@link HttpServletRequest#getInputStream()} or {@link HttpServletRequest#getReader()}. + *

+ *

+ * Response compression has a number of checks before GzipHandler will perform compression. + *

+ *
    + *
  1. + * Does the request contain a {@code Accept-Encoding} header that specifies + * {@code gzip} value? + *
  2. + *
  3. + * Is the {@link HttpServletRequest#getMethod()} allowed by the configured HTTP Method Filter. + *
    (Default: {@code GET}) + *
  4. + *
  5. + * Is the incoming Path allowed by the configured Path Specs filters? + *
    (Default: all paths are allowed) + *
  6. + *
  7. + * Is the Request User-Agent allowed by the configured User-Agent filters? + *
    (Default: MSIE 6 is excluded) + *
  8. + *
  9. + * Is the Response {@code Content-Length} header present, and does its + * value meet the minimum gzip size requirements? + *
    (Default: 16 bytes. see {@link GzipHandler#DEFAULT_MIN_GZIP_SIZE}) + *
  10. + *
  11. + * Is the Request {@code Accept} header present and does it contain the + * required {@code gzip} value? + *
  12. + *
+ *

+ * When you encounter a configurable filter in the GzipHandler (method, paths, user-agent, + * mime-types, etc) that has both Included and Excluded values, note that the Included + * values always win over the Excluded values. + *

+ *

+ * Important note about Default Values: + * It is important to note that the GzipHandler will automatically configure itself from the + * MimeType present on the Server, System, and Contexts and the ultimate set of default values + * for the various filters (paths, methods, mime-types, etc) can be influenced by the + * available mime types to work with. + *

+ *

+ * ETag (or Entity Tag) information: any Request headers for {@code If-None-Match} or + * {@code If-Match} will be evaluated by the GzipHandler to determine if it was involved + * in compression of the response earlier. This is usually present as a {@code --gzip} suffix + * on the ETag that the Client User-Agent is tracking and handed to the Jetty server. + * The special {@code --gzip} suffix on the ETag is how GzipHandler knows that the content + * passed through itself, and this suffix will be stripped from the Request header values + * before the request is sent onwards to the specific webapp / servlet endpoint for + * handling. + * If a ETag is present in the Response headers, and GzipHandler is compressing the + * contents, it will add the {@code --gzip} suffix before the Response headers are committed + * and sent to the User Agent. + *

+ *

+ * This implementation relies on an Jetty internal {@link org.eclipse.jetty.server.HttpOutput.Interceptor} + * mechanism to allow for effective and efficient compression of the response on all Output API usages: + *

+ *
    + *
  • + * {@link javax.servlet.ServletOutputStream} - Obtained from {@link HttpServletResponse#getOutputStream()} + * using the traditional Blocking I/O techniques + *
  • + *
  • + * {@link javax.servlet.WriteListener} - Provided to + * {@link javax.servlet.ServletOutputStream#setWriteListener(javax.servlet.WriteListener)} + * using the new (since Servlet 3.1) Async I/O techniques + *
  • + *
  • + * {@link java.io.PrintWriter} - Obtained from {@link HttpServletResponse#getWriter()} + * using Blocking I/O techniques + *
  • + *
+ *

+ * Historically the compression of responses were accomplished via + * Servlet Filters (eg: {@code GzipFilter}) and usage of {@link javax.servlet.http.HttpServletResponseWrapper}. + * Since the introduction of Async I/O in Servlet 3.1, this older form of Gzip support + * in web applications has been problematic and bug ridden. *

*/ public class GzipHandler extends HandlerWrapper implements GzipFactory @@ -80,11 +169,7 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory private HttpField _vary; /** - * Instantiates a new gzip handler. - * The excluded Mime Types are initialized to common known - * images, audio, video and other already compressed types. - * The included methods is initialized to GET. - * The excluded agent patterns are set to exclude MSIE 6.0 + * Instantiates a new GzipHandler. */ public GzipHandler() { @@ -113,7 +198,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Add excluded to the User-Agent filtering. + * * @param patterns Regular expressions matching user agents to exclude + * @see #addIncludedAgentPatterns(String...) */ public void addExcludedAgentPatterns(String... patterns) { @@ -121,7 +209,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Add excluded to the HTTP methods filtering. + * * @param methods The methods to exclude in compression + * @see #addIncludedMethods(String...) */ public void addExcludedMethods(String... methods) { @@ -129,27 +220,47 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory _methods.exclude(m); } + /** + * Get the Set of {@link DispatcherType} that this Filter will operate on. + * + * @return the set of {@link DispatcherType} this filter will operate on + */ public EnumSet getDispatcherTypes() { return _dispatchers; } + /** + * Set of supported {@link DispatcherType} that this filter will operate on. + * + * @param dispatchers the set of {@link DispatcherType} that this filter will operate on + */ public void setDispatcherTypes(EnumSet dispatchers) { _dispatchers = dispatchers; } + /** + * Set the list of supported {@link DispatcherType} that this filter will operate on. + * + * @param dispatchers the list of {@link DispatcherType} that this filter will operate on + */ public void setDispatcherTypes(DispatcherType... dispatchers) { _dispatchers = EnumSet.copyOf(Arrays.asList(dispatchers)); } /** - * Adds mime types to the excluded list. + * Adds excluded MIME types for response filtering. + * + *

+ * Deprecation Warning: + * For backward compatibility the MIME types parameters may be comma separated strings, + * but this will not be supported in future versions of Jetty. + *

* * @param types The mime types to exclude (without charset or other parameters). - * For backward compatibility the mimetypes may be comma separated strings, but this - * will not be supported in future versions. + * @see #addIncludedMimeTypes(String...) */ public void addExcludedMimeTypes(String... types) { @@ -158,7 +269,8 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * Add paths to excluded paths list. + * Adds excluded Path Specs for request filtering. + * *

* There are 2 syntaxes supported, Servlet url-pattern based, and * Regex based. This means that the initial characters on the path spec @@ -181,6 +293,7 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory * otherwise they are absolute.
* For backward compatibility the pathspecs may be comma separated strings, but this * will not be supported in future versions. + * @see #addIncludedPaths(String...) */ public void addExcludedPaths(String... pathspecs) { @@ -189,7 +302,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Adds included User-Agents for filtering. + * * @param patterns Regular expressions matching user agents to include + * @see #addExcludedAgentPatterns(String...) */ public void addIncludedAgentPatterns(String... patterns) { @@ -197,7 +313,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * @param methods The methods to include in compression + * Adds included HTTP Methods (eg: POST, PATCH, DELETE) for filtering. + * + * @param methods The HTTP methods to include in compression. + * @see #addExcludedMethods(String...) */ public void addIncludedMethods(String... methods) { @@ -206,7 +325,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Is the {@link Deflater} running {@link Deflater#SYNC_FLUSH} or not. + * * @return True if {@link Deflater#SYNC_FLUSH} is used, else {@link Deflater#NO_FLUSH} + * @see #setSyncFlush(boolean) */ public boolean isSyncFlush() { @@ -214,10 +336,12 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - *

Set the {@link Deflater} flush mode to use. {@link Deflater#SYNC_FLUSH} + * Set the {@link Deflater} flush mode to use. {@link Deflater#SYNC_FLUSH} * should be used if the application wishes to stream the data, but this may * hurt compression performance. + * * @param syncFlush True if {@link Deflater#SYNC_FLUSH} is used, else {@link Deflater#NO_FLUSH} + * @see #isSyncFlush() */ public void setSyncFlush(boolean syncFlush) { @@ -225,11 +349,12 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * Add included mime types. Inclusion takes precedence over - * exclusion. + * Add included MIME types for response filtering + * * @param types The mime types to include (without charset or other parameters) * For backward compatibility the mimetypes may be comma separated strings, but this * will not be supported in future versions. + * @see #addExcludedMimeTypes(String...) */ public void addIncludedMimeTypes(String... types) { @@ -238,7 +363,8 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * Adds paths specs to the included list. + * Add included Path Specs for filtering. + * *

* There are 2 syntaxes supported, Servlet url-pattern based, and * Regex based. This means that the initial characters on the path spec @@ -323,55 +449,109 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory return df; } - + + /** + * Get the current filter list of excluded User-Agent patterns + * + * @return the filter list of excluded User-Agent patterns + * @see #getIncludedAgentPatterns() + */ public String[] getExcludedAgentPatterns() { Set excluded=_agentPatterns.getExcluded(); return excluded.toArray(new String[excluded.size()]); } + /** + * Get the current filter list of excluded HTTP methods + * + * @return the filter list of excluded HTTP methods + * @see #getIncludedMethods() + */ public String[] getExcludedMethods() { Set excluded=_methods.getExcluded(); return excluded.toArray(new String[excluded.size()]); } + /** + * Get the current filter list of excluded MIME types + * + * @return the filter list of excluded MIME types + * @see #getIncludedMimeTypes() + */ public String[] getExcludedMimeTypes() { Set excluded=_mimeTypes.getExcluded(); return excluded.toArray(new String[excluded.size()]); } + /** + * Get the current filter list of excluded Path Specs + * + * @return the filter list of excluded Path Specs + * @see #getIncludedPaths() + */ public String[] getExcludedPaths() { Set excluded=_paths.getExcluded(); return excluded.toArray(new String[excluded.size()]); } + /** + * Get the current filter list of included User-Agent patterns + * + * @return the filter list of included User-Agent patterns + * @see #getExcludedAgentPatterns() + */ public String[] getIncludedAgentPatterns() { Set includes=_agentPatterns.getIncluded(); return includes.toArray(new String[includes.size()]); } - + + /** + * Get the current filter list of included HTTP Methods + * + * @return the filter list of included HTTP methods + * @see #getExcludedMethods() + */ public String[] getIncludedMethods() { Set includes=_methods.getIncluded(); return includes.toArray(new String[includes.size()]); } + /** + * Get the current filter list of included MIME types + * + * @return the filter list of included MIME types + * @see #getExcludedMimeTypes() + */ public String[] getIncludedMimeTypes() { Set includes=_mimeTypes.getIncluded(); return includes.toArray(new String[includes.size()]); } + /** + * Get the current filter list of included Path Specs + * + * @return the filter list of included Path Specs + * @see #getExcludedPaths() + */ public String[] getIncludedPaths() { Set includes=_paths.getIncluded(); return includes.toArray(new String[includes.size()]); } + /** + * Get the current filter list of included HTTP methods + * + * @return the filter list of included HTTP methods + * @deprecated use {@link #getIncludedMethods()} instead. (Will be removed in Jetty 10) + */ @Deprecated public String[] getMethods() { @@ -379,7 +559,11 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * @return minimum response size that triggers compression + * Get the minimum size, in bytes, that a response {@code Content-Length} must be + * before compression will trigger. + * + * @return minimum response size (in bytes) that triggers compression + * @see #setMinGzipSize(int) */ public int getMinGzipSize() { @@ -392,7 +576,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * @return size in bytes of the buffer to inflate compressed request, or 0 for no inflation. + * Get the size (in bytes) of the {@link java.util.zip.Inflater} buffer used to inflate + * compressed requests. + * + * @return size in bytes of the buffer, or 0 for no inflation. */ public int getInflateBufferSize() { @@ -400,7 +587,9 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * @param size size in bytes of the buffer to inflate compressed request, or 0 for no inflation. + * Set the size (in bytes) of the {@link java.util.zip.Inflater} buffer used to inflate comrpessed requests. + * + * @param size size in bytes of the buffer, or 0 for no inflation. */ public void setInflateBufferSize(int size) { @@ -535,6 +724,8 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Test if the provided User-Agent is allowed based on the User-Agent filters. + * * @param ua the user agent * @return whether compressing is allowed for the given user agent */ @@ -546,6 +737,12 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory return _agentPatterns.test(ua); } + /** + * Test if the provided MIME type is allowed based on the MIME type filters. + * + * @param mimetype the MIME type to test + * @return true if allowed, false otherwise + */ @Override public boolean isMimeTypeGzipable(String mimetype) { @@ -553,6 +750,8 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Test if the provided Request URI is allowed based on the Path Specs filters. + * * @param requestURI the request uri * @return whether compressing is allowed for the given the path */ @@ -577,6 +776,8 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Set the Check if {@code *.gz} file for the incoming file exists. + * * @param checkGzExists whether to check if a static gz file exists for * the resource that the DefaultServlet may serve as precompressed. */ @@ -586,7 +787,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Set the Compression level that {@link Deflater} uses. + * * @param compressionLevel The compression level to use to initialize {@link Deflater#setLevel(int)} + * @see Deflater#setLevel(int) */ public void setCompressionLevel(int compressionLevel) { @@ -594,7 +798,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * @param patterns Regular expressions matching user agents to exclude + * Set the excluded filter list of User-Agent patterns (replacing any previously set) + * + * @param patterns Regular expressions list matching user agents to exclude + * @see #setIncludedAgentPatterns(String...) */ public void setExcludedAgentPatterns(String... patterns) { @@ -603,7 +810,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Set the excluded filter list of HTTP methods (replacing any previously set) + * * @param methods the HTTP methods to exclude + * @see #setIncludedMethods(String...) */ public void setExcludedMethods(String... methods) { @@ -612,7 +822,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Set the excluded filter list of MIME types (replacing any previously set) + * * @param types The mime types to exclude (without charset or other parameters) + * @see #setIncludedMimeTypes(String...) */ public void setExcludedMimeTypes(String... types) { @@ -621,9 +834,12 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * @param pathspecs Path specs (as per servlet spec) to exclude. If a + * Set the excluded filter list of Path specs (replacing any previously set) + * + * @param pathspecs Path specs (as per servlet spec) to exclude. If a * ServletContext is available, the paths are relative to the context path, * otherwise they are absolute. + * @see #setIncludedPaths(String...) */ public void setExcludedPaths(String... pathspecs) { @@ -632,7 +848,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Set the included filter list of User-Agent patterns (replacing any previously set) + * * @param patterns Regular expressions matching user agents to include + * @see #setExcludedAgentPatterns(String...) */ public void setIncludedAgentPatterns(String... patterns) { @@ -641,7 +860,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** + * Set the included filter list of HTTP methods (replacing any previously set) + * * @param methods The methods to include in compression + * @see #setExcludedMethods(String...) */ public void setIncludedMethods(String... methods) { @@ -650,9 +872,10 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * Sets included mime types. Inclusion takes precedence over exclusion. + * Set the included filter list of MIME types (replacing any previously set) * * @param types The mime types to include (without charset or other parameters) + * @see #setExcludedMimeTypes(String...) */ public void setIncludedMimeTypes(String... types) { @@ -661,11 +884,12 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory } /** - * Set the path specs to include. Inclusion takes precedence over exclusion. + * Set the included filter list of Path specs (replacing any previously set) * * @param pathspecs Path specs (as per servlet spec) to include. If a * ServletContext is available, the paths are relative to the context path, * otherwise they are absolute + * @see #setExcludedPaths(String...) */ public void setIncludedPaths(String... pathspecs) { @@ -683,21 +907,45 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory _minGzipSize = minGzipSize; } + /** + * Set the included filter list of HTTP Methods (replacing any previously set) + * + * @param csvMethods the list of methods, CSV format + * @see #setExcludedMethodList(String) + */ public void setIncludedMethodList(String csvMethods) { setIncludedMethods(StringUtil.csvSplit(csvMethods)); } + /** + * Get the included filter list of HTTP methods in CSV format + * + * @return the included filter list of HTTP methods in CSV format + * @see #getExcludedMethodList() + */ public String getIncludedMethodList() { return String.join(",", getIncludedMethods()); } + /** + * Set the excluded filter list of HTTP Methods (replacing any previously set) + * + * @param csvMethods the list of methods, CSV format + * @see #setIncludedMethodList(String) + */ public void setExcludedMethodList(String csvMethods) { setExcludedMethods(StringUtil.csvSplit(csvMethods)); } + /** + * Get the excluded filter list of HTTP methods in CSV format + * + * @return the excluded filter list of HTTP methods in CSV format + * @see #getIncludedMethodList() + */ public String getExcludedMethodList() { return String.join(",", getExcludedMethods()); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java index 97bf92123de..f71c3a24496 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; +import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -42,9 +43,11 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.toolchain.test.AdvancedRunner; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.annotation.Slow; +import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -224,11 +227,9 @@ public class ConnectionOpenCloseTest extends AbstractHttpTest "\r\n").getBytes(StandardCharsets.UTF_8)); output.flush(); - InputStream inputStream = socket.getInputStream(); - HttpTester.Response response = HttpTester.parseResponse(inputStream); - Assert.assertEquals(200, response.getStatus()); - - Assert.assertEquals(-1, inputStream.read()); + // Read to EOF + String response = BufferUtil.toString(ByteBuffer.wrap(IO.readBytes(socket.getInputStream()))); + assertThat(response,Matchers.containsString("200 OK")); socket.close(); Assert.assertTrue(openLatch.await(5, TimeUnit.SECONDS)); diff --git a/jetty-servlet/src/main/config/modules/servlet.mod b/jetty-servlet/src/main/config/modules/servlet.mod index f21e18a87e7..d9a26916f94 100644 --- a/jetty-servlet/src/main/config/modules/servlet.mod +++ b/jetty-servlet/src/main/config/modules/servlet.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables standard Servlet handling. diff --git a/jetty-servlets/src/main/config/modules/servlets.mod b/jetty-servlets/src/main/config/modules/servlets.mod index 5e1c84fc272..07cd5fd046d 100644 --- a/jetty-servlets/src/main/config/modules/servlets.mod +++ b/jetty-servlets/src/main/config/modules/servlets.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Puts a collection of jetty utility servlets and filters on the server classpath (CGI, CrossOriginFilter, DosFilter, diff --git a/jetty-spdy/pom.xml b/jetty-spdy/pom.xml deleted file mode 100644 index 9ec565c9d74..00000000000 --- a/jetty-spdy/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - org.eclipse.jetty - jetty-project - 9.2.23-SNAPSHOT - - - 4.0.0 - org.eclipse.jetty.spdy - spdy-parent - pom - Jetty :: SPDY :: Parent - http://www.eclipse.org/jetty - - - spdy-core - spdy-client - spdy-server - spdy-http-common - spdy-http-server - spdy-http-client-transport - spdy-example-webapp - spdy-alpn-tests - - - - - npn - - 1.7 - - - - - - - - - - - maven-pmd-plugin - - true - - - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - org.eclipse.jetty.spdy.*;version="9.1" - org.eclipse.jetty.*;version="[9.0,10.0)",* - <_nouses>true - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - - - - - org.eclipse.jetty.toolchain - jetty-test-helper - test - - - - diff --git a/jetty-spdy/spdy-alpn-tests/pom.xml b/jetty-spdy/spdy-alpn-tests/pom.xml deleted file mode 100644 index d0931a162c1..00000000000 --- a/jetty-spdy/spdy-alpn-tests/pom.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - - 4.0.0 - spdy-alpn-tests - Jetty :: SPDY :: ALPN Tests - - - - - maven-dependency-plugin - - - copy - generate-resources - - copy - - - - - org.mortbay.jetty.alpn - alpn-boot - ${alpn.version} - jar - false - ${project.build.directory}/alpn - - - - - - - - maven-surefire-plugin - - -Xbootclasspath/p:${project.build.directory}/alpn/alpn-boot-${alpn.version}.jar - - - - - - - - org.eclipse.jetty.alpn - alpn-api - ${alpn.api.version} - provided - - - org.eclipse.jetty - jetty-alpn-server - ${project.version} - provided - - - org.eclipse.jetty - jetty-server - ${project.version} - test - - - org.eclipse.jetty.spdy - spdy-server - ${project.version} - test - - - org.eclipse.jetty.spdy - spdy-http-server - ${project.version} - test - - - org.eclipse.jetty.spdy - spdy-http-server - ${project.version} - tests - test - - - junit - junit - test - - - - diff --git a/jetty-spdy/spdy-client/pom.xml b/jetty-spdy/spdy-client/pom.xml deleted file mode 100644 index 6f0bb90e92b..00000000000 --- a/jetty-spdy/spdy-client/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - - 4.0.0 - spdy-client - Jetty :: SPDY :: Client Binding - - - ${project.groupId}.client - - - http://www.eclipse.org/jetty - - - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - org.eclipse.jetty.spdy.client;version="9.1" - !org.eclipse.jetty.npn,!org.eclipse.jetty.alpn,org.eclipse.jetty.*;version="[9.0,10.0)",* - - - - - - - - - - - org.eclipse.jetty.spdy - spdy-core - ${project.version} - - - org.eclipse.jetty - jetty-alpn-client - ${project.version} - - - org.eclipse.jetty.alpn - alpn-api - ${alpn.api.version} - provided - - - org.eclipse.jetty.npn - npn-api - ${npn.api.version} - provided - - - - diff --git a/jetty-spdy/spdy-core/pom.xml b/jetty-spdy/spdy-core/pom.xml deleted file mode 100644 index b35715e3259..00000000000 --- a/jetty-spdy/spdy-core/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - - 4.0.0 - spdy-core - Jetty :: SPDY :: Core - - - ${project.groupId}.core - - - - - org.eclipse.jetty - jetty-util - ${project.version} - - - org.eclipse.jetty - jetty-io - ${project.version} - - - org.mockito - mockito-core - test - - - - diff --git a/jetty-spdy/spdy-example-webapp/pom.xml b/jetty-spdy/spdy-example-webapp/pom.xml deleted file mode 100644 index 2f806788368..00000000000 --- a/jetty-spdy/spdy-example-webapp/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - 4.0.0 - spdy-example-webapp - war - Jetty :: SPDY :: HTTP Web Application - - - - - org.eclipse.jetty - jetty-maven-plugin - ${project.version} - - 8888 - quit - - -Xbootclasspath/p:${settings.localRepository}/org/mortbay/jetty/npn/npn-boot/${npn.version}/npn-boot-${npn.version}.jar - - ${basedir}/src/main/config/example-jetty-spdy.xml - / - - run - run-war - deploy - start - stop - - - - - org.eclipse.jetty.spdy - spdy-http-server - ${project.version} - - - - - - - - - proxy - - - - org.eclipse.jetty - jetty-maven-plugin - ${project.version} - - 8888 - quit - - -Xbootclasspath/p:${settings.localRepository}/org/mortbay/jetty/npn/npn-boot/${npn.version}/npn-boot-${npn.version}.jar - - ${basedir}/src/main/config/example-jetty-spdy-proxy.xml - / - - run - run-war - deploy - start - stop - - - - - org.eclipse.jetty.spdy - spdy-http-server - ${project.version} - - - - - - - - - diff --git a/jetty-spdy/spdy-http-client-transport/pom.xml b/jetty-spdy/spdy-http-client-transport/pom.xml deleted file mode 100644 index 0c6ad340246..00000000000 --- a/jetty-spdy/spdy-http-client-transport/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - - 4.0.0 - spdy-http-client-transport - Jetty :: SPDY :: HTTP Client Transport - - - ${project.groupId}.client.http - - - - - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - org.eclipse.jetty.spdy.client.http;version="9.1" - !org.eclipse.jetty.npn,org.eclipse.jetty.*;version="[9.0,10.0)",* - - - - - - - - - - - org.eclipse.jetty - jetty-client - ${project.version} - - - org.eclipse.jetty.spdy - spdy-client - ${project.version} - - - org.eclipse.jetty.spdy - spdy-http-common - ${project.version} - - - - org.eclipse.jetty - jetty-server - ${project.version} - test - - - org.eclipse.jetty.spdy - spdy-http-server - ${project.version} - test - - - - diff --git a/jetty-spdy/spdy-http-common/pom.xml b/jetty-spdy/spdy-http-common/pom.xml deleted file mode 100644 index c0a97d9d21f..00000000000 --- a/jetty-spdy/spdy-http-common/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - - 4.0.0 - spdy-http-common - Jetty :: SPDY :: HTTP Common - - - ${project.groupId}.http.common - - - - - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - org.eclipse.jetty.spdy.http;version="9.1" - !org.eclipse.jetty.npn,org.eclipse.jetty.*;version="[9.0,10.0)",* - - - - - - - - - - - org.eclipse.jetty.spdy - spdy-core - ${project.version} - - - - diff --git a/jetty-spdy/spdy-http-server/pom.xml b/jetty-spdy/spdy-http-server/pom.xml deleted file mode 100644 index 4757f3633c1..00000000000 --- a/jetty-spdy/spdy-http-server/pom.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - 4.0.0 - spdy-http-server - Jetty :: SPDY :: HTTP Server - - - ${project.groupId}.http.server - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - package - - single - - - - config - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - artifact-jars - - jar - test-jar - - - - - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - org.eclipse.jetty.spdy.server.http;version="9.1", - org.eclipse.jetty.spdy.server.proxy;version="9.1" - - !org.eclipse.jetty.npn,org.eclipse.jetty.*;version="[9.0,10.0)",* - - <_nouses>true - - - - - - - - - - - org.eclipse.jetty.spdy - spdy-http-common - ${project.version} - - - org.eclipse.jetty.spdy - spdy-server - ${project.version} - - - org.eclipse.jetty - jetty-client - ${project.version} - - - org.eclipse.jetty - jetty-servlet - ${project.version} - test - - - org.eclipse.jetty - jetty-servlets - ${project.version} - test - - - org.eclipse.jetty.npn - npn-api - ${npn.api.version} - test - - - org.eclipse.jetty - jetty-continuation - ${project.version} - test - - - org.mockito - mockito-core - test - - - - diff --git a/jetty-spdy/spdy-server/pom.xml b/jetty-spdy/spdy-server/pom.xml deleted file mode 100644 index 71440708754..00000000000 --- a/jetty-spdy/spdy-server/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - org.eclipse.jetty.spdy - spdy-parent - 9.2.23-SNAPSHOT - - - 4.0.0 - spdy-server - Jetty :: SPDY :: Server Binding - - - ${project.groupId}.server - - - http://www.eclipse.org/jetty - - - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - org.eclipse.jetty.spdy.server;version="9.1" - org.eclipse.jetty.alpn;resolution:=optional,org.eclipse.jetty.alpn.server;resolution:=optional, org.eclipse.jetty.npn;resolution:=optional,org.eclipse.jetty.*;version="[9.0,10.0)",* - <_nouses>true - - - - - - - - - - - org.eclipse.jetty.spdy - spdy-core - ${project.version} - - - org.eclipse.jetty.spdy - spdy-client - ${project.version} - - - org.eclipse.jetty - jetty-server - ${project.version} - - - org.eclipse.jetty.npn - npn-api - ${npn.api.version} - provided - - - org.eclipse.jetty.alpn - alpn-api - ${alpn.api.version} - provided - - - - diff --git a/jetty-spring/src/main/config/modules/spring.mod b/jetty-spring/src/main/config/modules/spring.mod index cd52a5dd70e..0f7762de4b4 100644 --- a/jetty-spring/src/main/config/modules/spring.mod +++ b/jetty-spring/src/main/config/modules/spring.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable spring configuration processing so all jetty style xml files can optionally be written as spring beans diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java index 235b0358626..bf389e2f71a 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java @@ -1265,12 +1265,11 @@ public class StartArgs try { JavaVersion ver = JavaVersion.parse(value); - properties.setProperty("java.version",ver.getVersion(),source); properties.setProperty("java.version.platform",Integer.toString(ver.getPlatform()),source); - properties.setProperty("java.version.major",Integer.toString(ver.getMajor()),source); - properties.setProperty("java.version.minor",Integer.toString(ver.getMinor()),source); - properties.setProperty("java.version.micro",Integer.toString(ver.getMicro()),source); - properties.setProperty("java.version.update",Integer.toString(ver.getUpdate()),source); + // @deprecated - below will be removed in Jetty 10.x + properties.setProperty("java.version.major", Integer.toString(ver.getMajor()), "Deprecated"); + properties.setProperty("java.version.minor", Integer.toString(ver.getMinor()), "Deprecated"); + properties.setProperty("java.version.micro", Integer.toString(ver.getMicro()), "Deprecated"); } catch (Throwable x) { diff --git a/jetty-start/src/test/resources/dist-home/modules/main.mod b/jetty-start/src/test/resources/dist-home/modules/main.mod index 853030567d4..730db51631c 100644 --- a/jetty-start/src/test/resources/dist-home/modules/main.mod +++ b/jetty-start/src/test/resources/dist-home/modules/main.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Example of a module diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_144.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_144.mod deleted file mode 100644 index fdd3868701d..00000000000 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_144.mod +++ /dev/null @@ -1,8 +0,0 @@ -[name] -protonego-boot - -[files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod index 3af8240d7c2..4aacc4f27cc 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds a forwarded request customizer to the HTTP configuration used by the Unix Domain Socket connector, for use when behind a proxy operating diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod index d86002780f3..e8f17427237 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds a HTTP protocol support to the Unix Domain Socket connector. It should be used when a proxy is forwarding either HTTP or decrypted diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod index 396fdc1f609..7de5cb019fb 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Adds a HTTP2C connetion factory to the Unix Domain Socket Connector It can be used when either the proxy forwards direct diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod index a8186366ba8..c30c59bfe7f 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables the proxy protocol on the Unix Domain Socket Connector http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod index 4284943804b..a66ed83f716 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enable a secure request customizer on the HTTP Configuration used by the Unix Domain Socket Connector. diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket.mod b/jetty-unixsocket/src/main/config/modules/unixsocket.mod index 2bdb57df920..84a45d21831 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Enables a Unix Domain Socket Connector that can receive requests from a local proxy and/or SSL offloader (eg haproxy) in either diff --git a/jetty-util/src/main/config/modules/console-capture.mod b/jetty-util/src/main/config/modules/console-capture.mod index b4cda2351e4..e91e2baa93b 100644 --- a/jetty-util/src/main/config/modules/console-capture.mod +++ b/jetty-util/src/main/config/modules/console-capture.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Redirects JVMs console stderr and stdout to a log file, including output from Jetty's default StdErrLog logging. diff --git a/jetty-util/src/main/config/modules/jcl-slf4j.mod b/jetty-util/src/main/config/modules/jcl-slf4j.mod index ce109a259e9..cbe80839ca1 100644 --- a/jetty-util/src/main/config/modules/jcl-slf4j.mod +++ b/jetty-util/src/main/config/modules/jcl-slf4j.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a Java Commons Logging (JCL) binding to SLF4J logging. diff --git a/jetty-util/src/main/config/modules/jul-impl.mod b/jetty-util/src/main/config/modules/jul-impl.mod index b691795b6e1..7ac22f79fb2 100644 --- a/jetty-util/src/main/config/modules/jul-impl.mod +++ b/jetty-util/src/main/config/modules/jul-impl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Configures the Java Util Logging mechanism diff --git a/jetty-util/src/main/config/modules/jul-slf4j.mod b/jetty-util/src/main/config/modules/jul-slf4j.mod index 64397022f18..cf8317ec64e 100644 --- a/jetty-util/src/main/config/modules/jul-slf4j.mod +++ b/jetty-util/src/main/config/modules/jul-slf4j.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a Java Util Loggin binding to SLF4J logging. diff --git a/jetty-util/src/main/config/modules/log4j-impl.mod b/jetty-util/src/main/config/modules/log4j-impl.mod index dcc8fa52613..5be5f77f385 100644 --- a/jetty-util/src/main/config/modules/log4j-impl.mod +++ b/jetty-util/src/main/config/modules/log4j-impl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a Log4j v1.2 API and implementation. To receive jetty logs enable the jetty-slf4j and slf4j-log4j modules. diff --git a/jetty-util/src/main/config/modules/log4j2-api.mod b/jetty-util/src/main/config/modules/log4j2-api.mod index da7a609b047..3c4e4e82e8f 100644 --- a/jetty-util/src/main/config/modules/log4j2-api.mod +++ b/jetty-util/src/main/config/modules/log4j2-api.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides the Log4j v2 API diff --git a/jetty-util/src/main/config/modules/log4j2-impl.mod b/jetty-util/src/main/config/modules/log4j2-impl.mod index e069ecd62b1..d95806e7c54 100644 --- a/jetty-util/src/main/config/modules/log4j2-impl.mod +++ b/jetty-util/src/main/config/modules/log4j2-impl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a Log4j v2 implementation. To receive jetty logs enable the jetty-slf4j, slf4j-log4j and log4j-log4j2 modules. diff --git a/jetty-util/src/main/config/modules/log4j2-slf4j.mod b/jetty-util/src/main/config/modules/log4j2-slf4j.mod index f8085253127..6c351779b10 100644 --- a/jetty-util/src/main/config/modules/log4j2-slf4j.mod +++ b/jetty-util/src/main/config/modules/log4j2-slf4j.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a Log4j v2 binding to SLF4J logging. diff --git a/jetty-util/src/main/config/modules/logback-impl.mod b/jetty-util/src/main/config/modules/logback-impl.mod index e001ca0a76e..cc8569ef692 100644 --- a/jetty-util/src/main/config/modules/logback-impl.mod +++ b/jetty-util/src/main/config/modules/logback-impl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides the logback core implementation and logback-access diff --git a/jetty-util/src/main/config/modules/logging-jetty.mod b/jetty-util/src/main/config/modules/logging-jetty.mod index 85a89b6d102..65f926d3a89 100644 --- a/jetty-util/src/main/config/modules/logging-jetty.mod +++ b/jetty-util/src/main/config/modules/logging-jetty.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Configure jetty logging mechanism. Provides a ${jetty.base}/resources/jetty-logging.properties. diff --git a/jetty-util/src/main/config/modules/logging-jul.mod b/jetty-util/src/main/config/modules/logging-jul.mod index a2dbe05e804..bc0d414ba73 100644 --- a/jetty-util/src/main/config/modules/logging-jul.mod +++ b/jetty-util/src/main/config/modules/logging-jul.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Configure jetty logging to use Java Util Logging (jul) SLF4J is used as the core logging mechanism. diff --git a/jetty-util/src/main/config/modules/logging-log4j.mod b/jetty-util/src/main/config/modules/logging-log4j.mod index a19d24aaeab..75b2f29b36d 100644 --- a/jetty-util/src/main/config/modules/logging-log4j.mod +++ b/jetty-util/src/main/config/modules/logging-log4j.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Configure jetty logging to use Log4j Logging SLF4J is used as the core logging mechanism. diff --git a/jetty-util/src/main/config/modules/logging-log4j2.mod b/jetty-util/src/main/config/modules/logging-log4j2.mod index f946abef861..34bea9b9be6 100644 --- a/jetty-util/src/main/config/modules/logging-log4j2.mod +++ b/jetty-util/src/main/config/modules/logging-log4j2.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Configure jetty logging to use log4j version 2 SLF4J is used as the core logging mechanism. diff --git a/jetty-util/src/main/config/modules/logging-logback.mod b/jetty-util/src/main/config/modules/logging-logback.mod index b5c72046981..f6699c0257d 100644 --- a/jetty-util/src/main/config/modules/logging-logback.mod +++ b/jetty-util/src/main/config/modules/logging-logback.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Configure jetty logging to use Logback Logging. SLF4J is used as the core logging mechanism. diff --git a/jetty-util/src/main/config/modules/logging-slf4j.mod b/jetty-util/src/main/config/modules/logging-slf4j.mod index a9174b86ddc..aac12a87ef7 100644 --- a/jetty-util/src/main/config/modules/logging-slf4j.mod +++ b/jetty-util/src/main/config/modules/logging-slf4j.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Configure jetty logging to use slf4j. Any slf4j-impl implementation is used diff --git a/jetty-util/src/main/config/modules/slf4j-api.mod b/jetty-util/src/main/config/modules/slf4j-api.mod index 12054fc5e14..b490f3f20d0 100644 --- a/jetty-util/src/main/config/modules/slf4j-api.mod +++ b/jetty-util/src/main/config/modules/slf4j-api.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides SLF4J API. Requires a slf4j implementation (eg slf4j-simple-impl) otherwise a noop implementation is used. diff --git a/jetty-util/src/main/config/modules/slf4j-jul.mod b/jetty-util/src/main/config/modules/slf4j-jul.mod index 26bf8b786ae..a0e072daab2 100644 --- a/jetty-util/src/main/config/modules/slf4j-jul.mod +++ b/jetty-util/src/main/config/modules/slf4j-jul.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a SLF4J binding to Java Util Logging (JUL) logging. diff --git a/jetty-util/src/main/config/modules/slf4j-log4j.mod b/jetty-util/src/main/config/modules/slf4j-log4j.mod index 391061ee193..d61ded58678 100644 --- a/jetty-util/src/main/config/modules/slf4j-log4j.mod +++ b/jetty-util/src/main/config/modules/slf4j-log4j.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a SLF4J binding to the Log4j v1.2 API logging. diff --git a/jetty-util/src/main/config/modules/slf4j-log4j2.mod b/jetty-util/src/main/config/modules/slf4j-log4j2.mod index d1e327b40b9..4a5d104eea5 100644 --- a/jetty-util/src/main/config/modules/slf4j-log4j2.mod +++ b/jetty-util/src/main/config/modules/slf4j-log4j2.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a SLF4J binding to Log4j v2 logging. diff --git a/jetty-util/src/main/config/modules/slf4j-logback.mod b/jetty-util/src/main/config/modules/slf4j-logback.mod index 3ea375bb916..f9ebe8bfe1d 100644 --- a/jetty-util/src/main/config/modules/slf4j-logback.mod +++ b/jetty-util/src/main/config/modules/slf4j-logback.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides a SLF4J binding to Logback logging. diff --git a/jetty-util/src/main/config/modules/slf4j-simple-impl.mod b/jetty-util/src/main/config/modules/slf4j-simple-impl.mod index 168ff76e6f3..bc1b7fd92f8 100644 --- a/jetty-util/src/main/config/modules/slf4j-simple-impl.mod +++ b/jetty-util/src/main/config/modules/slf4j-simple-impl.mod @@ -1,3 +1,5 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + [description] Provides SLF4J simple logging implementation. To receive jetty logs enable the jetty-slf4j module. diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java b/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java index ae9201906c3..f1cbd74b718 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java @@ -32,98 +32,34 @@ public class JavaVersion * Acceptable values should correspond to those returned by JavaVersion.getPlatform(). */ public static final String JAVA_TARGET_PLATFORM = "org.eclipse.jetty.javaTargetPlatform"; + + public static final JavaVersion VERSION = parse(System.getProperty("java.version")); - /** Regex for Java version numbers */ - private static final String VNUM = "(?[1-9][0-9]*(?:(?:\\.0)*\\.[0-9]+)*)"; - private static final String UPDATE = "(?:(?_)(?[0-9]+))?"; - private static final String PRE = "(?:-(?

[a-zA-Z0-9]+))?";
-    private static final String BUILD = "(?:(?\\+)(?[0-9]+))?";
-    private static final String OPT = "(?:-(?[-a-zA-Z0-9.~]+))?";
-
-    private static final String VSTR_FORMAT = VNUM + UPDATE + PRE + BUILD + OPT;
-
-    static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT);
-    
-    public static final JavaVersion VERSION = parse(System.getProperty("java.runtime.version",System.getProperty("java.version")));
-
     public static JavaVersion parse(String v) 
-    {
-        Matcher m = VSTR_PATTERN.matcher(v);
-        if (!m.matches())
-            throw new IllegalArgumentException("Invalid version string: '" + v + "'");
-        
+    {        
         // $VNUM is a dot-separated list of integers of arbitrary length
-        String[] split = m.group("VNUM").split("\\.");
-        int[] version = new int[split.length];
-        for (int i = 0; i < split.length; i++)
-            version[i] = Integer.parseInt(split[i]);
-
-        if (m.group("UNDERSCORE")!=null)
+        String[] split = v.split("[^0-9]");
+        int len = Math.min(split.length,3);
+        int[] version = new int[len];
+        for (int i = 0; i < len; i++)
         {
-            return new JavaVersion(
-                    v,
-                    (version[0]>=9 || version.length==1)?version[0]:version[1],
-                    version[0],
-                    version.length>1?version[1]:0,
-                    version.length>2?version[2]:0,
-                    Integer.parseInt(m.group("UPDATE")),
-                    suffix(version,m.group("PRE"),m.group("OPT"))
-                    );
-        }
-        
-        if (m.group("PLUS")!=null)
-        {
-            return new JavaVersion(
-                    v,
-                    (version[0]>=9 || version.length==1)?version[0]:version[1],
-                    version[0],
-                    version.length>1?version[1]:0,
-                    version.length>2?version[2]:0,
-                    Integer.parseInt(m.group("BUILD")),
-                    suffix(version,m.group("PRE"),m.group("OPT"))
-                    );
+            try
+            {
+                version[i] = Integer.parseInt(split[i]);
+            }
+            catch(Throwable e)
+            {
+                len = i-1;
+                break;
+            }
         }
 
         return new JavaVersion(
                 v,
-                (version[0]>=9 || version.length==1)?version[0]:version[1],
+                (version[0]>=9 || len==1)?version[0]:version[1],
                 version[0],
-                version.length>1?version[1]:0,
-                version.length>2?version[2]:0,
-                0,
-                suffix(version,m.group("PRE"),m.group("OPT"))
-                );
-        
-    }
-
-    private static String suffix(int[] version, String pre, String opt)
-    {
-        StringBuilder buf = new StringBuilder();
-        for (int i=3;i3)
-                buf.append(".");
-            buf.append(version[i]);
-        }
-               
-        if (pre!=null)
-        {
-            if (buf.length()>0)
-                buf.append('-');
-            buf.append(pre);
-        }
-        
-        if (opt!=null)
-        {
-            if (buf.length()>0)
-                buf.append('-');
-            buf.append(opt);
-        }
-        
-        if (buf.length()==0)
-            return null;
-        
-        return buf.toString();
+                len>1?version[1]:0,
+                len>2?version[2]:0);
     }
     
     private final String version;
@@ -131,18 +67,14 @@ public class JavaVersion
     private final int major;
     private final int minor;
     private final int micro;
-    private final int update;
-    private final String suffix;
 
-    private JavaVersion(String version, int platform, int major, int minor, int micro, int update, String suffix)
+    private JavaVersion(String version, int platform, int major, int minor, int micro)
     {
         this.version = version;
         this.platform = platform;
         this.major = major;
         this.minor = minor;
         this.micro = micro;
-        this.update = update;
-        this.suffix = suffix;
     }
 
     /**
@@ -198,9 +130,10 @@ public class JavaVersion
      *
      * @return the update number version
      */
+    @Deprecated
     public int getUpdate()
     {
-        return update;
+        return 0;
     }
 
     /**
@@ -209,9 +142,10 @@ public class JavaVersion
      *
      * @return the remaining string after the version numbers
      */
+    @Deprecated
     public String getSuffix()
     {
-        return suffix;
+        return null;
     }
 
     @Override
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java
index 3c47bf4a353..b02896c454d 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java
@@ -19,7 +19,6 @@
 package org.eclipse.jetty.util;
 
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
 import static org.junit.Assert.assertThat;
 
 import org.junit.Test;
@@ -29,136 +28,135 @@ import org.junit.Test;
  */
 public class JavaVersionTest
 {
+    @Test
+    public void testAndroid()
+    {
+        JavaVersion version = JavaVersion.parse("0.9");
+        assertThat(version.toString(),is("0.9"));
+        assertThat(version.getPlatform(),is(9));
+        assertThat(version.getMajor(),is(0));
+        assertThat(version.getMinor(),is(9));
+        assertThat(version.getMicro(),is(0));
+    }
+    
     @Test
     public void test9()
     {
         JavaVersion version = JavaVersion.parse("9.0.1");
+        assertThat(version.toString(),is("9.0.1"));
         assertThat(version.getPlatform(),is(9));
         assertThat(version.getMajor(),is(9));
         assertThat(version.getMinor(),is(0));
         assertThat(version.getMicro(),is(1));
-        assertThat(version.getUpdate(),is(0));
-        assertThat(version.getSuffix(),nullValue());
     }
     
     @Test
     public void test9nano()
     {
         JavaVersion version = JavaVersion.parse("9.0.1.3");
+        assertThat(version.toString(),is("9.0.1.3"));
         assertThat(version.getPlatform(),is(9));
         assertThat(version.getMajor(),is(9));
         assertThat(version.getMinor(),is(0));
         assertThat(version.getMicro(),is(1));
-        assertThat(version.getUpdate(),is(0));
-        assertThat(version.getSuffix(),is("3"));
     }
     
     @Test
     public void test9build()
     {
         JavaVersion version = JavaVersion.parse("9.0.1+11");
+        assertThat(version.toString(),is("9.0.1+11"));
         assertThat(version.getPlatform(),is(9));
         assertThat(version.getMajor(),is(9));
         assertThat(version.getMinor(),is(0));
         assertThat(version.getMicro(),is(1));
-        assertThat(version.getUpdate(),is(11));
-        assertThat(version.getSuffix(),nullValue());
     }
     
     @Test
     public void test9all()
     {
         JavaVersion version = JavaVersion.parse("9.0.1-ea+11-b01");
+        assertThat(version.toString(),is("9.0.1-ea+11-b01"));
         assertThat(version.getPlatform(),is(9));
         assertThat(version.getMajor(),is(9));
         assertThat(version.getMinor(),is(0));
         assertThat(version.getMicro(),is(1));
-        assertThat(version.getUpdate(),is(11));
-        assertThat(version.getSuffix(),is("ea-b01"));
     }
     
     @Test
     public void test9yuck()
     {
         JavaVersion version = JavaVersion.parse("9.0.1.2.3-ea+11-b01");
+        assertThat(version.toString(),is("9.0.1.2.3-ea+11-b01"));
         assertThat(version.getPlatform(),is(9));
         assertThat(version.getMajor(),is(9));
         assertThat(version.getMinor(),is(0));
         assertThat(version.getMicro(),is(1));
-        assertThat(version.getUpdate(),is(11));
-        assertThat(version.getSuffix(),is("2.3-ea-b01"));
     }
     
     @Test
     public void test10ea()
     {
         JavaVersion version = JavaVersion.parse("10-ea");
+        assertThat(version.toString(),is("10-ea"));
         assertThat(version.getPlatform(),is(10));
         assertThat(version.getMajor(),is(10));
         assertThat(version.getMinor(),is(0));
         assertThat(version.getMicro(),is(0));
-        assertThat(version.getUpdate(),is(0));
-        assertThat(version.getSuffix(),is("ea"));
     }
     
     @Test
     public void test8()
     {
         JavaVersion version = JavaVersion.parse("1.8.0_152");
+        assertThat(version.toString(),is("1.8.0_152"));
         assertThat(version.getPlatform(),is(8));
         assertThat(version.getMajor(),is(1));
         assertThat(version.getMinor(),is(8));
         assertThat(version.getMicro(),is(0));
-        assertThat(version.getUpdate(),is(152));
-        assertThat(version.getSuffix(),nullValue()); 
     }
 
     @Test
     public void test8ea()
     {
         JavaVersion version = JavaVersion.parse("1.8.1_03-ea");
+        assertThat(version.toString(),is("1.8.1_03-ea"));
         assertThat(version.getPlatform(),is(8));
         assertThat(version.getMajor(),is(1));
         assertThat(version.getMinor(),is(8));
         assertThat(version.getMicro(),is(1));
-        assertThat(version.getUpdate(),is(3));
-        assertThat(version.getSuffix(),is("ea")); 
     }
     
     @Test
     public void test3eaBuild()
     {
         JavaVersion version = JavaVersion.parse("1.3.1_05-ea-b01");
+        assertThat(version.toString(),is("1.3.1_05-ea-b01"));
         assertThat(version.getPlatform(),is(3));
         assertThat(version.getMajor(),is(1));
         assertThat(version.getMinor(),is(3));
         assertThat(version.getMicro(),is(1));
-        assertThat(version.getUpdate(),is(5));
-        assertThat(version.getSuffix(),is("ea-b01")); 
     }
     
     @Test
     public void testUbuntu()
     {
         JavaVersion version = JavaVersion.parse("9-Ubuntu+0-9b181-4");
+        assertThat(version.toString(),is("9-Ubuntu+0-9b181-4"));
         assertThat(version.getPlatform(),is(9));
         assertThat(version.getMajor(),is(9));
         assertThat(version.getMinor(),is(0));
         assertThat(version.getMicro(),is(0));
-        assertThat(version.getUpdate(),is(0));
-        assertThat(version.getSuffix(),is("Ubuntu-9b181-4")); 
     }
     
     @Test
     public void testUbuntu8()
     {
-        JavaVersion version = JavaVersion.parse("1.8.0_151-8u151-b12-1~deb9u1-b12");
+        JavaVersion version = JavaVersion.parse("1.8.0_151-8u151-b12-1~deb9u1-b12");assertThat(version.toString(),is("1.8.0_151-8u151-b12-1~deb9u1-b12"));
         assertThat(version.getPlatform(),is(8));
         assertThat(version.getMajor(),is(1));
         assertThat(version.getMinor(),is(8));
         assertThat(version.getMicro(),is(0));
-        assertThat(version.getUpdate(),is(151));
-        assertThat(version.getSuffix(),is("8u151-b12-1~deb9u1-b12")); 
     }
     
 }
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/strategy/ExecutionStrategyTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/strategy/ExecutionStrategyTest.java
index 93b0a21779e..cb342024184 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/strategy/ExecutionStrategyTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/strategy/ExecutionStrategyTest.java
@@ -29,6 +29,7 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executor;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.eclipse.jetty.util.component.LifeCycle;
@@ -161,6 +162,7 @@ public class ExecutionStrategyTest
             public Runnable produce()
             {
                 final int id = tasks.decrementAndGet();
+
                 if (id>=0)
                 {
                     while(_threads.isRunning())
@@ -188,7 +190,7 @@ public class ExecutionStrategyTest
                 return null;
             }
         };
-        
+
         newExecutionStrategy(producer,_threads);
         _strategy.dispatch();
         
@@ -205,7 +207,6 @@ public class ExecutionStrategyTest
                     {
                         Thread.sleep(20);
                         q.offer(latch);
-                        _strategy.produce();
                     }
                 }
                 catch(Exception e)
@@ -218,6 +219,7 @@ public class ExecutionStrategyTest
         if (!latch.await(30,TimeUnit.SECONDS))
         {
             System.err.println(_strategy);
+            System.err.printf("tasks=%d latch=%d q=%d%n",TASKS,latch.getCount(), q.size());
             _threads.dumpStdErr();
             Assert.fail();
         }
diff --git a/jetty-webapp/src/main/config/modules/webapp.mod b/jetty-webapp/src/main/config/modules/webapp.mod
index 59f067f8118..cbffca1919c 100644
--- a/jetty-webapp/src/main/config/modules/webapp.mod
+++ b/jetty-webapp/src/main/config/modules/webapp.mod
@@ -1,3 +1,5 @@
+DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
+
 [description]
 Adds support for servlet specification webapplication to the server
 classpath.  Without this, only Jetty specific handlers may be deployed.
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java
index 569068ca5ed..02ce7a33e58 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java
@@ -64,23 +64,26 @@ public class CachingWebAppClassLoader extends WebAppClassLoader
         }
         
         URL url = _cache.get(name);
-        
-        if (name==null)
+
+        if (url == null)
         {
+            // Not found in cache, try parent
             url = super.getResource(name);
         
             if (url==null)
             {
+                // Still not found, cache the not-found result
                 if (LOG.isDebugEnabled())
                     LOG.debug("Caching not found resource {}",name);
                 _notFound.add(name);
             }
             else
             {
+                // Cache the new result
                 _cache.putIfAbsent(name,url);
             }
         }
-        
+
         return url;
     }
 
diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java
index 44090bc36af..17bedc87b06 100644
--- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java
+++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java
@@ -98,6 +98,7 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont
         // This constructor is used with Standalone JSR Client usage.
         this(new SimpleContainerScope(WebSocketPolicy.newClientPolicy()));
         client.setDaemon(true);
+        client.addManaged(client.getHttpClient());
     }
     
     /**
@@ -108,6 +109,7 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont
     public ClientContainer(final WebSocketContainerScope scope)
     {
         this(scope, null);
+        client.addManaged(client.getHttpClient());
     }
     
     /**
@@ -136,8 +138,7 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont
                 new JsrEventDriverFactory(scopeDelegate),
                 new JsrSessionFactory(this),
                 httpClient);
-        this.client.addBean(httpClient);
-    
+
         if(jsr356TrustAll != null)
         {
             boolean trustAll = Boolean.parseBoolean(jsr356TrustAll);
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod b/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod
index 4166982d247..b2a0ecc516c 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/config/modules/websocket.mod
@@ -1,3 +1,5 @@
+DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
+
 [description]
 Enable websockets for deployed web applications
 
diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java
index 1b5bd96a083..331eb7f8fd3 100644
--- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java
+++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java
@@ -25,6 +25,7 @@ import java.net.URI;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Future;
@@ -368,6 +369,15 @@ public class WebSocketClient extends ContainerLifeCycle implements WebSocketCont
             throw new IllegalArgumentException("WebSocket URI scheme only supports [ws] and [wss], not [" + scheme + "]");
         }
 
+        if ("wss".equals(scheme))
+        {
+            // test for ssl context
+            if (httpClient.getSslContextFactory() == null)
+            {
+                throw new IllegalStateException("HttpClient has no SslContextFactory, wss:// URI's are not supported in this configuration");
+            }
+        }
+
         request.setRequestURI(toUri);
         request.setLocalEndpoint(websocket);
 
@@ -391,6 +401,17 @@ public class WebSocketClient extends ContainerLifeCycle implements WebSocketCont
         return wsReq.sendAsync();
     }
 
+    @Override
+    protected void doStart() throws Exception
+    {
+        Objects.requireNonNull(httpClient, "Provided HttpClient is null");
+
+        super.doStart();
+
+        if (!httpClient.isRunning())
+            throw new IllegalStateException("HttpClient is not running (did you forget to start it?): " + httpClient);
+    }
+
     @Override
     protected void doStop() throws Exception
     {
diff --git a/pom.xml b/pom.xml
index bae5df5fa97..d1b0edd14a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -460,7 +460,7 @@
         
           org.apache.maven.plugins
           maven-javadoc-plugin
-          3.0.0-M1
+          3.0.0
           
             UTF-8
             UTF-8
@@ -1006,7 +1006,7 @@
   
 
   
-    
+    
     
       jdk10
       
@@ -1050,6 +1050,50 @@
         
       
     
+    
+    
+      jdk11
+      
+        11
+      
+      
+        
+          
+            
+              org.jacoco
+              jacoco-maven-plugin
+              0.8.1-SNAPSHOT
+              
+                true
+              
+            
+          
+        
+      
+      
+        
+          oss.snapshots
+          OSS Snapshots
+          https://oss.sonatype.org/content/repositories/snapshots
+          
+            false
+          
+          
+            true
+          
+        
+        
+          apache.snapshots
+          https://repository.apache.org/content/repositories/snapshots
+          
+            false
+          
+          
+            true
+          
+        
+      
+    
     
       errorprone
       
@@ -1755,6 +1799,14 @@
       IBM
       -8
     
+    
+      olamy
+      Olivier Lamy
+      oliver.lamy@gmail.com
+      Webtide, LLC
+      https://webtide.com
+      Australia/Brisbane
+    
   
 
   
@@ -1762,6 +1814,9 @@
     https://webtide.com
   
 
+  
 
   
     
diff --git a/tests/test-integration/pom.xml b/tests/test-integration/pom.xml
index edb785ca3cb..6e5cc58e119 100644
--- a/tests/test-integration/pom.xml
+++ b/tests/test-integration/pom.xml
@@ -118,6 +118,11 @@
       apache-jsp
       ${project.version}
     
+    
+      org.eclipse.jetty.http2
+      http2-server
+      ${project.version}
+    
     
       org.eclipse.jetty.tests
       test-webapp-rfc2616