Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-02-11 03:20:06 +0000
committerGreg Wilkins2015-02-11 03:20:06 +0000
commit2162455b72d5a474bba47d5daf5543d46c2688be (patch)
treefc8e6ffd366dcd6398b52897038faba2713e7c60
parentb399649a1a4189175535eabea0742739d5efa01a (diff)
downloadorg.eclipse.jetty.project-2162455b72d5a474bba47d5daf5543d46c2688be.tar.gz
org.eclipse.jetty.project-2162455b72d5a474bba47d5daf5543d46c2688be.tar.xz
org.eclipse.jetty.project-2162455b72d5a474bba47d5daf5543d46c2688be.zip
Removed SPDY and NPN
Because jetty 9.3 is targetted for HTTP2, we have removed support for SPDY and NPN.
-rw-r--r--aggregates/jetty-all-compact3/pom.xml14
-rw-r--r--aggregates/jetty-all/pom.xml6
-rw-r--r--examples/embedded/pom.xml14
-rw-r--r--examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java (renamed from jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/Http2Server.java)5
-rw-r--r--examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyConnector.java114
-rw-r--r--examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyServer.java210
-rw-r--r--examples/embedded/src/main/resources/docroot/push.html (renamed from jetty-http2/http2-server/src/test/docroot/push.html)0
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile00.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile00.jpg)bin15228 -> 15228 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile01.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile01.jpg)bin15168 -> 15168 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile02.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile02.jpg)bin15217 -> 15217 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile03.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile03.jpg)bin15323 -> 15323 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile04.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile04.jpg)bin15321 -> 15321 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile05.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile05.jpg)bin15276 -> 15276 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile06.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile06.jpg)bin15302 -> 15302 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile07.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile07.jpg)bin15246 -> 15246 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile08.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile08.jpg)bin15281 -> 15281 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile09.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile09.jpg)bin15539 -> 15539 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile10.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile10.jpg)bin16093 -> 16093 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile11.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile11.jpg)bin16024 -> 16024 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile12.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile12.jpg)bin15972 -> 15972 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile13.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile13.jpg)bin16012 -> 16012 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile14.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile14.jpg)bin16069 -> 16069 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile15.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile15.jpg)bin15916 -> 15916 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile16.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile16.jpg)bin15792 -> 15792 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile17.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile17.jpg)bin15813 -> 15813 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile18.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile18.jpg)bin15868 -> 15868 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile19.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile19.jpg)bin16299 -> 16299 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile20.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile20.jpg)bin15852 -> 15852 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile21.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile21.jpg)bin15775 -> 15775 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile22.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile22.jpg)bin15740 -> 15740 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile23.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile23.jpg)bin15950 -> 15950 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile24.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile24.jpg)bin16441 -> 16441 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile25.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile25.jpg)bin16426 -> 16426 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile26.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile26.jpg)bin15749 -> 15749 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile27.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile27.jpg)bin15647 -> 15647 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile28.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile28.jpg)bin15744 -> 15744 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile29.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile29.jpg)bin15849 -> 15849 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile30.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile30.jpg)bin15638 -> 15638 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile31.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile31.jpg)bin15567 -> 15567 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile32.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile32.jpg)bin15660 -> 15660 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile33.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile33.jpg)bin16331 -> 16331 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile34.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile34.jpg)bin16060 -> 16060 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile35.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile35.jpg)bin16062 -> 16062 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile36.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile36.jpg)bin16395 -> 16395 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile37.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile37.jpg)bin15823 -> 15823 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile38.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile38.jpg)bin15664 -> 15664 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile39.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile39.jpg)bin15609 -> 15609 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile40.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile40.jpg)bin15601 -> 15601 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile41.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile41.jpg)bin15664 -> 15664 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile42.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile42.jpg)bin16299 -> 16299 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile43.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile43.jpg)bin15958 -> 15958 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile44.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile44.jpg)bin15915 -> 15915 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile45.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile45.jpg)bin15903 -> 15903 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile46.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile46.jpg)bin15927 -> 15927 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile47.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile47.jpg)bin16327 -> 16327 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile48.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile48.jpg)bin15690 -> 15690 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/pushed/tile49.jpg (renamed from jetty-http2/http2-server/src/test/docroot/pushed/tile49.jpg)bin15612 -> 15612 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile00.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile00.jpg)bin15089 -> 15089 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile01.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile01.jpg)bin15085 -> 15085 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile02.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile02.jpg)bin15140 -> 15140 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile03.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile03.jpg)bin15276 -> 15276 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile04.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile04.jpg)bin15235 -> 15235 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile05.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile05.jpg)bin15254 -> 15254 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile06.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile06.jpg)bin15292 -> 15292 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile07.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile07.jpg)bin15227 -> 15227 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile08.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile08.jpg)bin15282 -> 15282 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile09.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile09.jpg)bin15532 -> 15532 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile10.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile10.jpg)bin15677 -> 15677 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile11.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile11.jpg)bin15673 -> 15673 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile12.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile12.jpg)bin15605 -> 15605 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile13.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile13.jpg)bin15664 -> 15664 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile14.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile14.jpg)bin15730 -> 15730 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile15.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile15.jpg)bin15614 -> 15614 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile16.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile16.jpg)bin15507 -> 15507 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile17.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile17.jpg)bin15533 -> 15533 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile18.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile18.jpg)bin15615 -> 15615 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile19.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile19.jpg)bin16092 -> 16092 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile20.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile20.jpg)bin15844 -> 15844 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile21.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile21.jpg)bin15815 -> 15815 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile22.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile22.jpg)bin15788 -> 15788 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile23.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile23.jpg)bin15994 -> 15994 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile24.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile24.jpg)bin16491 -> 16491 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile25.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile25.jpg)bin16403 -> 16403 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile26.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile26.jpg)bin15743 -> 15743 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile27.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile27.jpg)bin15603 -> 15603 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile28.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile28.jpg)bin15748 -> 15748 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile29.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile29.jpg)bin15876 -> 15876 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile30.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile30.jpg)bin15476 -> 15476 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile31.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile31.jpg)bin15438 -> 15438 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile32.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile32.jpg)bin15509 -> 15509 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile33.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile33.jpg)bin16272 -> 16272 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile34.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile34.jpg)bin16062 -> 16062 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile35.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile35.jpg)bin16064 -> 16064 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile36.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile36.jpg)bin16259 -> 16259 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile37.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile37.jpg)bin15679 -> 15679 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile38.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile38.jpg)bin15502 -> 15502 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile39.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile39.jpg)bin15439 -> 15439 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile40.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile40.jpg)bin15390 -> 15390 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile41.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile41.jpg)bin15455 -> 15455 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile42.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile42.jpg)bin16162 -> 16162 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile43.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile43.jpg)bin15896 -> 15896 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile44.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile44.jpg)bin15861 -> 15861 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile45.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile45.jpg)bin15843 -> 15843 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile46.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile46.jpg)bin15848 -> 15848 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile47.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile47.jpg)bin16214 -> 16214 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile48.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile48.jpg)bin15564 -> 15564 bytes
-rw-r--r--examples/embedded/src/main/resources/docroot/tiles/tile49.jpg (renamed from jetty-http2/http2-server/src/test/docroot/tiles/tile49.jpg)bin15517 -> 15517 bytes
-rw-r--r--jetty-ant/pom.xml2
-rw-r--r--jetty-distribution/pom.xml54
-rw-r--r--jetty-fcgi/fcgi-server/pom.xml113
-rw-r--r--jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalSPDYFastCGIProxyServer.java38
-rw-r--r--jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressSPDYFastCGIProxyServer.java42
-rw-r--r--jetty-npn/jetty-npn-client/pom.xml65
-rw-r--r--jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnection.java82
-rw-r--r--jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnectionFactory.java50
-rw-r--r--jetty-npn/jetty-npn-server/pom.xml54
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml32
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod8
-rw-r--r--jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn.mod38
-rw-r--r--jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnection.java68
-rw-r--r--jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java66
-rw-r--r--jetty-npn/jetty-npn-server/src/test/java/org/eclipse/jetty/npn/server/NPNModuleTest.java121
-rw-r--r--jetty-npn/pom.xml15
-rw-r--r--jetty-osgi/jetty-osgi-npn/pom.xml40
-rw-r--r--jetty-osgi/pom.xml13
-rw-r--r--jetty-osgi/test-jetty-osgi/pom.xml27
-rw-r--r--jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties1
-rw-r--r--jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml32
-rw-r--r--jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml2
-rw-r--r--jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java (renamed from jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java)20
-rw-r--r--jetty-spdy/pom.xml76
-rw-r--r--jetty-spdy/spdy-alpn-tests/pom.xml97
-rw-r--r--jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNNegotiationTest.java198
-rw-r--r--jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNSynReplyTest.java149
-rw-r--r--jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/AbstractALPNTest.java78
-rw-r--r--jetty-spdy/spdy-alpn-tests/src/test/resources/jetty-logging.properties2
-rw-r--r--jetty-spdy/spdy-alpn-tests/src/test/resources/keystore.jksbin2206 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-alpn-tests/src/test/resources/truststore.jksbin916 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-client/pom.xml75
-rw-r--r--jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/FlowControlStrategyFactory.java43
-rw-r--r--jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java442
-rw-r--r--jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java98
-rw-r--r--jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java191
-rw-r--r--jetty-spdy/spdy-core/pom.xml56
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java87
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java46
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java30
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java92
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Flusher.java266
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java39
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java120
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java24
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java60
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java90
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java48
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java92
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java1303
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java602
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java50
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java90
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java83
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java264
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java38
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayResultInfo.java57
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java135
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Info.java52
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java38
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingResultInfo.java44
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PushInfo.java101
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java107
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java78
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java39
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java50
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java261
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java163
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java68
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java228
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java61
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java237
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java110
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java128
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java38
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java128
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java50
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java56
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java59
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java51
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java63
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java51
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java61
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java29
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java41
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java51
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java49
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java56
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java83
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java48
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java51
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java87
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java57
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java63
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java67
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java150
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java76
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java49
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java51
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java52
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java91
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java104
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java94
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java52
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java26
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java213
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java274
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java155
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java159
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java230
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java173
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java41
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java240
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/PingBodyParser.java98
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/RstStreamBodyParser.java127
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SettingsBodyParser.java200
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynReplyBodyParser.java184
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynStreamBodyParser.java236
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameBodyParser.java72
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/WindowUpdateBodyParser.java127
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/AsyncTimeoutTest.java159
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java681
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardStreamTest.java258
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ClientUsageTest.java260
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ServerUsageTest.java121
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/CredentialGenerateParseTest.java104
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/DataGenerateParseTest.java144
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/GoAwayGenerateParseTest.java85
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/HeadersGenerateParseTest.java103
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/NoOpGenerateParseTest.java74
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/PingGenerateParseTest.java81
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/RstStreamGenerateParseTest.java92
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SettingsGenerateParseTest.java89
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynReplyGenerateParseTest.java91
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynStreamGenerateParseTest.java105
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/TestSPDYParserListener.java70
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/WindowUpdateGenerateParseTest.java85
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/generator/DataFrameGeneratorTest.java110
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/BrokenFrameTest.java287
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/LiveChromiumRequestParserTest.java100
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/ParseVersusCacheBenchmarkTest.java90
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameTest.java82
-rw-r--r--jetty-spdy/spdy-core/src/test/resources/jetty-logging.properties2
-rw-r--r--jetty-spdy/spdy-core/src/test/resources/keystore.jksbin2206 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-core/src/test/resources/truststore.jksbin916 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-example-webapp/pom.xml87
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/config/example-jetty-spdy-proxy.xml147
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/config/example-jetty-spdy.xml138
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/resources/jetty-logging.properties2
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/resources/keystore.jksbin2206 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/resources/truststore.jksbin916 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/webapp/WEB-INF/web.xml6
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/webapp/form.jsp3
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/webapp/included.jsp3
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/webapp/index.jsp37
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/webapp/logo.jpgbin5748 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-example-webapp/src/main/webapp/stylesheet.css9
-rw-r--r--jetty-spdy/spdy-http-client-transport/pom.xml70
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/main/java/org/eclipse/jetty/spdy/client/http/HttpChannelOverSPDY.java85
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/main/java/org/eclipse/jetty/spdy/client/http/HttpClientTransportOverSPDY.java107
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/main/java/org/eclipse/jetty/spdy/client/http/HttpConnectionOverSPDY.java80
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/main/java/org/eclipse/jetty/spdy/client/http/HttpDestinationOverSPDY.java38
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/main/java/org/eclipse/jetty/spdy/client/http/HttpReceiverOverSPDY.java152
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/main/java/org/eclipse/jetty/spdy/client/http/HttpSenderOverSPDY.java118
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/AbstractHttpClientServerTest.java107
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/EmptyServerHandler.java37
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientCustomProxyTest.java261
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientTest.java467
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/test/resources/jetty-logging.properties4
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/test/resources/keystore.jksbin2206 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-http-client-transport/src/test/resources/truststore.jksbin916 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-http-common/pom.xml48
-rw-r--r--jetty-spdy/spdy-http-common/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYHeader.java82
-rw-r--r--jetty-spdy/spdy-http-server/pom.xml111
-rw-r--r--jetty-spdy/spdy-http-server/src/main/config/etc/jetty-spdy-proxy.xml158
-rw-r--r--jetty-spdy/spdy-http-server/src/main/config/etc/jetty-spdy.xml60
-rw-r--r--jetty-spdy/spdy-http-server/src/main/config/modules/spdy.mod21
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HTTPSPDYServerConnectionFactory.java166
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HTTPSPDYServerConnector.java82
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpChannelOverSPDY.java186
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpInputOverSPDY.java59
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java439
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/PushStrategy.java55
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/ReferrerPushStrategy.java342
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/HTTPProxyEngine.java276
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/HTTPSPDYProxyServerConnector.java63
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyEngine.java129
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyEngineSelector.java203
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPConnectionFactory.java57
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java378
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/SPDYProxyEngine.java631
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/AbstractHTTPSPDYTest.java136
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ConcurrentStreamsTest.java128
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java289
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/PushStrategyBenchmarkTest.java397
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ReferrerPushStrategyTest.java1138
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ReferrerPushStrategyUnitTest.java149
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/SPDYTestUtils.java51
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/SSLExternalServerTest.java108
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ServerHTTPSPDYTest.java1625
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/SimpleHTTPBenchmarkTest.java160
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPToSPDYTest.java408
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxySPDYToHTTPLoadTest.java320
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxySPDYToHTTPTest.java546
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxySPDYToSPDYLoadTest.java275
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/proxy/ProxySPDYToSPDYTest.java553
-rw-r--r--jetty-spdy/spdy-http-server/src/test/resources/big_script.js791
-rw-r--r--jetty-spdy/spdy-http-server/src/test/resources/jetty-logging.properties10
-rw-r--r--jetty-spdy/spdy-http-server/src/test/resources/keystore.jksbin2206 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-http-server/src/test/resources/truststore.jksbin916 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-npn-tests/pom.xml102
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/AbstractNPNTest.java77
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/NPNNegotiationTest.java207
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/SSLEngineLeakTest.java71
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/SSLSynReplyTest.java150
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/proxy/NPNProxySPDYToHTTPLoadTest.java29
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/proxy/NPNProxySPDYToHTTPTest.java27
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/proxy/NPNProxySPDYToSPDYLoadTest.java27
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/proxy/NPNProxySPDYToSPDYTest.java27
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/resources/jetty-logging.properties2
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/resources/keystore.jksbin2206 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-npn-tests/src/test/resources/truststore.jksbin916 -> 0 bytes
-rw-r--r--jetty-spdy/spdy-server/pom.xml81
-rw-r--r--jetty-spdy/spdy-server/src/main/java/org/eclipse/jetty/spdy/server/SPDYServerConnectionFactory.java212
-rw-r--r--jetty-spdy/spdy-server/src/main/java/org/eclipse/jetty/spdy/server/SPDYServerConnector.java53
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/AbstractTest.java151
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/ClosedStreamTest.java273
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/FlowControlTest.java493
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/GoAwayTest.java234
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/HeadersTest.java86
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/IdleTimeoutTest.java257
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/MaxConcurrentStreamTest.java121
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/PingTest.java106
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/ProtocolViolationsTest.java185
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/PushStreamTest.java591
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/ResetStreamTest.java204
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/SPDYClientFactoryTest.java75
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/SPDYServerConnectorTest.java70
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/SettingsTest.java168
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/SynDataReplyDataLoadTest.java295
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/SynReplyTest.java375
-rw-r--r--jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/UnsupportedVersionTest.java100
-rw-r--r--jetty-spdy/spdy-server/src/test/resources/jetty-logging.properties2
-rw-r--r--pom.xml15
-rw-r--r--tests/test-webapps/test-jetty-webapp/pom.xml6
-rw-r--r--tests/test-webapps/test-proxy-webapp/pom.xml24
-rw-r--r--tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java40
376 files changed, 189 insertions, 33529 deletions
diff --git a/aggregates/jetty-all-compact3/pom.xml b/aggregates/jetty-all-compact3/pom.xml
index d9e562a308..b4302d8124 100644
--- a/aggregates/jetty-all-compact3/pom.xml
+++ b/aggregates/jetty-all-compact3/pom.xml
@@ -166,20 +166,6 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
- <!-- not supported in compact3
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-jmx</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-plus</artifactId>
diff --git a/aggregates/jetty-all/pom.xml b/aggregates/jetty-all/pom.xml
index 89bf73d421..ed74863742 100644
--- a/aggregates/jetty-all/pom.xml
+++ b/aggregates/jetty-all/pom.xml
@@ -141,12 +141,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>${project.version}</version>
diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml
index 0aab3c82f9..6fbb0b7cc1 100644
--- a/examples/embedded/pom.xml
+++ b/examples/embedded/pom.xml
@@ -56,8 +56,18 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
+ <groupId>org.eclipse.jetty.http2</groupId>
+ <artifactId>http2-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.alpn</groupId>
+ <artifactId>alpn-api</artifactId>
+ <version>${alpn.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-alpn-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/Http2Server.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java
index 601e87cc9a..d83c76f11e 100644
--- a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/Http2Server.java
+++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java
@@ -17,7 +17,7 @@
//
-package org.eclipse.jetty.http2.server;
+package org.eclipse.jetty.embedded;
import java.io.IOException;
import java.util.Date;
@@ -39,6 +39,7 @@ import javax.servlet.http.HttpSession;
import org.eclipse.jetty.alpn.ALPN;
import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
+import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
@@ -64,7 +65,7 @@ public class Http2Server
Server server = new Server();
ServletContextHandler context = new ServletContextHandler(server, "/",ServletContextHandler.SESSIONS);
- context.setResourceBase("src/test/docroot");
+ context.setResourceBase("src/main/resources/docroot");
context.addFilter(PushSessionCacheFilter.class,"/*",EnumSet.of(DispatcherType.REQUEST));
context.addFilter(PushedTilesFilter.class,"/*",EnumSet.of(DispatcherType.REQUEST));
context.addServlet(new ServletHolder(servlet), "/test/*");
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyConnector.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyConnector.java
deleted file mode 100644
index f35957b978..0000000000
--- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyConnector.java
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.embedded;
-
-import org.eclipse.jetty.npn.server.NPNServerConnectionFactory;
-import java.io.File;
-import java.io.FileNotFoundException;
-
-import org.eclipse.jetty.server.HttpConfiguration;
-import org.eclipse.jetty.server.HttpConnectionFactory;
-import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
-import org.eclipse.jetty.server.SecureRequestCustomizer;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.SslConnectionFactory;
-import org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnectionFactory;
-import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-
-/**
- * A Jetty server with HTTP and SPDY connectors.
- */
-public class SpdyConnector
-{
- public static void main(String[] args) throws Exception
- {
- // Path to as-built jetty-distribution directory
- String jettyHomeBuild = "../../jetty-distribution/target/distribution";
-
- // Find jetty home directories
- String homePath = System.getProperty("jetty.home", jettyHomeBuild);
- File homeDir = new File(homePath);
- if (!homeDir.exists())
- {
- throw new FileNotFoundException(homeDir.getAbsolutePath());
- }
- String jetty_home = homeDir.getAbsolutePath();
- System.setProperty("jetty.home", jetty_home);
-
- // The Server
- Server server = new Server();
-
- // HTTP Configuration
- HttpConfiguration http_config = new HttpConfiguration();
- http_config.setSecureScheme("https");
- http_config.setSecurePort(8443);
-
- // HTTP connector
- ServerConnector http = new ServerConnector(server,
- new HttpConnectionFactory(http_config));
- http.setPort(8080);
- server.addConnector(http);
-
- // SSL Context Factory for HTTPS and SPDY
- SslContextFactory sslContextFactory = new SslContextFactory();
- sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
- sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
- sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
-
- // HTTPS Configuration
- HttpConfiguration https_config = new HttpConfiguration(http_config);
- https_config.addCustomizer(new SecureRequestCustomizer());
-
- // SPDY versions
- HTTPSPDYServerConnectionFactory spdy2 =
- new HTTPSPDYServerConnectionFactory(2, https_config);
-
- HTTPSPDYServerConnectionFactory spdy3 =
- new HTTPSPDYServerConnectionFactory(3, https_config,
- new ReferrerPushStrategy());
-
- // NPN Factory
- NegotiatingServerConnectionFactory.checkProtocolNegotiationAvailable();
- NPNServerConnectionFactory npn = new NPNServerConnectionFactory(
- spdy3.getProtocol(),
- spdy2.getProtocol(),
- http.getDefaultProtocol());
- npn.setDefaultProtocol(http.getDefaultProtocol());
-
- // SSL Factory
- SslConnectionFactory ssl = new SslConnectionFactory(
- sslContextFactory, npn.getProtocol());
-
- // SPDY Connector
- ServerConnector spdyConnector = new ServerConnector(server, ssl,
- npn, spdy3, spdy2,
- new HttpConnectionFactory(https_config));
- spdyConnector.setPort(8443);
- server.addConnector(spdyConnector);
-
- // Set a handler
- server.setHandler(new HelloHandler());
-
- // Start the server
- server.start();
- server.join();
- }
-}
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyServer.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyServer.java
deleted file mode 100644
index 60f2f8d461..0000000000
--- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/SpdyServer.java
+++ /dev/null
@@ -1,210 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.embedded;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.lang.management.ManagementFactory;
-
-import org.eclipse.jetty.deploy.DeploymentManager;
-import org.eclipse.jetty.deploy.providers.WebAppProvider;
-import org.eclipse.jetty.jmx.MBeanContainer;
-import org.eclipse.jetty.npn.server.NPNServerConnectionFactory;
-import org.eclipse.jetty.security.HashLoginService;
-import org.eclipse.jetty.server.AsyncNCSARequestLog;
-import org.eclipse.jetty.server.ForwardedRequestCustomizer;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.HttpConfiguration;
-import org.eclipse.jetty.server.HttpConnectionFactory;
-import org.eclipse.jetty.server.NCSARequestLog;
-import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
-import org.eclipse.jetty.server.SecureRequestCustomizer;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.SslConnectionFactory;
-import org.eclipse.jetty.server.handler.ContextHandlerCollection;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.server.handler.RequestLogHandler;
-import org.eclipse.jetty.server.handler.StatisticsHandler;
-import org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnectionFactory;
-import org.eclipse.jetty.spdy.server.http.PushStrategy;
-import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.util.thread.QueuedThreadPool;
-
-public class SpdyServer
-{
- public static void main( String[] args ) throws Exception
- {
- // Path to as-built jetty-distribution directory
- String jettyHomeBuild = "../../jetty-distribution/target/distribution";
-
- // Find jetty home directories
- String homePath = System.getProperty("jetty.home", jettyHomeBuild);
- File homeDir = new File(homePath);
- if (!homeDir.exists())
- {
- throw new FileNotFoundException(homeDir.getAbsolutePath());
- }
- String jetty_home = homeDir.getAbsolutePath();
- System.setProperty("jetty.home", jetty_home);
-
- // Setup Threadpool
- QueuedThreadPool threadPool = new QueuedThreadPool(512);
-
- // Setup Jetty Server instance
- Server server = new Server(threadPool);
- server.manage(threadPool);
- server.setDumpAfterStart(false);
- server.setDumpBeforeStop(false);
-
- // Setup JMX
- MBeanContainer mbContainer = new MBeanContainer(
- ManagementFactory.getPlatformMBeanServer());
- server.addBean(mbContainer);
-
- // Common HTTP configuration
- HttpConfiguration config = new HttpConfiguration();
- config.setSecurePort(8443);
- config.addCustomizer(new ForwardedRequestCustomizer());
- config.addCustomizer(new SecureRequestCustomizer());
- config.setSendServerVersion(true);
-
- // Http Connector Setup
-
- // A plain HTTP connector listening on port 8080. Note that it's also
- // possible to have port 8080 configured as a non SSL SPDY connector.
- // But the specification and most browsers do not allow to use SPDY
- // without SSL encryption. However some browsers allow it to be
- // configured.
- HttpConnectionFactory http = new HttpConnectionFactory(config);
- ServerConnector httpConnector = new ServerConnector(server, http);
- httpConnector.setPort(8080);
- httpConnector.setIdleTimeout(10000);
- server.addConnector(httpConnector);
-
- // SSL configurations
-
- // We need a SSLContextFactory for the SSL encryption. That
- // SSLContextFactory will be used by the SPDY
- // connector.
- SslContextFactory sslContextFactory = new SslContextFactory();
- sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
- sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
- sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
- sslContextFactory.setTrustStorePath(jetty_home + "/etc/keystore");
- sslContextFactory.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
- sslContextFactory.setExcludeCipherSuites(
- "SSL_RSA_WITH_DES_CBC_SHA",
- "SSL_DHE_RSA_WITH_DES_CBC_SHA",
- "SSL_DHE_DSS_WITH_DES_CBC_SHA",
- "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
- "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
- "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
- "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
-
- // Spdy Connector
-
- // Make sure that the required NPN implementations are available.
- NegotiatingServerConnectionFactory.checkProtocolNegotiationAvailable();
-
- // A ReferrerPushStrategy is being initialized.
- // See:
- // http://www.eclipse.org/jetty/documentation/current/spdy-configuring-push.html
- // for more details.
- PushStrategy push = new ReferrerPushStrategy();
- HTTPSPDYServerConnectionFactory spdy2 =
- new HTTPSPDYServerConnectionFactory(2, config, push);
- spdy2.setInputBufferSize(8192);
- spdy2.setInitialWindowSize(32768);
-
- // We need a connection factory per protocol that our server is supposed
- // to support on the NPN port. We then
- // create a ServerConnector and pass in the supported factories. NPN
- // will then be used to negotiate the
- // protocol with the client.
- HTTPSPDYServerConnectionFactory spdy3 =
- new HTTPSPDYServerConnectionFactory(3, config, push);
- spdy3.setInputBufferSize(8192);
-
- NPNServerConnectionFactory npn = new NPNServerConnectionFactory(
- spdy3.getProtocol(), spdy2.getProtocol(), http.getProtocol());
- npn.setDefaultProtocol(http.getProtocol());
- npn.setInputBufferSize(1024);
-
- SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,
- npn.getProtocol());
-
- // Setup the npn connector on port 8443
- ServerConnector spdyConnector = new ServerConnector(server, ssl,
- npn, spdy3, spdy2, http);
- spdyConnector.setPort(8443);
-
- server.addConnector(spdyConnector);
-
- // The following section adds some handlers, deployers and webapp
- // providers. See
- // http://www.eclipse.org/jetty/documentation/current/advanced-embedding.html
- // for details.
-
- // Setup handlers
- HandlerCollection handlers = new HandlerCollection();
- ContextHandlerCollection contexts = new ContextHandlerCollection();
- RequestLogHandler requestLogHandler = new RequestLogHandler();
-
- handlers.setHandlers(new Handler[] { contexts, new DefaultHandler(),
- requestLogHandler });
-
- StatisticsHandler stats = new StatisticsHandler();
- stats.setHandler(handlers);
-
- server.setHandler(stats);
-
- // Setup deployers
- DeploymentManager deployer = new DeploymentManager();
- deployer.setContexts(contexts);
- server.addBean(deployer);
-
- WebAppProvider webapp_provider = new WebAppProvider();
- webapp_provider.setMonitoredDirName(jetty_home + "/webapps");
- webapp_provider.setParentLoaderPriority(false);
- webapp_provider.setExtractWars(true);
- webapp_provider.setScanInterval(2);
- webapp_provider.setDefaultsDescriptor(jetty_home
- + "/etc/webdefault.xml");
- deployer.addAppProvider(webapp_provider);
-
- HashLoginService login = new HashLoginService();
- login.setName("Test Realm");
- login.setConfig(jetty_home + "/etc/realm.properties");
- server.addBean(login);
-
- NCSARequestLog requestLog = new AsyncNCSARequestLog();
- requestLog.setFilename(jetty_home + "/logs/jetty-yyyy_mm_dd.log");
- requestLog.setExtended(false);
- requestLogHandler.setRequestLog(requestLog);
-
- server.setStopAtShutdown(true);
-
- server.start();
- server.dumpStdErr();
- server.join();
- }
-}
diff --git a/jetty-http2/http2-server/src/test/docroot/push.html b/examples/embedded/src/main/resources/docroot/push.html
index 9c3c817ea8..9c3c817ea8 100644
--- a/jetty-http2/http2-server/src/test/docroot/push.html
+++ b/examples/embedded/src/main/resources/docroot/push.html
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile00.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile00.jpg
index dc303075c6..dc303075c6 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile00.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile00.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile01.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile01.jpg
index 66c2e25253..66c2e25253 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile01.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile01.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile02.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile02.jpg
index f281dfd3f6..f281dfd3f6 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile02.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile02.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile03.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile03.jpg
index 4787e69e90..4787e69e90 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile03.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile03.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile04.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile04.jpg
index 64e6d1026c..64e6d1026c 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile04.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile04.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile05.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile05.jpg
index 1530c7687b..1530c7687b 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile05.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile05.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile06.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile06.jpg
index cd59c5f7ee..cd59c5f7ee 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile06.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile06.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile07.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile07.jpg
index 7f852875de..7f852875de 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile07.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile07.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile08.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile08.jpg
index 31ebcb0db8..31ebcb0db8 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile08.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile08.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile09.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile09.jpg
index b9cfb1a487..b9cfb1a487 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile09.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile09.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile10.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile10.jpg
index 11c6faeb2e..11c6faeb2e 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile10.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile10.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile11.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile11.jpg
index fee6760310..fee6760310 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile11.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile11.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile12.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile12.jpg
index a5032464e2..a5032464e2 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile12.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile12.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile13.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile13.jpg
index 4227207ddb..4227207ddb 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile13.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile13.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile14.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile14.jpg
index 6071c0ffbf..6071c0ffbf 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile14.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile14.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile15.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile15.jpg
index 64a0bf99b8..64a0bf99b8 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile15.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile15.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile16.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile16.jpg
index f5995168c2..f5995168c2 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile16.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile16.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile17.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile17.jpg
index b4183b3ea8..b4183b3ea8 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile17.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile17.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile18.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile18.jpg
index 5a568e2801..5a568e2801 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile18.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile18.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile19.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile19.jpg
index 126c3c6404..126c3c6404 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile19.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile19.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile20.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile20.jpg
index 5423ac1811..5423ac1811 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile20.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile20.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile21.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile21.jpg
index 0b6edb0d77..0b6edb0d77 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile21.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile21.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile22.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile22.jpg
index f788a4849a..f788a4849a 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile22.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile22.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile23.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile23.jpg
index 1fbc64d0ba..1fbc64d0ba 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile23.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile23.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile24.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile24.jpg
index f565b8fff2..f565b8fff2 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile24.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile24.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile25.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile25.jpg
index 18a4d0697c..18a4d0697c 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile25.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile25.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile26.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile26.jpg
index dde86ecf64..dde86ecf64 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile26.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile26.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile27.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile27.jpg
index eaf0ce8a76..eaf0ce8a76 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile27.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile27.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile28.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile28.jpg
index 7e596304f3..7e596304f3 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile28.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile28.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile29.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile29.jpg
index 1eb25b7dce..1eb25b7dce 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile29.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile29.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile30.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile30.jpg
index ea68292a07..ea68292a07 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile30.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile30.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile31.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile31.jpg
index 31455ca321..31455ca321 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile31.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile31.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile32.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile32.jpg
index f6a2a2947d..f6a2a2947d 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile32.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile32.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile33.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile33.jpg
index 8362cf44a5..8362cf44a5 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile33.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile33.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile34.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile34.jpg
index 2b856a0dc7..2b856a0dc7 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile34.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile34.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile35.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile35.jpg
index 4e59e21a91..4e59e21a91 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile35.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile35.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile36.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile36.jpg
index 7df53fdd73..7df53fdd73 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile36.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile36.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile37.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile37.jpg
index 31844113b9..31844113b9 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile37.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile37.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile38.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile38.jpg
index 52b44b8c98..52b44b8c98 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile38.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile38.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile39.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile39.jpg
index 2f7a636b4a..2f7a636b4a 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile39.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile39.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile40.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile40.jpg
index 61cfdfacb0..61cfdfacb0 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile40.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile40.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile41.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile41.jpg
index d25a4e4db4..d25a4e4db4 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile41.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile41.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile42.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile42.jpg
index 029e0f6731..029e0f6731 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile42.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile42.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile43.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile43.jpg
index 5ea4f5582d..5ea4f5582d 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile43.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile43.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile44.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile44.jpg
index ba18b30f5a..ba18b30f5a 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile44.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile44.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile45.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile45.jpg
index b856d66a3f..b856d66a3f 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile45.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile45.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile46.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile46.jpg
index f474cc2f9f..f474cc2f9f 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile46.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile46.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile47.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile47.jpg
index 6b2f58e2ca..6b2f58e2ca 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile47.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile47.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile48.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile48.jpg
index e5d1426542..e5d1426542 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile48.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile48.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/pushed/tile49.jpg b/examples/embedded/src/main/resources/docroot/pushed/tile49.jpg
index 6a33cf3725..6a33cf3725 100644
--- a/jetty-http2/http2-server/src/test/docroot/pushed/tile49.jpg
+++ b/examples/embedded/src/main/resources/docroot/pushed/tile49.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile00.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile00.jpg
index b2e52fbb8b..b2e52fbb8b 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile00.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile00.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile01.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile01.jpg
index 4d98637b23..4d98637b23 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile01.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile01.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile02.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile02.jpg
index 06b289b5a4..06b289b5a4 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile02.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile02.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile03.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile03.jpg
index fcb7b194af..fcb7b194af 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile03.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile03.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile04.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile04.jpg
index 0cc4933277..0cc4933277 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile04.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile04.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile05.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile05.jpg
index 6a6d66fb41..6a6d66fb41 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile05.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile05.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile06.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile06.jpg
index 89ddd6406e..89ddd6406e 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile06.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile06.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile07.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile07.jpg
index 967931796e..967931796e 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile07.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile07.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile08.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile08.jpg
index aa895c4969..aa895c4969 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile08.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile08.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile09.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile09.jpg
index 9c234cacf3..9c234cacf3 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile09.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile09.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile10.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile10.jpg
index 8bc306c463..8bc306c463 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile10.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile10.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile11.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile11.jpg
index 85b62b6b70..85b62b6b70 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile11.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile11.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile12.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile12.jpg
index 448faa2533..448faa2533 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile12.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile12.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile13.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile13.jpg
index 4f4f9012e0..4f4f9012e0 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile13.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile13.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile14.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile14.jpg
index e03120b27c..e03120b27c 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile14.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile14.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile15.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile15.jpg
index 64bc2383dc..64bc2383dc 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile15.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile15.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile16.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile16.jpg
index 5e858b9ecd..5e858b9ecd 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile16.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile16.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile17.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile17.jpg
index 2da3aa8ef0..2da3aa8ef0 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile17.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile17.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile18.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile18.jpg
index e934ce5ec1..e934ce5ec1 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile18.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile18.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile19.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile19.jpg
index 15707bc73e..15707bc73e 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile19.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile19.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile20.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile20.jpg
index 4b940f13d4..4b940f13d4 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile20.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile20.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile21.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile21.jpg
index b340585ab0..b340585ab0 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile21.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile21.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile22.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile22.jpg
index 39b08249da..39b08249da 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile22.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile22.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile23.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile23.jpg
index 42adae167e..42adae167e 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile23.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile23.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile24.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile24.jpg
index a8281ddb53..a8281ddb53 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile24.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile24.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile25.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile25.jpg
index 43692f0795..43692f0795 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile25.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile25.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile26.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile26.jpg
index f8de0f7f36..f8de0f7f36 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile26.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile26.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile27.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile27.jpg
index f6c210ac9d..f6c210ac9d 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile27.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile27.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile28.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile28.jpg
index 39f262204c..39f262204c 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile28.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile28.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile29.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile29.jpg
index 952ce0bf67..952ce0bf67 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile29.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile29.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile30.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile30.jpg
index e699a53cd4..e699a53cd4 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile30.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile30.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile31.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile31.jpg
index d6256fe653..d6256fe653 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile31.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile31.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile32.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile32.jpg
index fde5e8b9b3..fde5e8b9b3 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile32.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile32.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile33.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile33.jpg
index 2ba66aa343..2ba66aa343 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile33.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile33.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile34.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile34.jpg
index 37e24f05c2..37e24f05c2 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile34.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile34.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile35.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile35.jpg
index b147697ed6..b147697ed6 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile35.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile35.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile36.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile36.jpg
index 6501650b18..6501650b18 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile36.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile36.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile37.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile37.jpg
index e2d40eeb9d..e2d40eeb9d 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile37.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile37.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile38.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile38.jpg
index 1363781678..1363781678 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile38.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile38.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile39.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile39.jpg
index 790cfd220a..790cfd220a 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile39.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile39.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile40.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile40.jpg
index 3027238b9e..3027238b9e 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile40.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile40.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile41.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile41.jpg
index d085e38e42..d085e38e42 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile41.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile41.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile42.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile42.jpg
index b7ec60fed9..b7ec60fed9 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile42.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile42.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile43.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile43.jpg
index 6230abd253..6230abd253 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile43.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile43.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile44.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile44.jpg
index 46ad6a1f20..46ad6a1f20 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile44.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile44.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile45.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile45.jpg
index 89d2d325d1..89d2d325d1 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile45.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile45.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile46.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile46.jpg
index 9f3451f881..9f3451f881 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile46.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile46.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile47.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile47.jpg
index b702178926..b702178926 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile47.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile47.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile48.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile48.jpg
index 9defd9a30e..9defd9a30e 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile48.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile48.jpg
Binary files differ
diff --git a/jetty-http2/http2-server/src/test/docroot/tiles/tile49.jpg b/examples/embedded/src/main/resources/docroot/tiles/tile49.jpg
index 26f2a44a56..26f2a44a56 100644
--- a/jetty-http2/http2-server/src/test/docroot/tiles/tile49.jpg
+++ b/examples/embedded/src/main/resources/docroot/tiles/tile49.jpg
Binary files differ
diff --git a/jetty-ant/pom.xml b/jetty-ant/pom.xml
index ea9b556fa4..64205ba7ad 100644
--- a/jetty-ant/pom.xml
+++ b/jetty-ant/pom.xml
@@ -25,7 +25,7 @@
</goals>
<configuration>
<includeGroupIds>org.eclipse.jetty</includeGroupIds>
- <excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.spdy,org.eclipse.jetty.websocket,org.eclipse.jetty.drafts</excludeGroupIds>
+ <excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.websocket,org.eclipse.jetty.drafts</excludeGroupIds>
<excludeArtifactIds>jetty-all,jetty-start,jetty-monitor,jetty-jsp</excludeArtifactIds>
<includeTypes>jar</includeTypes>
<outputDirectory>${project.build.directory}/test-lib</outputDirectory>
diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml
index 7f61e42b59..d8fc9d3c37 100644
--- a/jetty-distribution/pom.xml
+++ b/jetty-distribution/pom.xml
@@ -301,7 +301,7 @@
</goals>
<configuration>
<includeGroupIds>org.eclipse.jetty</includeGroupIds>
- <excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.http2,org.eclipse.jetty.spdy,org.eclipse.jetty.websocket,org.eclipse.jetty.fcgi,org.eclipse.jetty.toolchain,org.apache.taglibs</excludeGroupIds>
+ <excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.http2,org.eclipse.jetty.websocket,org.eclipse.jetty.fcgi,org.eclipse.jetty.toolchain,org.apache.taglibs</excludeGroupIds>
<excludeArtifactIds>jetty-all,jetty-jsp,apache-jsp,apache-jstl,jetty-start,jetty-monitor,jetty-spring</excludeArtifactIds>
<includeTypes>jar</includeTypes>
<outputDirectory>${assembly-directory}/lib</outputDirectory>
@@ -405,32 +405,6 @@
</configuration>
</execution>
<execution>
- <id>unpack-spdy</id>
- <phase>process-resources</phase>
- <goals>
- <goal>unpack-dependencies</goal>
- </goals>
- <configuration>
- <includeGroupIds>org.eclipse.jetty.spdy</includeGroupIds>
- <classifier>config</classifier>
- <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
- <excludes>META-INF/**</excludes>
- <outputDirectory>${assembly-directory}</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>copy-lib-spdy-deps</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <includeGroupIds>org.eclipse.jetty.spdy</includeGroupIds>
- <includeTypes>jar</includeTypes>
- <outputDirectory>${assembly-directory}/lib/spdy</outputDirectory>
- </configuration>
- </execution>
- <execution>
<id>copy-annotations-deps</id>
<phase>generate-resources</phase>
<goals>
@@ -842,37 +816,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-example-webapp</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-npn-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.eclipse.jetty.example-async-rest</groupId>
<artifactId>example-async-rest-webapp</artifactId>
<version>${project.version}</version>
diff --git a/jetty-fcgi/fcgi-server/pom.xml b/jetty-fcgi/fcgi-server/pom.xml
index 91c096b59f..760556448f 100644
--- a/jetty-fcgi/fcgi-server/pom.xml
+++ b/jetty-fcgi/fcgi-server/pom.xml
@@ -1,57 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.eclipse.jetty.fcgi</groupId>
- <artifactId>fcgi-parent</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.eclipse.jetty.fcgi</groupId>
+ <artifactId>fcgi-parent</artifactId>
+ <version>9.3.0-SNAPSHOT</version>
+ </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>fcgi-server</artifactId>
- <name>Jetty :: FastCGI :: Server</name>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>fcgi-server</artifactId>
+ <name>Jetty :: FastCGI :: Server</name>
- <properties>
- <bundle-symbolic-name>${project.groupId}.server</bundle-symbolic-name>
- </properties>
+ <properties>
+ <bundle-symbolic-name>${project.groupId}.server</bundle-symbolic-name>
+ </properties>
- <build>
- <plugins>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.fcgi</groupId>
- <artifactId>fcgi-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-proxy</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <build>
+ <plugins>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.fcgi</groupId>
+ <artifactId>fcgi-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-proxy</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.http2</groupId>
+ <artifactId>http2-server</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-alpn-server</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-annotations</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalSPDYFastCGIProxyServer.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalSPDYFastCGIProxyServer.java
index 948997d443..5043ab5c2f 100644
--- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalSPDYFastCGIProxyServer.java
+++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/DrupalSPDYFastCGIProxyServer.java
@@ -21,14 +21,19 @@ package org.eclipse.jetty.fcgi.server.proxy;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
+import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
+import org.eclipse.jetty.server.ForwardedRequestCustomizer;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
+import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
+import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector;
-import org.eclipse.jetty.spdy.server.http.PushStrategy;
-import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
import org.eclipse.jetty.util.ssl.SslContextFactory;
public class DrupalSPDYFastCGIProxyServer
@@ -44,11 +49,26 @@ public class DrupalSPDYFastCGIProxyServer
Server server = new Server();
- Map<Short, PushStrategy> pushStrategies = new HashMap<>();
- pushStrategies.put(SPDY.V3, new ReferrerPushStrategy());
- HTTPSPDYServerConnector connector = new HTTPSPDYServerConnector(server, sslContextFactory, pushStrategies);
- connector.setPort(8443);
- server.addConnector(connector);
+ // HTTP(S) Configuration
+ HttpConfiguration config = new HttpConfiguration();
+ HttpConfiguration https_config = new HttpConfiguration(config);
+ https_config.addCustomizer(new SecureRequestCustomizer());
+
+ // HTTP2 factory
+ HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(https_config);
+ NegotiatingServerConnectionFactory.checkProtocolNegotiationAvailable();
+ ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory();
+ alpn.setDefaultProtocol(h2.getProtocol());
+
+ // SSL Factory
+ SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,alpn.getProtocol());
+
+ // HTTP2 Connector
+ ServerConnector http2Connector =
+ new ServerConnector(server,ssl,alpn,h2,new HttpConnectionFactory(https_config));
+ http2Connector.setPort(8443);
+ http2Connector.setIdleTimeout(15000);
+ server.addConnector(http2Connector);
// Drupal seems to only work on the root context,
// at least out of the box without additional plugins
diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressSPDYFastCGIProxyServer.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressSPDYFastCGIProxyServer.java
index 39ff74567b..9020572e1a 100644
--- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressSPDYFastCGIProxyServer.java
+++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/proxy/WordPressSPDYFastCGIProxyServer.java
@@ -19,20 +19,22 @@
package org.eclipse.jetty.fcgi.server.proxy;
import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
import javax.servlet.DispatcherType;
+import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
+import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
+import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
+import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector;
-import org.eclipse.jetty.spdy.server.http.PushStrategy;
-import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
import org.eclipse.jetty.util.ssl.SslContextFactory;
public class WordPressSPDYFastCGIProxyServer
@@ -51,14 +53,26 @@ public class WordPressSPDYFastCGIProxyServer
Server server = new Server();
- Map<Short, PushStrategy> pushStrategies = new HashMap<>();
- pushStrategies.put(SPDY.V3, new ReferrerPushStrategy());
- HTTPSPDYServerConnector tlsConnector = new HTTPSPDYServerConnector(server, sslContextFactory, pushStrategies);
- tlsConnector.setPort(tlsPort);
- server.addConnector(tlsConnector);
- HTTPSPDYServerConnector connector = new HTTPSPDYServerConnector(server, null, pushStrategies);
- connector.setPort(port);
- server.addConnector(connector);
+ // HTTP(S) Configuration
+ HttpConfiguration config = new HttpConfiguration();
+ HttpConfiguration https_config = new HttpConfiguration(config);
+ https_config.addCustomizer(new SecureRequestCustomizer());
+
+ // HTTP2 factory
+ HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(https_config);
+ NegotiatingServerConnectionFactory.checkProtocolNegotiationAvailable();
+ ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory();
+ alpn.setDefaultProtocol(h2.getProtocol());
+
+ // SSL Factory
+ SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,alpn.getProtocol());
+
+ // HTTP2 Connector
+ ServerConnector http2Connector =
+ new ServerConnector(server,ssl,alpn,h2,new HttpConnectionFactory(https_config));
+ http2Connector.setPort(tlsPort);
+ http2Connector.setIdleTimeout(15000);
+ server.addConnector(http2Connector);
String root = "/home/simon/programs/wordpress-3.7.1";
diff --git a/jetty-npn/jetty-npn-client/pom.xml b/jetty-npn/jetty-npn-client/pom.xml
deleted file mode 100644
index 1a7b8d67e4..0000000000
--- a/jetty-npn/jetty-npn-client/pom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-npn-parent</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jetty-npn-client</artifactId>
- <name>Jetty :: NPN :: Client</name>
- <properties>
- <bundle-symbolic-name>${project.groupId}.npn.client</bundle-symbolic-name>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <executions>
- <execution>
- <goals>
- <goal>manifest</goal>
- </goals>
- <configuration>
- <instructions>
- <Import-Package>org.eclipse.jetty.npn;resolution:=optional</Import-Package>
- </instructions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
- with a snapshot. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <onlyAnalyze>org.eclipse.jetty.npn.*</onlyAnalyze>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-io</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.npn</groupId>
- <artifactId>npn-api</artifactId>
- <version>${npn.api.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.toolchain</groupId>
- <artifactId>jetty-test-helper</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnection.java b/jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnection.java
deleted file mode 100644
index 776ed279e9..0000000000
--- a/jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnection.java
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.npn.client;
-
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Executor;
-import javax.net.ssl.SSLEngine;
-
-import org.eclipse.jetty.io.ClientConnectionFactory;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.NegotiatingClientConnection;
-import org.eclipse.jetty.npn.NextProtoNego;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-
-public class NPNClientConnection extends NegotiatingClientConnection implements NextProtoNego.ClientProvider
-{
- private static final Logger LOG = Log.getLogger(NPNClientConnection.class);
-
- private final String protocol;
-
- public NPNClientConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, SSLEngine sslEngine, Map<String, Object> context, String protocol)
- {
- super(endPoint, executor, sslEngine, connectionFactory, context);
- this.protocol = protocol;
- NextProtoNego.put(sslEngine, this);
- }
-
- @Override
- public boolean supports()
- {
- return true;
- }
-
- @Override
- public void unsupported()
- {
- NextProtoNego.remove(getSSLEngine());
- completed();
- }
-
- @Override
- public String selectProtocol(List<String> protocols)
- {
- if (protocols.contains(protocol))
- {
- NextProtoNego.remove(getSSLEngine());
- completed();
- return protocol;
- }
- else
- {
- LOG.info("Could not negotiate protocol: server {} - client {}", protocols, protocol);
- close();
- return null;
- }
- }
-
- @Override
- public void close()
- {
- NextProtoNego.remove(getSSLEngine());
- super.close();
- }
-}
diff --git a/jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnectionFactory.java b/jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnectionFactory.java
deleted file mode 100644
index 95003479d1..0000000000
--- a/jetty-npn/jetty-npn-client/src/main/java/org/eclipse/jetty/npn/client/NPNClientConnectionFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.npn.client;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.Executor;
-import javax.net.ssl.SSLEngine;
-
-import org.eclipse.jetty.io.ClientConnectionFactory;
-import org.eclipse.jetty.io.Connection;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.NegotiatingClientConnectionFactory;
-import org.eclipse.jetty.io.ssl.SslClientConnectionFactory;
-
-public class NPNClientConnectionFactory extends NegotiatingClientConnectionFactory
-{
- private final Executor executor;
- private final String protocol;
-
- public NPNClientConnectionFactory(Executor executor, ClientConnectionFactory connectionFactory, String protocol)
- {
- super(connectionFactory);
- this.executor = executor;
- this.protocol = protocol;
- }
-
- @Override
- public Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException
- {
- return new NPNClientConnection(endPoint, executor, getClientConnectionFactory(),
- (SSLEngine)context.get(SslClientConnectionFactory.SSL_ENGINE_CONTEXT_KEY), context, protocol);
- }
-}
diff --git a/jetty-npn/jetty-npn-server/pom.xml b/jetty-npn/jetty-npn-server/pom.xml
deleted file mode 100644
index 7f0590f14a..0000000000
--- a/jetty-npn/jetty-npn-server/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-npn-parent</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jetty-npn-server</artifactId>
- <name>Jetty :: NPN :: Server</name>
- <properties>
- <bundle-symbolic-name>${project.groupId}.npn.server</bundle-symbolic-name>
- </properties>
- <build>
- <plugins>
- <!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
- with a snapshot. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <onlyAnalyze>org.eclipse.jetty.npn.*</onlyAnalyze>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.npn</groupId>
- <artifactId>npn-api</artifactId>
- <version>${npn.api.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-start</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.toolchain</groupId>
- <artifactId>jetty-test-helper</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml b/jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml
deleted file mode 100644
index ef887d10e3..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
-
-
-<Configure id="sslConnector" class="org.eclipse.jetty.server.ServerConnector">
-
- <Call name="addConnectionFactory">
- <Arg>
- <New class="org.eclipse.jetty.server.SslConnectionFactory">
- <Arg name="next"><Property name="protonego"/></Arg>
- <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
- </New>
- </Arg>
- </Call>
-
- <Call name="addConnectionFactory">
- <Arg>
- <New id="protonego" class="org.eclipse.jetty.npn.server.NPNServerConnectionFactory">
- <Arg type="String">
- <Property name="npn.protocols" default="" />
- </Arg>
- <Set name="defaultProtocol">
- <Property name="npn.defaultProtocol" />
- </Set>
- </New>
- </Arg>
- </Call>
-
- <!-- Enables NPN debugging on System.err -->
- <!--<Set class="org.eclipse.jetty.npn.NextProtoNego" name="debug" type="boolean">true</Set>-->
-
-</Configure>
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod
deleted file mode 100644
index 33818620f7..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.0.v20120525|lib/npn/npn-boot-1.1.0.v20120525.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod
deleted file mode 100644
index 33818620f7..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.0.v20120525|lib/npn/npn-boot-1.1.0.v20120525.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod
deleted file mode 100644
index 85ee092666..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.1.v20121030|lib/npn/npn-boot-1.1.1.v20121030.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod
deleted file mode 100644
index 85ee092666..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.1.v20121030|lib/npn/npn-boot-1.1.1.v20121030.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod
deleted file mode 100644
index 8d26767f2e..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.3.v20130313|lib/npn/npn-boot-1.1.3.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod
deleted file mode 100644
index 8d26767f2e..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.3.v20130313|lib/npn/npn-boot-1.1.3.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod
deleted file mode 100644
index 8d26767f2e..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.3.v20130313|lib/npn/npn-boot-1.1.3.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod
deleted file mode 100644
index 087b1b162f..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.4.v20130313|lib/npn/npn-boot-1.1.4.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod
deleted file mode 100644
index 9dd5dee3f0..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.5.v20130313|lib/npn/npn-boot-1.1.5.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod
deleted file mode 100644
index 9dd5dee3f0..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.5.v20130313|lib/npn/npn-boot-1.1.5.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod
deleted file mode 100644
index 9dd5dee3f0..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.5.v20130313|lib/npn/npn-boot-1.1.5.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod
deleted file mode 100644
index 9dd5dee3f0..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.5.v20130313|lib/npn/npn-boot-1.1.5.v20130313.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod
deleted file mode 100644
index d4ac51c287..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.6.v20130911|lib/npn/npn-boot-1.1.6.v20130911.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod
deleted file mode 100644
index d4ac51c287..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.6.v20130911|lib/npn/npn-boot-1.1.6.v20130911.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod
deleted file mode 100644
index d4ac51c287..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.6.v20130911|lib/npn/npn-boot-1.1.6.v20130911.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod
deleted file mode 100644
index 5864904e15..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.8.v20141013|lib/npn/npn-boot-1.1.8.v20141013.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod
deleted file mode 100644
index 5864904e15..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.8.v20141013|lib/npn/npn-boot-1.1.8.v20141013.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod
deleted file mode 100644
index 5864904e15..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.8.v20141013|lib/npn/npn-boot-1.1.8.v20141013.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod
deleted file mode 100644
index 5864904e15..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.8.v20141013|lib/npn/npn-boot-1.1.8.v20141013.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod
deleted file mode 100644
index b22aa5aaf8..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.9.v20141016|lib/npn/npn-boot-1.1.9.v20141016.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.9.v20141016.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod
deleted file mode 100644
index b22aa5aaf8..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.9.v20141016|lib/npn/npn-boot-1.1.9.v20141016.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.9.v20141016.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod
deleted file mode 100644
index c709dde7ee..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.10.v20150130|lib/npn/npn-boot-1.1.10.v20150130.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod
deleted file mode 100644
index c709dde7ee..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-[name]
-protonego-boot
-
-[files]
-maven://org.mortbay.jetty.npn/npn-boot/1.1.10.v20150130|lib/npn/npn-boot-1.1.10.v20150130.jar
-
-[exec]
--Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar
diff --git a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn.mod b/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn.mod
deleted file mode 100644
index 45d99ab031..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/config/modules/protonego-impl/npn.mod
+++ /dev/null
@@ -1,38 +0,0 @@
-# NPN is provided via a -Xbootclasspath that modifies the secure connections
-# in java to support the NPN layer needed for SPDY.
-#
-# This modification has a tight dependency on specific updates of Java 1.7.
-# (No support for Java 8 exists for npn / npn-boot, use alpn instead)
-#
-# The npn module will use an appropriate npn-boot jar for your specific
-# version of Java.
-#
-# IMPORTANT: Versions of Java that exist after this module was created are
-# not guaranteed to work with existing npn-boot jars, and might
-# need a new npn-boot to be created / tested / deployed by the
-# Jetty project in order to provide support for these future
-# Java versions.
-#
-# All versions of npn-boot can be found at
-# http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/
-
-
-[name]
-protonego-impl
-
-[depend]
-protonego-impl/npn-${java.version}
-
-[lib]
-lib/jetty-npn-client-${jetty.version}.jar
-lib/jetty-npn-server-${jetty.version}.jar
-
-[files]
-lib/
-lib/npn/
-
-[license]
-NPN is a hosted at github under the GPL v2 with ClassPath Exception.
-NPN replaces/modifies OpenJDK classes in the java.sun.security.ssl package.
-http://github.com/jetty-project/jetty-npn
-http://openjdk.java.net/legal/gplv2+ce.html
diff --git a/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnection.java b/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnection.java
deleted file mode 100644
index ce0ab4e42b..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnection.java
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.npn.server;
-
-import java.util.List;
-import javax.net.ssl.SSLEngine;
-
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.npn.NextProtoNego;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.NegotiatingServerConnection;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-
-public class NPNServerConnection extends NegotiatingServerConnection implements NextProtoNego.ServerProvider
-{
- private static final Logger LOG = Log.getLogger(NPNServerConnection.class);
-
- public NPNServerConnection(EndPoint endPoint, SSLEngine engine, Connector connector, List<String> protocols, String defaultProtocol)
- {
- super(connector, endPoint, engine, protocols, defaultProtocol);
- NextProtoNego.put(engine, this);
- }
-
- @Override
- public void unsupported()
- {
- protocolSelected(getDefaultProtocol());
- }
-
- @Override
- public List<String> protocols()
- {
- return getProtocols();
- }
-
- @Override
- public void protocolSelected(String protocol)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("{} protocol selected {}", this, protocol);
- setProtocol(protocol != null ? protocol : getDefaultProtocol());
- NextProtoNego.remove(getSSLEngine());
- }
-
- @Override
- public void close()
- {
- NextProtoNego.remove(getSSLEngine());
- super.close();
- }
-}
diff --git a/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java b/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java
deleted file mode 100644
index 6c66332a05..0000000000
--- a/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.npn.server;
-
-import java.util.List;
-import javax.net.ssl.SSLEngine;
-
-import org.eclipse.jetty.io.AbstractConnection;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.npn.NextProtoNego;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
-import org.eclipse.jetty.util.annotation.Name;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-
-public class NPNServerConnectionFactory extends NegotiatingServerConnectionFactory
-{
- private static final Logger LOG = Log.getLogger(NPNServerConnectionFactory.class);
-
- public NPNServerConnectionFactory(String protocols)
- {
- this(protocols.trim().split(",", 0));
- }
-
- public NPNServerConnectionFactory(@Name("protocols") String... protocols)
- {
- super("npn", protocols);
- try
- {
- ClassLoader npnClassLoader = NextProtoNego.class.getClassLoader();
- if (npnClassLoader != null)
- {
- LOG.warn("NPN must be in the boot classloader, not in: " + npnClassLoader);
- throw new IllegalStateException("NPN must be in the boot classloader");
- }
- }
- catch (Throwable x)
- {
- LOG.warn("NPN not available: " + x);
- throw new IllegalStateException("NPN not available", x);
- }
- }
-
- @Override
- protected AbstractConnection newServerConnection(Connector connector, EndPoint endPoint, SSLEngine engine, List<String> protocols, String defaultProtocol)
- {
- return new NPNServerConnection(endPoint, engine, connector, protocols, defaultProtocol);
- }
-}
diff --git a/jetty-npn/jetty-npn-server/src/test/java/org/eclipse/jetty/npn/server/NPNModuleTest.java b/jetty-npn/jetty-npn-server/src/test/java/org/eclipse/jetty/npn/server/NPNModuleTest.java
deleted file mode 100644
index 511553df5a..0000000000
--- a/jetty-npn/jetty-npn-server/src/test/java/org/eclipse/jetty/npn/server/NPNModuleTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.npn.server;
-
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.eclipse.jetty.start.BaseHome;
-import org.eclipse.jetty.start.FileArg;
-import org.eclipse.jetty.start.Module;
-import org.eclipse.jetty.toolchain.test.FS;
-import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameter;
-import org.junit.runners.Parameterized.Parameters;
-
-@RunWith(Parameterized.class)
-public class NPNModuleTest
-{
- @Parameters(name = "{index}: mod:{0}")
- public static List<Object[]> data()
- {
- File npnBootModDir = MavenTestingUtils.getProjectDir("src/main/config/modules/protonego-impl");
- List<Object[]> data = new ArrayList<>();
- for (File file : npnBootModDir.listFiles())
- {
- if (Pattern.matches("npn-.*\\.mod",file.getName()))
- {
- data.add(new Object[] { file.getName() });
- }
- }
- return data;
- }
-
- @Parameter(value = 0)
- public String modBootFile;
-
- private static BaseHome basehome;
-
- @BeforeClass
- public static void initBaseHome() throws IOException
- {
- File homeDir = MavenTestingUtils.getProjectDir("src/main/config");
- File baseDir = MavenTestingUtils.getTargetTestingDir(NPNModuleTest.class.getName());
- FS.ensureEmpty(baseDir);
-
- String cmdLine[] = { "jetty.home="+homeDir.getAbsolutePath(),"jetty.base="+baseDir.getAbsolutePath() };
- basehome = new BaseHome(cmdLine);
- }
-
- /**
- * Check the sanity of the npn-boot file module
- */
- @Test
- public void testModuleValues() throws IOException
- {
- Path modFile = basehome.getPath("modules/protonego-impl/" + modBootFile);
- Module mod = new Module(basehome,modFile);
- assertNotNull("module",mod);
-
- // Validate logical name
- assertThat("Module name",mod.getName(),is("protonego-boot"));
-
- List<String> expectedBootClasspath = new ArrayList<>();
-
- for (String line : mod.getFiles())
- {
- FileArg farg = new FileArg(line);
- if (farg.uri != null)
- {
- assertThat("NPN URL", farg.uri, startsWith("maven://org.mortbay.jetty.npn/npn-boot/"));
- expectedBootClasspath.add("-Xbootclasspath/p:" + farg.location);
- }
- }
-
- for (String line : mod.getJvmArgs())
- {
- expectedBootClasspath.remove(line);
- }
-
- if (expectedBootClasspath.size() > 0)
- {
- StringBuilder err = new StringBuilder();
- err.append("XBootClasspath mismatch between [files] and [exec]");
- err.append("\nThe following are inferred from your [files] definition in ");
- err.append(modFile.toAbsolutePath().toString());
- err.append("\nbut are not referenced in your [exec] section");
- for (String entry : expectedBootClasspath)
- {
- err.append("\n").append(entry);
- }
- fail(err.toString());
- }
- }
-}
diff --git a/jetty-npn/pom.xml b/jetty-npn/pom.xml
deleted file mode 100644
index da0f55fe1e..0000000000
--- a/jetty-npn/pom.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-project</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jetty-npn-parent</artifactId>
- <packaging>pom</packaging>
- <name>Jetty :: NPN :: Parent</name>
- <modules>
- <module>jetty-npn-server</module>
- <module>jetty-npn-client</module>
- </modules>
-</project>
diff --git a/jetty-osgi/jetty-osgi-npn/pom.xml b/jetty-osgi/jetty-osgi-npn/pom.xml
deleted file mode 100644
index 265351b835..0000000000
--- a/jetty-osgi/jetty-osgi-npn/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.eclipse.jetty.osgi</groupId>
- <artifactId>jetty-osgi-project</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jetty-osgi-npn</artifactId>
- <name>Jetty :: OSGi NPN Fragment</name>
- <packaging>jar</packaging>
- <properties>
- <bundle-symbolic-name>org.eclipse.jetty.osgi.npn.fragment</bundle-symbolic-name>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${bundle-symbolic-name};singleton:=true</Bundle-SymbolicName>
- <Bundle-Name>Jetty OSGi NPN Fragment</Bundle-Name>
- <Bundle-Description>${project.name}</Bundle-Description>
- <Import-Package>!javax.*,!org.eclipse.jetty.*</Import-Package>
- <Export-Package>org.eclipse.jetty.npn;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</Export-Package>
- <Fragment-Host>system.bundle;extension:=framework</Fragment-Host>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jetty.npn</groupId>
- <artifactId>npn-api</artifactId>
- <version>${npn.api.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml
index 02bd25f8d1..b61ff46e69 100644
--- a/jetty-osgi/pom.xml
+++ b/jetty-osgi/pom.xml
@@ -25,20 +25,9 @@
<module>jetty-osgi-httpservice</module>
<module>test-jetty-osgi-webapp</module>
<module>test-jetty-osgi-context</module>
- <module>test-jetty-osgi</module>
<module>jetty-osgi-alpn</module>
+ <!-- TODO fix this module>test-jetty-osgi</module -->
</modules>
- <profiles>
- <profile>
- <id>npn</id>
- <activation>
- <jdk>1.7</jdk>
- </activation>
- <modules>
- <module>jetty-osgi-npn</module>
- </modules>
- </profile>
- </profiles>
<build>
<resources>
<resource>
diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml
index 23dcdcaf6e..f056f29841 100644
--- a/jetty-osgi/test-jetty-osgi/pom.xml
+++ b/jetty-osgi/test-jetty-osgi/pom.xml
@@ -11,7 +11,7 @@
<description>Jetty OSGi Integration test</description>
<url>http://www.eclipse.org/jetty</url>
<properties>
- <bundle-symbolic-name>${project.groupId}.boot.test.spdy</bundle-symbolic-name>
+ <bundle-symbolic-name>${project.groupId}.boot.test.osgi</bundle-symbolic-name>
<jetty-orbit-url>http://download.eclipse.org/jetty/orbit/</jetty-orbit-url>
<assembly-directory>target/distribution</assembly-directory>
<exam.version>3.5.0</exam.version>
@@ -35,7 +35,7 @@
</dependency>
- <!-- use the forked container so we can pass it system properties eg for npn/alpn -->
+ <!-- use the forked container so we can pass it system properties eg for alpn -->
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-forked</artifactId>
@@ -279,28 +279,9 @@
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-core</artifactId>
+ <groupId>org.eclipse.jetty.http2</groupId>
+ <artifactId>http2-server</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-client</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty.alpn</groupId>
diff --git a/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties b/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties
index 5250a08562..147cf004df 100644
--- a/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties
+++ b/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties
@@ -1,2 +1 @@
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
-org.eclipse.jetty.spdy.LEVEL=WARN
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml
deleted file mode 100644
index a0e9d1a11b..0000000000
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
-
-<!-- ============================================================= -->
-<!-- Configure a SPDY on the ssl connector. -->
-<!-- ============================================================= -->
-<Configure id="sslConnector" class="org.eclipse.jetty.server.ServerConnector">
-
- <!-- =========================================================== -->
- <!-- Create a push strategy which can be used by reference by -->
- <!-- individual connection factories below. -->
- <!-- -->
- <!-- Consult the javadoc of o.e.j.spdy.server.http.ReferrerPushStrategy -->
- <!-- for all configuration that may be set here. -->
- <!-- =========================================================== -->
-
- <!-- SPDY/3 Connection factory -->
- <Call name="addConnectionFactory">
- <Arg>
- <New class="org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnectionFactory">
- <Arg name="version" type="int">3</Arg>
- <Arg name="config"><Ref refid="sslHttpConfig"/></Arg>
- <!-- Set the initial window size for this SPDY connector. -->
- <!-- See: http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3#TOC-2.6.8-WINDOW_UPDATE -->
- <Set name="initialWindowSize"><Property name="spdy.initialWindowSize" default="65536"/></Set>
- <!-- Uncomment to enable ReferrerPushStrategy -->
- <!--<Arg name="pushStrategy"><Ref refid="pushStrategy"/></Arg>-->
- </New>
- </Arg>
- </Call>
-
-</Configure>
diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml
index 1014c8507a..ef65019001 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml
+++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-ssl.xml
@@ -4,7 +4,7 @@
<!-- ============================================================= -->
<!-- Base SSL configuration -->
<!-- This configuration needs to be used together with 1 or more -->
-<!-- of jetty-https.xml, jetty-spdy.xml and/or jetty-http2.xml -->
+<!-- of jetty-https.xml and/or jetty-http2.xml -->
<!-- ============================================================= -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java
index 715b5a9ba1..c0331cbe37 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java
@@ -41,11 +41,11 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
/**
- * SPDY setup.
+ * HTTP2 setup.
*/
@RunWith(PaxExam.class)
//@Ignore
-public class TestJettyOSGiBootSpdy
+public class TestJettyOSGiBootHTTP2
{
private static final String LOG_LEVEL = "WARN";
@@ -57,9 +57,9 @@ public class TestJettyOSGiBootSpdy
public Option[] config()
{
ArrayList<Option> options = new ArrayList<Option>();
- options.addAll(TestJettyOSGiBootWithJsp.configureJettyHomeAndPort(true,"jetty-spdy.xml"));
+ options.addAll(TestJettyOSGiBootWithJsp.configureJettyHomeAndPort(true,"jetty-http2.xml"));
options.addAll(TestJettyOSGiBootCore.coreJettyDependencies());
- options.addAll(spdyJettyDependencies());
+ options.addAll(http2JettyDependencies());
options.add(CoreOptions.junitBundles());
options.addAll(TestJettyOSGiBootCore.httpServiceJetty());
options.addAll(Arrays.asList(options(systemProperty("pax.exam.logging").value("none"))));
@@ -74,7 +74,7 @@ public class TestJettyOSGiBootSpdy
return options.toArray(new Option[options.size()]);
}
- public static List<Option> spdyJettyDependencies()
+ public static List<Option> http2JettyDependencies()
{
List<Option> res = new ArrayList<Option>();
res.add(CoreOptions.systemProperty("jetty.port").value(String.valueOf(TestJettyOSGiBootCore.DEFAULT_HTTP_PORT)));
@@ -90,11 +90,9 @@ public class TestJettyOSGiBootSpdy
res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-alpn").versionAsInProject().noStart());
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-server").versionAsInProject().start());
- res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-core").versionAsInProject().noStart());
- res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-client").versionAsInProject().start());
- res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-server").versionAsInProject().noStart());
- res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-http-common").versionAsInProject().noStart());
- res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-http-server").versionAsInProject().noStart());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.http2").artifactId("http2-hpack").versionAsInProject().noStart());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.http2").artifactId("http2-common").versionAsInProject().noStart());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.http2").artifactId("http2-server").versionAsInProject().noStart());
return res;
}
@@ -115,7 +113,7 @@ public class TestJettyOSGiBootSpdy
}
@Test
- public void testSpdyOnHttpService() throws Exception
+ public void testHTTP2OnHttpService() throws Exception
{
// TestOSGiUtil.debugBundles(bundleContext);
// Thread.sleep(2000000000);
diff --git a/jetty-spdy/pom.xml b/jetty-spdy/pom.xml
deleted file mode 100644
index 83eee34920..0000000000
--- a/jetty-spdy/pom.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-project</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-parent</artifactId>
- <packaging>pom</packaging>
- <name>Jetty :: SPDY :: Parent</name>
- <url>http://www.eclipse.org/jetty</url>
-
- <modules>
- <module>spdy-core</module>
- <module>spdy-client</module>
- <module>spdy-server</module>
- <module>spdy-http-common</module>
- <module>spdy-http-server</module>
- <module>spdy-http-client-transport</module>
- <module>spdy-example-webapp</module>
- <module>spdy-alpn-tests</module>
- </modules>
-
- <profiles>
- <profile>
- <id>npn</id>
- <activation>
- <jdk>1.7</jdk>
- </activation>
- <modules>
- <module>spdy-npn-tests</module>
- </modules>
- </profile>
- </profiles>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-pmd-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <executions>
- <execution>
- <goals>
- <goal>manifest</goal>
- </goals>
- <configuration>
- <instructions>
- <Import-Package>org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package>
- <_nouses>true</_nouses>
- </instructions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jetty.toolchain</groupId>
- <artifactId>jetty-test-helper</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/jetty-spdy/spdy-alpn-tests/pom.xml b/jetty-spdy/spdy-alpn-tests/pom.xml
deleted file mode 100644
index 1c0b55f254..0000000000
--- a/jetty-spdy/spdy-alpn-tests/pom.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-parent</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>spdy-alpn-tests</artifactId>
- <name>Jetty :: SPDY :: ALPN Tests</name>
- <properties>
- <bundle-symbolic-name>${project.groupId}.alpn.tests</bundle-symbolic-name>
- </properties>
-
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.mortbay.jetty.alpn</groupId>
- <artifactId>alpn-boot</artifactId>
- <version>${alpn.version}</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- <outputDirectory>${project.build.directory}/alpn</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Xbootclasspath/p:${project.build.directory}/alpn/alpn-boot-${alpn.version}.jar</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jetty.alpn</groupId>
- <artifactId>alpn-api</artifactId>
- <version>${alpn.api.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-alpn-server</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-http-server</artifactId>
- <version>${project.version}</version>
- <classifier>tests</classifier>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNNegotiationTest.java b/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNNegotiationTest.java
deleted file mode 100644
index a7ea9c2ccd..0000000000
--- a/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNNegotiationTest.java
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.server;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.List;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
-
-import org.eclipse.jetty.alpn.ALPN;
-import org.eclipse.jetty.server.HttpConnectionFactory;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class ALPNNegotiationTest extends AbstractALPNTest
-{
- @Test
- public void testClientAdvertisingHTTPServerSpeaksHTTP() throws Exception
- {
- InetSocketAddress address = prepare();
- connector.addConnectionFactory(new HttpConnectionFactory());
-
- SslContextFactory sslContextFactory = newSslContextFactory();
- sslContextFactory.start();
- SSLContext sslContext = sslContextFactory.getSslContext();
-
- try (SSLSocket client = (SSLSocket)sslContext.getSocketFactory().createSocket(address.getAddress(), address.getPort()))
- {
- client.setUseClientMode(true);
- client.setSoTimeout(5000);
-
- ALPN.put(client, new ALPN.ClientProvider()
- {
- @Override
- public void unsupported()
- {
- }
-
- @Override
- public List<String> protocols()
- {
- return Arrays.asList("http/1.1");
- }
-
- @Override
- public void selected(String protocol)
- {
- Assert.assertEquals("http/1.1", protocol);
- }
- });
-
- client.startHandshake();
-
- // Verify that the server really speaks http/1.1
-
- OutputStream output = client.getOutputStream();
- output.write(("" +
- "GET / HTTP/1.1\r\n" +
- "Host: localhost:" + address.getPort() + "\r\n" +
- "\r\n" +
- "").getBytes(StandardCharsets.UTF_8));
- output.flush();
-
- InputStream input = client.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
- String line = reader.readLine();
- Assert.assertTrue(line.contains(" 404 "));
- }
- }
-
- @Test
- public void testClientAdvertisingMultipleProtocolsServerSpeaksHTTPWhenNegotiated() throws Exception
- {
- InetSocketAddress address = prepare();
- connector.addConnectionFactory(new HttpConnectionFactory());
-
- SslContextFactory sslContextFactory = newSslContextFactory();
- sslContextFactory.start();
- SSLContext sslContext = sslContextFactory.getSslContext();
- try (SSLSocket client = (SSLSocket)sslContext.getSocketFactory().createSocket(address.getAddress(), address.getPort()))
- {
- client.setUseClientMode(true);
- client.setSoTimeout(5000);
-
- ALPN.put(client, new ALPN.ClientProvider()
- {
- @Override
- public void unsupported()
- {
- }
-
- @Override
- public List<String> protocols()
- {
- return Arrays.asList("unknown/1.0", "http/1.1");
- }
-
- @Override
- public void selected(String protocol)
- {
- Assert.assertEquals("http/1.1", protocol.toLowerCase());
- }
- });
-
- client.startHandshake();
-
- // Verify that the server really speaks http/1.1
-
- OutputStream output = client.getOutputStream();
- output.write(("" +
- "GET / HTTP/1.1\r\n" +
- "Host: localhost:" + address.getPort() + "\r\n" +
- "\r\n" +
- "").getBytes(StandardCharsets.UTF_8));
- output.flush();
-
- InputStream input = client.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
- String line = reader.readLine();
- Assert.assertTrue(line.contains(" 404 "));
- }
- }
-
- @Test
- public void testClientNotSupportingALPNServerSpeaksDefaultProtocol() throws Exception
- {
- InetSocketAddress address = prepare();
- connector.addConnectionFactory(new HttpConnectionFactory());
-
- SslContextFactory sslContextFactory = newSslContextFactory();
- sslContextFactory.start();
- SSLContext sslContext = sslContextFactory.getSslContext();
- try (SSLSocket client = (SSLSocket)sslContext.getSocketFactory().createSocket(address.getAddress(), address.getPort()))
- {
- client.setUseClientMode(true);
- client.setSoTimeout(5000);
-
- ALPN.put(client, new ALPN.ClientProvider()
- {
- @Override
- public void unsupported()
- {
- }
-
- @Override
- public List<String> protocols()
- {
- return null;
- }
-
- @Override
- public void selected(String s)
- {
- }
- });
-
- client.startHandshake();
-
- // Verify that the server really speaks http/1.1
-
- OutputStream output = client.getOutputStream();
- output.write(("" +
- "GET / HTTP/1.1\r\n" +
- "Host: localhost:" + address.getPort() + "\r\n" +
- "\r\n" +
- "").getBytes(StandardCharsets.UTF_8));
- output.flush();
-
- InputStream input = client.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8));
- String line = reader.readLine();
- Assert.assertTrue(line.contains(" 404 "));
- }
- }
-}
diff --git a/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNSynReplyTest.java b/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNSynReplyTest.java
deleted file mode 100644
index 5360dfeafe..0000000000
--- a/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/ALPNSynReplyTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.server;
-
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-import java.util.Arrays;
-import java.util.List;
-import javax.net.ssl.SSLEngine;
-
-import org.eclipse.jetty.alpn.ALPN;
-import org.eclipse.jetty.util.BufferUtil;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class ALPNSynReplyTest extends AbstractALPNTest
-{
- @Test
- public void testGentleCloseDuringHandshake() throws Exception
- {
- InetSocketAddress address = prepare();
- SslContextFactory sslContextFactory = newSslContextFactory();
- sslContextFactory.start();
- SSLEngine sslEngine = sslContextFactory.newSSLEngine(address);
- sslEngine.setUseClientMode(true);
- ALPN.put(sslEngine, new ALPN.ClientProvider()
- {
- @Override
- public void unsupported()
- {
- }
-
- @Override
- public List<String> protocols()
- {
- return Arrays.asList("http/1.1");
- }
-
- @Override
- public void selected(String protocol)
- {
- }
- });
- sslEngine.beginHandshake();
-
- ByteBuffer encrypted = ByteBuffer.allocate(sslEngine.getSession().getPacketBufferSize());
- sslEngine.wrap(BufferUtil.EMPTY_BUFFER, encrypted);
- encrypted.flip();
-
- try (SocketChannel channel = SocketChannel.open(address))
- {
- // Send ClientHello, immediately followed by TLS Close Alert and then by FIN
- channel.write(encrypted);
- sslEngine.closeOutbound();
- encrypted.clear();
- sslEngine.wrap(BufferUtil.EMPTY_BUFFER, encrypted);
- encrypted.flip();
- channel.write(encrypted);
- channel.shutdownOutput();
-
- // Read ServerHello from server
- encrypted.clear();
- int read = channel.read(encrypted);
- encrypted.flip();
- Assert.assertTrue(read > 0);
- // Cannot decrypt, as the SSLEngine has been already closed
-
- // Now if we read more, we should either read the TLS Close Alert, or directly -1
- encrypted.clear();
- read = channel.read(encrypted);
- // Sending a TLS Close Alert during handshake results in an exception when
- // unwrapping that the server react to by closing the connection abruptly.
- Assert.assertTrue(read < 0);
- }
- }
-
- @Test
- public void testAbruptCloseDuringHandshake() throws Exception
- {
- InetSocketAddress address = prepare();
- SslContextFactory sslContextFactory = newSslContextFactory();
- sslContextFactory.start();
- SSLEngine sslEngine = sslContextFactory.newSSLEngine(address);
- sslEngine.setUseClientMode(true);
- ALPN.put(sslEngine, new ALPN.ClientProvider()
- {
- @Override
- public void unsupported()
- {
- }
-
- @Override
- public List<String> protocols()
- {
- return Arrays.asList("http/1.1");
- }
-
- @Override
- public void selected(String s)
- {
- }
- });
- sslEngine.beginHandshake();
-
- ByteBuffer encrypted = ByteBuffer.allocate(sslEngine.getSession().getPacketBufferSize());
- sslEngine.wrap(BufferUtil.EMPTY_BUFFER, encrypted);
- encrypted.flip();
-
- try (SocketChannel channel = SocketChannel.open(address))
- {
- // Send ClientHello, immediately followed by FIN (no TLS Close Alert)
- channel.write(encrypted);
- channel.shutdownOutput();
-
- // Read ServerHello from server
- encrypted.clear();
- int read = channel.read(encrypted);
- encrypted.flip();
- Assert.assertTrue(read > 0);
- ByteBuffer decrypted = ByteBuffer.allocate(sslEngine.getSession().getApplicationBufferSize());
- sslEngine.unwrap(encrypted, decrypted);
-
- // Now if we read more, we should either read the TLS Close Alert, or directly -1
- encrypted.clear();
- read = channel.read(encrypted);
- // Since we have close the connection abruptly, the server also does so
- Assert.assertTrue(read < 0);
- }
- }
-}
diff --git a/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/AbstractALPNTest.java b/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/AbstractALPNTest.java
deleted file mode 100644
index 48d046d503..0000000000
--- a/jetty-spdy/spdy-alpn-tests/src/test/java/org/eclipse/jetty/spdy/server/AbstractALPNTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.server;
-
-import java.net.InetSocketAddress;
-
-import org.eclipse.jetty.alpn.ALPN;
-import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.spdy.client.SPDYClient;
-import org.eclipse.jetty.toolchain.test.TestTracker;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.util.thread.QueuedThreadPool;
-import org.junit.After;
-import org.junit.Rule;
-
-public class AbstractALPNTest
-{
- @Rule
- public final TestTracker tracker = new TestTracker();
- protected Server server;
- protected SPDYServerConnector connector;
- protected SPDYClient.Factory clientFactory;
-
- protected InetSocketAddress prepare() throws Exception
- {
- server = new Server();
- connector = new SPDYServerConnector(server, newSslContextFactory(), null, new ALPNServerConnectionFactory("spdy/3", "spdy/2", "http/1.1"));
- connector.setPort(0);
- connector.setIdleTimeout(30000);
- server.addConnector(connector);
- server.start();
-
- QueuedThreadPool threadPool = new QueuedThreadPool();
- threadPool.setName(threadPool.getName() + "-client");
- clientFactory = new SPDYClient.Factory(threadPool);
- clientFactory.start();
-
- ALPN.debug = true;
-
- return new InetSocketAddress("localhost", connector.getLocalPort());
- }
-
- protected SslContextFactory newSslContextFactory()
- {
- SslContextFactory sslContextFactory = new SslContextFactory();
- sslContextFactory.setKeyStorePath("src/test/resources/keystore.jks");
- sslContextFactory.setKeyStorePassword("storepwd");
- sslContextFactory.setTrustStorePath("src/test/resources/truststore.jks");
- sslContextFactory.setTrustStorePassword("storepwd");
- sslContextFactory.setProtocol("TLSv1");
- sslContextFactory.setIncludeProtocols("TLSv1");
- return sslContextFactory;
- }
-
- @After
- public void dispose() throws Exception
- {
- clientFactory.stop();
- server.stop();
- }
-}
diff --git a/jetty-spdy/spdy-alpn-tests/src/test/resources/jetty-logging.properties b/jetty-spdy/spdy-alpn-tests/src/test/resources/jetty-logging.properties
deleted file mode 100644
index ead13ec197..0000000000
--- a/jetty-spdy/spdy-alpn-tests/src/test/resources/jetty-logging.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
-#org.eclipse.jetty.spdy.LEVEL=DEBUG
diff --git a/jetty-spdy/spdy-alpn-tests/src/test/resources/keystore.jks b/jetty-spdy/spdy-alpn-tests/src/test/resources/keystore.jks
deleted file mode 100644
index 428ba54776..0000000000
--- a/jetty-spdy/spdy-alpn-tests/src/test/resources/keystore.jks
+++ /dev/null
Binary files differ
diff --git a/jetty-spdy/spdy-alpn-tests/src/test/resources/truststore.jks b/jetty-spdy/spdy-alpn-tests/src/test/resources/truststore.jks
deleted file mode 100644
index 839cb8c351..0000000000
--- a/jetty-spdy/spdy-alpn-tests/src/test/resources/truststore.jks
+++ /dev/null
Binary files differ
diff --git a/jetty-spdy/spdy-client/pom.xml b/jetty-spdy/spdy-client/pom.xml
deleted file mode 100644
index 14569025fa..0000000000
--- a/jetty-spdy/spdy-client/pom.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-parent</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>spdy-client</artifactId>
- <name>Jetty :: SPDY :: Client Binding</name>
-
- <properties>
- <bundle-symbolic-name>${project.groupId}.client</bundle-symbolic-name>
- </properties>
-
- <url>http://www.eclipse.org/jetty</url>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <executions>
- <execution>
- <goals>
- <goal>manifest</goal>
- </goals>
- <configuration>
- <instructions>
- <Import-Package>
- !org.eclipse.jetty.npn,
- org.eclipse.jetty.npn.client;resolution:=optional;version="[9.0,10.0)",
- !org.eclipse.jetty.alpn,
- org.eclipse.jetty.alpn.client;resolution:=optional;version="[9.0,10.0)",
- org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package>
- </instructions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-alpn-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-npn-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.alpn</groupId>
- <artifactId>alpn-api</artifactId>
- <version>${alpn.api.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.npn</groupId>
- <artifactId>npn-api</artifactId>
- <version>${npn.api.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/FlowControlStrategyFactory.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/FlowControlStrategyFactory.java
deleted file mode 100644
index b5fbb5c60b..0000000000
--- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/FlowControlStrategyFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.client;
-
-import org.eclipse.jetty.spdy.FlowControlStrategy;
-import org.eclipse.jetty.spdy.SPDYv3FlowControlStrategy;
-import org.eclipse.jetty.spdy.api.SPDY;
-
-public class FlowControlStrategyFactory
-{
- private FlowControlStrategyFactory()
- {
- }
-
- public static FlowControlStrategy newFlowControlStrategy(short version)
- {
- switch (version)
- {
- case SPDY.V2:
- return new FlowControlStrategy.None();
- case SPDY.V3:
- return new SPDYv3FlowControlStrategy();
- default:
- throw new IllegalStateException();
- }
- }
-}
diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java
deleted file mode 100644
index 3aba311ef6..0000000000
--- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClient.java
+++ /dev/null
@@ -1,442 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.client;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.io.ClientConnectionFactory;
-import org.eclipse.jetty.io.Connection;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.ManagedSelector;
-import org.eclipse.jetty.io.MappedByteBufferPool;
-import org.eclipse.jetty.io.NegotiatingClientConnectionFactory;
-import org.eclipse.jetty.io.SelectChannelEndPoint;
-import org.eclipse.jetty.io.SelectorManager;
-import org.eclipse.jetty.io.ssl.SslClientConnectionFactory;
-import org.eclipse.jetty.npn.client.NPNClientConnectionFactory;
-import org.eclipse.jetty.spdy.FlowControlStrategy;
-import org.eclipse.jetty.spdy.api.GoAwayInfo;
-import org.eclipse.jetty.spdy.api.Session;
-import org.eclipse.jetty.spdy.api.SessionFrameListener;
-import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.util.FuturePromise;
-import org.eclipse.jetty.util.Promise;
-import org.eclipse.jetty.util.component.ContainerLifeCycle;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.util.thread.QueuedThreadPool;
-import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
-import org.eclipse.jetty.util.thread.Scheduler;
-
-/**
- * A {@link SPDYClient} allows applications to connect to one or more SPDY servers,
- * obtaining {@link Session} objects that can be used to send/receive SPDY frames.
- * <p/>
- * {@link SPDYClient} instances are created through a {@link Factory}:
- * <pre>
- * SPDYClient.Factory factory = new SPDYClient.Factory();
- * SPDYClient client = factory.newSPDYClient(SPDY.V3);
- * </pre>
- * and then used to connect to the server:
- * <pre>
- * FuturePromise&lt;Session&gt; promise = new FuturePromise&lt;&gt;();
- * client.connect("server.com", null, promise);
- * Session session = promise.get();
- * </pre>
- */
-public class SPDYClient
-{
- private final short version;
- private final Factory factory;
- private volatile SocketAddress bindAddress;
- private volatile long idleTimeout = -1;
- private volatile int initialWindowSize;
- private volatile boolean dispatchIO;
- private volatile ClientConnectionFactory connectionFactory;
-
- protected SPDYClient(short version, Factory factory)
- {
- this.version = version;
- this.factory = factory;
- setInitialWindowSize(65536);
- setDispatchIO(true);
- }
-
- public short getVersion()
- {
- return version;
- }
-
- public Factory getFactory()
- {
- return factory;
- }
-
- /**
- * Equivalent to:
- * <pre>
- * Future&lt;Session&gt; promise = new FuturePromise&lt;&gt;();
- * connect(address, listener, promise);
- * </pre>
- *
- * @param address the address to connect to
- * @param listener the session listener that will be notified of session events
- * @return a {@link Session} when connected
- */
- public Session connect(SocketAddress address, SessionFrameListener listener) throws ExecutionException, InterruptedException
- {
- FuturePromise<Session> promise = new FuturePromise<>();
- connect(address, listener, promise);
- return promise.get();
- }
-
- /**
- * Equivalent to:
- * <pre>
- * connect(address, listener, promise, null);
- * </pre>
- *
- * @param address the address to connect to
- * @param listener the session listener that will be notified of session events
- * @param promise the promise notified of connection success/failure
- */
- public void connect(SocketAddress address, SessionFrameListener listener, Promise<Session> promise)
- {
- connect(address, listener, promise, new HashMap<String, Object>());
- }
-
- /**
- * Connects to the given {@code address}, binding the given {@code listener} to session events,
- * and notified the given {@code promise} of the connect result.
- * <p/>
- * If the connect operation is successful, the {@code promise} will be invoked with the {@link Session}
- * object that applications can use to perform SPDY requests.
- *
- * @param address the address to connect to
- * @param listener the session listener that will be notified of session events
- * @param promise the promise notified of connection success/failure
- * @param context a context object passed to the {@link #getClientConnectionFactory() ConnectionFactory}
- * for the creation of the connection
- */
- public void connect(final SocketAddress address, final SessionFrameListener listener, final Promise<Session> promise, Map<String, Object> context)
- {
- if (!factory.isStarted())
- throw new IllegalStateException(Factory.class.getSimpleName() + " is not started");
-
- try
- {
- SocketChannel channel = SocketChannel.open();
- if (bindAddress != null)
- channel.bind(bindAddress);
- configure(channel);
- channel.configureBlocking(false);
-
- context.put(SslClientConnectionFactory.SSL_PEER_HOST_CONTEXT_KEY, ((InetSocketAddress)address).getHostString());
- context.put(SslClientConnectionFactory.SSL_PEER_PORT_CONTEXT_KEY, ((InetSocketAddress)address).getPort());
- context.put(SPDYClientConnectionFactory.SPDY_CLIENT_CONTEXT_KEY, this);
- context.put(SPDYClientConnectionFactory.SPDY_SESSION_LISTENER_CONTEXT_KEY, listener);
- context.put(SPDYClientConnectionFactory.SPDY_SESSION_PROMISE_CONTEXT_KEY, promise);
-
- if (channel.connect(address))
- factory.selector.accept(channel, context);
- else
- factory.selector.connect(channel, context);
- }
- catch (IOException x)
- {
- promise.failed(x);
- }
- }
-
- protected void configure(SocketChannel channel) throws IOException
- {
- channel.socket().setTcpNoDelay(true);
- }
-
- /**
- * @return the address to bind the socket channel to
- * @see #setBindAddress(SocketAddress)
- */
- public SocketAddress getBindAddress()
- {
- return bindAddress;
- }
-
- /**
- * @param bindAddress the address to bind the socket channel to
- * @see #getBindAddress()
- */
- public void setBindAddress(SocketAddress bindAddress)
- {
- this.bindAddress = bindAddress;
- }
-
- public long getIdleTimeout()
- {
- return idleTimeout;
- }
-
- public void setIdleTimeout(long idleTimeout)
- {
- this.idleTimeout = idleTimeout;
- }
-
- public int getInitialWindowSize()
- {
- return initialWindowSize;
- }
-
- public void setInitialWindowSize(int initialWindowSize)
- {
- this.initialWindowSize = initialWindowSize;
- }
-
- public boolean isDispatchIO()
- {
- return dispatchIO;
- }
-
- public void setDispatchIO(boolean dispatchIO)
- {
- this.dispatchIO = dispatchIO;
- }
-
- public ClientConnectionFactory getClientConnectionFactory()
- {
- return connectionFactory;
- }
-
- public void setClientConnectionFactory(ClientConnectionFactory connectionFactory)
- {
- this.connectionFactory = connectionFactory;
- }
-
- protected FlowControlStrategy newFlowControlStrategy()
- {
- return FlowControlStrategyFactory.newFlowControlStrategy(version);
- }
-
- public static class Factory extends ContainerLifeCycle
- {
- private final Queue<Session> sessions = new ConcurrentLinkedQueue<>();
- private final Scheduler scheduler;
- private final Executor executor;
- private final ByteBufferPool bufferPool;
- private final SslContextFactory sslContextFactory;
- private final SelectorManager selector;
- private final long idleTimeout;
- private long connectTimeout;
-
- public Factory()
- {
- this(null, null);
- }
-
- public Factory(SslContextFactory sslContextFactory)
- {
- this(null, null, sslContextFactory);
- }
-
- public Factory(Executor executor)
- {
- this(executor, null);
- }
-
- public Factory(Executor executor, Scheduler scheduler)
- {
- this(executor, scheduler, null);
- }
-
- public Factory(Executor executor, Scheduler scheduler, SslContextFactory sslContextFactory)
- {
- this(executor, scheduler, sslContextFactory, 30000);
- }
-
- public Factory(Executor executor, Scheduler scheduler, SslContextFactory sslContextFactory, long idleTimeout)
- {
- this(executor, scheduler, null, sslContextFactory, idleTimeout);
- }
-
- public Factory(Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, SslContextFactory sslContextFactory, long idleTimeout)
- {
- this.idleTimeout = idleTimeout;
- setConnectTimeout(15000);
-
- if (executor == null)
- executor = new QueuedThreadPool();
- this.executor = executor;
- addBean(executor);
-
- if (scheduler == null)
- scheduler = new ScheduledExecutorScheduler();
- this.scheduler = scheduler;
- addBean(scheduler);
-
- if (bufferPool == null)
- bufferPool = new MappedByteBufferPool();
- this.bufferPool = bufferPool;
- addBean(bufferPool);
-
- this.sslContextFactory = sslContextFactory;
- if (sslContextFactory != null)
- addBean(sslContextFactory);
-
- selector = new ClientSelectorManager(executor, scheduler);
- selector.setConnectTimeout(getConnectTimeout());
- addBean(selector);
- }
-
- public ByteBufferPool getByteBufferPool()
- {
- return bufferPool;
- }
-
- public Scheduler getScheduler()
- {
- return scheduler;
- }
-
- public Executor getExecutor()
- {
- return executor;
- }
-
- public SslContextFactory getSslContextFactory()
- {
- return sslContextFactory;
- }
-
- public long getConnectTimeout()
- {
- return connectTimeout;
- }
-
- public void setConnectTimeout(long connectTimeout)
- {
- this.connectTimeout = connectTimeout;
- }
-
- public SPDYClient newSPDYClient(short version)
- {
- return newSPDYClient(version, new NPNClientConnectionFactory(getExecutor(), new SPDYClientConnectionFactory(), "spdy/" + version));
- }
-
- public SPDYClient newSPDYClient(short version, NegotiatingClientConnectionFactory negotiatingFactory)
- {
- SPDYClient client = new SPDYClient(version, this);
-
- ClientConnectionFactory connectionFactory = negotiatingFactory.getClientConnectionFactory();
- if (sslContextFactory != null)
- connectionFactory = new SslClientConnectionFactory(getSslContextFactory(), getByteBufferPool(), getExecutor(), negotiatingFactory);
-
- client.setClientConnectionFactory(connectionFactory);
- return client;
- }
-
- @Override
- protected void doStop() throws Exception
- {
- closeConnections();
- super.doStop();
- }
-
- boolean sessionOpened(Session session)
- {
- // Add sessions only if the factory is not stopping
- return isRunning() && sessions.offer(session);
- }
-
- boolean sessionClosed(Session session)
- {
- // Remove sessions only if the factory is not stopping
- // to avoid concurrent removes during iterations
- return isRunning() && sessions.remove(session);
- }
-
- private void closeConnections()
- {
- for (Session session : sessions)
- session.goAway(new GoAwayInfo(), Callback.Adapter.INSTANCE);
- sessions.clear();
- }
-
- public Collection<Session> getSessions()
- {
- return Collections.unmodifiableCollection(sessions);
- }
-
- @Override
- protected void dumpThis(Appendable out) throws IOException
- {
- super.dumpThis(out);
- dump(out, "", sessions);
- }
-
- private class ClientSelectorManager extends SelectorManager
- {
- private ClientSelectorManager(Executor executor, Scheduler scheduler)
- {
- super(executor, scheduler);
- }
-
- @Override
- protected EndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
- {
- @SuppressWarnings("unchecked")
- Map<String, Object> context = (Map<String, Object>)key.attachment();
- SPDYClient client = (SPDYClient)context.get(SPDYClientConnectionFactory.SPDY_CLIENT_CONTEXT_KEY);
- long clientIdleTimeout = client.getIdleTimeout();
- if (clientIdleTimeout < 0)
- clientIdleTimeout = idleTimeout;
- return new SelectChannelEndPoint(channel, selectSet, key, getScheduler(), clientIdleTimeout);
- }
-
- @Override
- public Connection newConnection(SocketChannel channel, EndPoint endPoint, Object attachment) throws IOException
- {
- @SuppressWarnings("unchecked")
- Map<String, Object> context = (Map<String, Object>)attachment;
- try
- {
- SPDYClient client = (SPDYClient)context.get(SPDYClientConnectionFactory.SPDY_CLIENT_CONTEXT_KEY);
- return client.getClientConnectionFactory().newConnection(endPoint, context);
- }
- catch (Throwable x)
- {
- @SuppressWarnings("unchecked")
- Promise<Session> promise = (Promise<Session>)context.get(SPDYClientConnectionFactory.SPDY_SESSION_PROMISE_CONTEXT_KEY);
- promise.failed(x);
- throw x;
- }
- }
- }
- }
-}
diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java
deleted file mode 100644
index cffd5bcc4c..0000000000
--- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.client;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.io.ClientConnectionFactory;
-import org.eclipse.jetty.io.Connection;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.spdy.CompressionFactory;
-import org.eclipse.jetty.spdy.FlowControlStrategy;
-import org.eclipse.jetty.spdy.StandardCompressionFactory;
-import org.eclipse.jetty.spdy.StandardSession;
-import org.eclipse.jetty.spdy.api.Session;
-import org.eclipse.jetty.spdy.api.SessionFrameListener;
-import org.eclipse.jetty.spdy.client.SPDYClient.Factory;
-import org.eclipse.jetty.spdy.generator.Generator;
-import org.eclipse.jetty.spdy.parser.Parser;
-import org.eclipse.jetty.util.Promise;
-
-public class SPDYClientConnectionFactory implements ClientConnectionFactory
-{
- public static final String SPDY_CLIENT_CONTEXT_KEY = "spdy.client";
- public static final String SPDY_SESSION_LISTENER_CONTEXT_KEY = "spdy.session.listener";
- public static final String SPDY_SESSION_PROMISE_CONTEXT_KEY = "spdy.session.promise";
-
- @Override
- public Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException
- {
- SPDYClient client = (SPDYClient)context.get(SPDY_CLIENT_CONTEXT_KEY);
- SPDYClient.Factory factory = client.getFactory();
- ByteBufferPool byteBufferPool = factory.getByteBufferPool();
- CompressionFactory compressionFactory = new StandardCompressionFactory();
- Parser parser = new Parser(compressionFactory.newDecompressor());
- Generator generator = new Generator(byteBufferPool, compressionFactory.newCompressor());
-
- SPDYConnection connection = new ClientSPDYConnection(endPoint, byteBufferPool, parser, factory);
-
- FlowControlStrategy flowControlStrategy = client.newFlowControlStrategy();
-
- SessionFrameListener listener = (SessionFrameListener)context.get(SPDY_SESSION_LISTENER_CONTEXT_KEY);
- StandardSession session = new StandardSession(client.getVersion(), byteBufferPool,
- factory.getScheduler(), connection, endPoint, connection, 1, listener, generator, flowControlStrategy);
-
- session.setWindowSize(client.getInitialWindowSize());
- parser.addListener(session);
- connection.setSession(session);
-
- @SuppressWarnings("unchecked")
- Promise<Session> promise = (Promise<Session>)context.get(SPDY_SESSION_PROMISE_CONTEXT_KEY);
- promise.succeeded(session);
-
- return connection;
- }
-
- private class ClientSPDYConnection extends SPDYConnection
- {
- private final Factory factory;
-
- public ClientSPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Factory factory)
- {
- super(endPoint, bufferPool, parser, factory.getExecutor());
- this.factory = factory;
- }
-
- @Override
- public void onOpen()
- {
- super.onOpen();
- factory.sessionOpened(getSession());
- }
-
- @Override
- public void onClose()
- {
- super.onClose();
- factory.sessionClosed(getSession());
- }
- }
-}
diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java
deleted file mode 100644
index cfee2085bd..0000000000
--- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.client;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.concurrent.Executor;
-
-import org.eclipse.jetty.io.AbstractConnection;
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.io.RuntimeIOException;
-import org.eclipse.jetty.spdy.Controller;
-import org.eclipse.jetty.spdy.ISession;
-import org.eclipse.jetty.spdy.IdleListener;
-import org.eclipse.jetty.spdy.api.GoAwayInfo;
-import org.eclipse.jetty.spdy.parser.Parser;
-import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-
-public class SPDYConnection extends AbstractConnection implements Controller, IdleListener
-{
- private static final Logger LOG = Log.getLogger(SPDYConnection.class);
- private final ByteBufferPool bufferPool;
- private final Parser parser;
- private final int bufferSize;
- private volatile ISession session;
- private volatile boolean idle = false;
-
- public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor)
- {
- this(endPoint, bufferPool, parser, executor, 8192);
- }
-
- public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor, int bufferSize)
- {
- // Since SPDY is multiplexed, onFillable() must never block while calling application code. In fact,
- // the SPDY code always dispatches to a new thread when calling application code,
- // so here we can safely pass false as last parameter, and avoid to dispatch to onFillable().
- // The IO operation (read, parse, etc.) will not block and will be fast in almost all cases.
- // Big uploads to a server, however, might occupy the Selector thread for a long time and
- // therefore starve other connections, so by default dispatchIO is true.
- super(endPoint, executor);
- this.bufferPool = bufferPool;
- this.parser = parser;
- onIdle(true);
- this.bufferSize = bufferSize;
- }
-
- @Override
- public void onOpen()
- {
- super.onOpen();
- fillInterested();
- }
-
- @Override
- public void onFillable()
- {
- ByteBuffer buffer = bufferPool.acquire(bufferSize, false);
- boolean readMore = read(buffer) == 0;
- bufferPool.release(buffer);
- if (readMore)
- fillInterested();
- }
-
- protected int read(ByteBuffer buffer)
- {
- EndPoint endPoint = getEndPoint();
- while (true)
- {
- int filled = fill(endPoint, buffer);
- if (LOG.isDebugEnabled()) // Avoid boxing of variable 'filled'
- LOG.debug("Read {} bytes", filled);
- if (filled == 0)
- {
- return 0;
- }
- else if (filled < 0)
- {
- shutdown(session);
- return -1;
- }
- else
- {
- parser.parse(buffer);
- }
- }
- }
-
- private int fill(EndPoint endPoint, ByteBuffer buffer)
- {
- try
- {
- if (endPoint.isInputShutdown())
- return -1;
- return endPoint.fill(buffer);
- }
- catch (IOException x)
- {
- endPoint.close();
- throw new RuntimeIOException(x);
- }
- }
-
- @Override
- public void write(final Callback callback, ByteBuffer... buffers)
- {
- EndPoint endPoint = getEndPoint();
- endPoint.write(callback, buffers);
- }
-
- @Override
- public void close()
- {
- goAway(session);
- }
-
- @Override
- public void close(boolean onlyOutput)
- {
- EndPoint endPoint = getEndPoint();
- // We need to gently close first, to allow
- // SSL close alerts to be sent by Jetty
- if (LOG.isDebugEnabled())
- LOG.debug("Shutting down output {}", endPoint);
- endPoint.shutdownOutput();
- if (!onlyOutput)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Closing {}", endPoint);
- endPoint.close();
- }
- }
-
- @Override
- public void onIdle(boolean idle)
- {
- this.idle = idle;
- }
-
- @Override
- protected boolean onReadTimeout()
- {
- boolean idle = this.idle;
- if (LOG.isDebugEnabled())
- LOG.debug("Idle timeout on {}, idle={}", this, idle);
- if (idle)
- goAway(session);
- return false;
- }
-
- protected void goAway(ISession session)
- {
- if (session != null)
- session.goAway(new GoAwayInfo(), Callback.Adapter.INSTANCE);
- }
-
- private void shutdown(ISession session)
- {
- if (session != null && !getEndPoint().isOutputShutdown())
- session.shutdown();
- }
-
- protected ISession getSession()
- {
- return session;
- }
-
- public void setSession(ISession session)
- {
- this.session = session;
- }
-}
diff --git a/jetty-spdy/spdy-core/pom.xml b/jetty-spdy/spdy-core/pom.xml
deleted file mode 100644
index 38760a1e7b..0000000000
--- a/jetty-spdy/spdy-core/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.eclipse.jetty.spdy</groupId>
- <artifactId>spdy-parent</artifactId>
- <version>9.3.0-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>spdy-core</artifactId>
- <name>Jetty :: SPDY :: Core</name>
-
- <properties>
- <bundle-symbolic-name>${project.groupId}.core</bundle-symbolic-name>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <executions>
- <execution>
- <goals>
- <goal>manifest</goal>
- </goals>
- <configuration>
- <instructions>
- <Export-Package>org.eclipse.jetty.spdy.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</Export-Package>
- </instructions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-io</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java
deleted file mode 100644
index b752d6fd10..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import org.eclipse.jetty.spdy.api.SPDY;
-
-public class CompressionDictionary
-{
- private static final byte[] DICTIONARY_V2 = ("" +
- "optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-" +
- "languageauthorizationexpectfromhostif-modified-sinceif-matchif-none-matchi" +
- "f-rangeif-unmodifiedsincemax-forwardsproxy-authorizationrangerefererteuser" +
- "-agent10010120020120220320420520630030130230330430530630740040140240340440" +
- "5406407408409410411412413414415416417500501502503504505accept-rangesageeta" +
- "glocationproxy-authenticatepublicretry-afterservervarywarningwww-authentic" +
- "ateallowcontent-basecontent-encodingcache-controlconnectiondatetrailertran" +
- "sfer-encodingupgradeviawarningcontent-languagecontent-lengthcontent-locati" +
- "oncontent-md5content-rangecontent-typeetagexpireslast-modifiedset-cookieMo" +
- "ndayTuesdayWednesdayThursdayFridaySaturdaySundayJanFebMarAprMayJunJulAugSe" +
- "pOctNovDecchunkedtext/htmlimage/pngimage/jpgimage/gifapplication/xmlapplic" +
- "ation/xhtmltext/plainpublicmax-agecharset=iso-8859-1utf-8gzipdeflateHTTP/1" +
- ".1statusversionurl" +
- // Must be NUL terminated
- "\u0000").getBytes();
-
- private static final byte[] DICTIONARY_V3 = ("" +
- "\u0000\u0000\u0000\u0007options\u0000\u0000\u0000\u0004head\u0000\u0000\u0000\u0004post" +
- "\u0000\u0000\u0000\u0003put\u0000\u0000\u0000\u0006delete\u0000\u0000\u0000\u0005trace" +
- "\u0000\u0000\u0000\u0006accept\u0000\u0000\u0000\u000Eaccept-charset" +
- "\u0000\u0000\u0000\u000Faccept-encoding\u0000\u0000\u0000\u000Faccept-language" +
- "\u0000\u0000\u0000\raccept-ranges\u0000\u0000\u0000\u0003age\u0000\u0000\u0000\u0005allow" +
- "\u0000\u0000\u0000\rauthorization\u0000\u0000\u0000\rcache-control" +
- "\u0000\u0000\u0000\nconnection\u0000\u0000\u0000\fcontent-base\u0000\u0000\u0000\u0010content-encoding" +
- "\u0000\u0000\u0000\u0010content-language\u0000\u0000\u0000\u000Econtent-length" +
- "\u0000\u0000\u0000\u0010content-location\u0000\u0000\u0000\u000Bcontent-md5" +
- "\u0000\u0000\u0000\rcontent-range\u0000\u0000\u0000\fcontent-type\u0000\u0000\u0000\u0004date" +
- "\u0000\u0000\u0000\u0004etag\u0000\u0000\u0000\u0006expect\u0000\u0000\u0000\u0007expires" +
- "\u0000\u0000\u0000\u0004from\u0000\u0000\u0000\u0004host\u0000\u0000\u0000\bif-match" +
- "\u0000\u0000\u0000\u0011if-modified-since\u0000\u0000\u0000\rif-none-match\u0000\u0000\u0000\bif-range" +
- "\u0000\u0000\u0000\u0013if-unmodified-since\u0000\u0000\u0000\rlast-modified" +
- "\u0000\u0000\u0000\blocation\u0000\u0000\u0000\fmax-forwards\u0000\u0000\u0000\u0006pragma" +
- "\u0000\u0000\u0000\u0012proxy-authenticate\u0000\u0000\u0000\u0013proxy-authorization" +
- "\u0000\u0000\u0000\u0005range\u0000\u0000\u0000\u0007referer\u0000\u0000\u0000\u000Bretry-after" +
- "\u0000\u0000\u0000\u0006server\u0000\u0000\u0000\u0002te\u0000\u0000\u0000\u0007trailer" +
- "\u0000\u0000\u0000\u0011transfer-encoding\u0000\u0000\u0000\u0007upgrade\u0000\u0000\u0000\nuser-agent" +
- "\u0000\u0000\u0000\u0004vary\u0000\u0000\u0000\u0003via\u0000\u0000\u0000\u0007warning" +
- "\u0000\u0000\u0000\u0010www-authenticate\u0000\u0000\u0000\u0006method\u0000\u0000\u0000\u0003get" +
- "\u0000\u0000\u0000\u0006status\u0000\u0000\u0000\u0006200 OK\u0000\u0000\u0000\u0007version" +
- "\u0000\u0000\u0000\bHTTP/1.1\u0000\u0000\u0000\u0003url\u0000\u0000\u0000\u0006public" +
- "\u0000\u0000\u0000\nset-cookie\u0000\u0000\u0000\nkeep-alive\u0000\u0000\u0000\u0006origin" +
- "100101201202205206300302303304305306307402405406407408409410411412413414415416417502504505" +
- "203 Non-Authoritative Information204 No Content301 Moved Permanently400 Bad Request401 Unauthorized" +
- "403 Forbidden404 Not Found500 Internal Server Error501 Not Implemented503 Service Unavailable" +
- "Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec 00:00:00 Mon, Tue, Wed, Thu, Fri, Sat, Sun, GMT" +
- "chunked,text/html,image/png,image/jpg,image/gif,application/xml,application/xhtml+xml,text/plain," +
- "text/javascript,publicprivatemax-age=gzip,deflate,sdchcharset=utf-8charset=iso-8859-1,utf-,*,enq=0.")
- .getBytes();
-
- public static byte[] get(short version)
- {
- switch (version)
- {
- case SPDY.V2:
- return DICTIONARY_V2;
- case SPDY.V3:
- return DICTIONARY_V3;
- default:
- throw new IllegalStateException();
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java
deleted file mode 100644
index 698e9c2b62..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.util.zip.ZipException;
-
-public interface CompressionFactory
-{
- public Compressor newCompressor();
-
- public Decompressor newDecompressor();
-
- public interface Compressor
- {
- public void setInput(byte[] input);
-
- public void setDictionary(byte[] dictionary);
-
- public int compress(byte[] output);
- }
-
- public interface Decompressor
- {
- public void setDictionary(byte[] dictionary);
-
- public void setInput(byte[] input);
-
- public int decompress(byte[] output) throws ZipException;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java
deleted file mode 100644
index 32a5b8d1c6..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.util.Callback;
-
-public interface Controller
-{
- public void write(Callback callback, ByteBuffer... buffers);
-
- public void close(boolean onlyOutput);
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java
deleted file mode 100644
index a2dcff05ea..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import org.eclipse.jetty.spdy.api.DataInfo;
-
-// TODO: add methods that tell how much written and whether we're TCP congested ?
-public interface FlowControlStrategy
-{
- public int getWindowSize(ISession session);
-
- public void setWindowSize(ISession session, int windowSize);
-
- public void onNewStream(ISession session, IStream stream);
-
- public void onWindowUpdate(ISession session, IStream stream, int delta);
-
- public void updateWindow(ISession session, IStream stream, int delta);
-
- public void onDataReceived(ISession session, IStream stream, DataInfo dataInfo);
-
- public void onDataConsumed(ISession session, IStream stream, DataInfo dataInfo, int delta);
-
- public static class None implements FlowControlStrategy
- {
- private volatile int windowSize;
-
- public None()
- {
- this(65536);
- }
-
- public None(int windowSize)
- {
- this.windowSize = windowSize;
- }
-
- @Override
- public int getWindowSize(ISession session)
- {
- return windowSize;
- }
-
- @Override
- public void setWindowSize(ISession session, int windowSize)
- {
- this.windowSize = windowSize;
- }
-
- @Override
- public void onNewStream(ISession session, IStream stream)
- {
- stream.updateWindowSize(windowSize);
- }
-
- @Override
- public void onWindowUpdate(ISession session, IStream stream, int delta)
- {
- }
-
- @Override
- public void updateWindow(ISession session, IStream stream, int delta)
- {
- }
-
- @Override
- public void onDataReceived(ISession session, IStream stream, DataInfo dataInfo)
- {
- }
-
- @Override
- public void onDataConsumed(ISession session, IStream stream, DataInfo dataInfo, int delta)
- {
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Flusher.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Flusher.java
deleted file mode 100644
index f18f9d649f..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Flusher.java
+++ /dev/null
@@ -1,266 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jetty.spdy.StandardSession.FrameBytes;
-import org.eclipse.jetty.spdy.api.Stream;
-import org.eclipse.jetty.spdy.api.StreamStatus;
-import org.eclipse.jetty.util.ArrayQueue;
-import org.eclipse.jetty.util.IteratingCallback;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-
-public class Flusher
-{
- private static final Logger LOG = Log.getLogger(Flusher.class);
-
- private final IteratingCallback callback = new FlusherCallback();
- private final Object lock = new Object();
- private final ArrayQueue<StandardSession.FrameBytes> queue = new ArrayQueue<>(ArrayQueue.DEFAULT_CAPACITY, ArrayQueue.DEFAULT_GROWTH, lock);
- private final Controller controller;
- private final int maxGather;
- private Throwable failure;
-
- public Flusher(Controller controller)
- {
- this(controller, 8);
- }
-
- public Flusher(Controller controller, int maxGather)
- {
- this.controller = controller;
- this.maxGather = maxGather;
- }
-
- public void removeFrameBytesFromQueue(Stream stream)
- {
- synchronized (lock)
- {
- for (StandardSession.FrameBytes frameBytes : queue)
- if (frameBytes.getStream() == stream)
- queue.remove(frameBytes);
- }
- }
-
- public Throwable prepend(StandardSession.FrameBytes frameBytes)
- {
- synchronized (lock)
- {
- Throwable failure = this.failure;
- if (failure == null)
- {
- // Scan from the front of the queue looking to skip higher priority messages
- int index = 0;
- int size = queue.size();
- while (index < size)
- {
- StandardSession.FrameBytes element = queue.getUnsafe(index);
- if (element.compareTo(frameBytes) <= 0)
- break;
- ++index;
- }
- queue.add(index, frameBytes);
- }
- return failure;
- }
- }
-
- public Throwable append(StandardSession.FrameBytes frameBytes)
- {
- synchronized (lock)
- {
- Throwable failure = this.failure;
- if (failure == null)
- {
- // Non DataFrameBytes are inserted last
- queue.add(frameBytes);
- }
- return failure;
- }
- }
-
- public Throwable append(StandardSession.DataFrameBytes frameBytes)
- {
- synchronized (lock)
- {
- Throwable failure = this.failure;
- if (failure == null)
- {
- // DataFrameBytes are inserted by priority
- int index = queue.size();
- while (index > 0)
- {
- StandardSession.FrameBytes element = queue.getUnsafe(index - 1);
- if (element.compareTo(frameBytes) >= 0)
- break;
- --index;
- }
- queue.add(index, frameBytes);
- }
- return failure;
- }
- }
-
- public void flush()
- {
- callback.iterate();
- }
-
- public int getQueueSize()
- {
- synchronized (lock)
- {
- return queue.size();
- }
- }
-
- private class FlusherCallback extends IteratingCallback
- {
- private final List<StandardSession.FrameBytes> active = new ArrayList<>(maxGather);
- private final List<StandardSession.FrameBytes> succeeded = new ArrayList<>(maxGather);
- private final Set<IStream> stalled = new HashSet<>();
-
- @Override
- protected Action process() throws Exception
- {
- synchronized (lock)
- {
- // Scan queue for data to write from first non stalled stream.
- int index = 0; // The index of the first non-stalled frame.
- int size = queue.size();
- while (index < size)
- {
- FrameBytes frameBytes = queue.getUnsafe(index);
- IStream stream = frameBytes.getStream();
-
- if (stream != null)
- {
- // Is it a frame belonging to an already stalled stream ?
- if (stalled.size() > 0 && stalled.contains(stream))
- {
- ++index;
- continue;
- }
-
- // Has the stream consumed all its flow control window ?
- if (stream.getWindowSize() <= 0)
- {
- stalled.add(stream);
- ++index;
- continue;
- }
- }
-
- // We will be possibly writing this frame, so take the frame off the queue.
- queue.remove(index);
- --size;
-
- // Has the stream been reset for this data frame ?
- if (stream != null && stream.isReset() && frameBytes instanceof StandardSession.DataFrameBytes)
- {
- // TODO: notify from within sync block !
- frameBytes.failed(new StreamException(frameBytes.getStream().getId(),
- StreamStatus.INVALID_STREAM, "Stream: " + frameBytes.getStream() + " is reset!"));
- continue;
- }
-
- active.add(frameBytes);
- }
- stalled.clear();
-
- if (LOG.isDebugEnabled())
- LOG.debug("Flushing {} of {} frame(s) in queue", active.size(), queue.size());
- }
-
- if (active.isEmpty())
- return Action.IDLE;
-
- // Get the bytes to write
- ByteBuffer[] buffers = new ByteBuffer[active.size()];
- for (int i = 0; i < buffers.length; i++)
- buffers[i] = active.get(i).getByteBuffer();
-
- if (controller != null)
- controller.write(this, buffers);
-
- // TODO: optimization
- // If the callback completely immediately, it means that
- // the connection is not congested, and therefore we can
- // write more data without blocking.
- // Therefore we should check this condition and increase
- // the write window, which means two things: autotune the
- // maxGather parameter, and/or autotune the buffer returned
- // by FrameBytes.getByteBuffer() (see also comment there).
-
- return Action.SCHEDULED;
- }
-
- @Override
- protected void onCompleteSuccess()
- {
- // will never be called as process always returns SCHEDULED or IDLE
- throw new IllegalStateException();
- }
-
- @Override
- public void succeeded()
- {
- synchronized (lock)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Succeeded write of {}, q={}", active, queue.size());
- succeeded.addAll(active);
- active.clear();
- }
- // Notify outside the synchronized block.
- for (FrameBytes frame : succeeded)
- frame.succeeded();
- succeeded.clear();
- super.succeeded();
- }
-
- @Override
- public void onCompleteFailure(Throwable x)
- {
- List<StandardSession.FrameBytes> failed = new ArrayList<>();
- synchronized (lock)
- {
- failure = x;
- if (LOG.isDebugEnabled())
- {
- String logMessage = String.format("Failed write of %s, failing all %d frame(s) in queue", this, queue.size());
- LOG.debug(logMessage, x);
- }
- failed.addAll(active);
- active.clear();
- failed.addAll(queue);
- queue.clear();
- }
- // Notify outside the synchronized block.
- for (StandardSession.FrameBytes frame : failed)
- frame.failed(x);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java
deleted file mode 100644
index d5f80cf29d..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.api.Session;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.util.Callback;
-
-public interface ISession extends Session
-{
- public void control(IStream stream, ControlFrame frame, long timeout, TimeUnit unit, Callback callback);
-
- public void data(IStream stream, DataInfo dataInfo, long timeout, TimeUnit unit, Callback callback);
-
- /**
- * <p>Gracefully shuts down this session.</p>
- * <p>A special item is queued that will close the connection when it will be dequeued.</p>
- */
- public void shutdown();
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java
deleted file mode 100644
index 8524ab2110..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.api.SessionFrameListener;
-import org.eclipse.jetty.spdy.api.Stream;
-import org.eclipse.jetty.spdy.api.StreamFrameListener;
-import org.eclipse.jetty.spdy.api.SynInfo;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.util.Callback;
-
-/**
- * <p>The internal interface that represents a stream.</p>
- * <p>{@link IStream} contains additional methods used by a SPDY
- * implementation (and not by an application).</p>
- */
-public interface IStream extends Stream, Callback
-{
- /**
- * <p>Senders of data frames need to know the current window size
- * to determine whether they can send more data.</p>
- *
- * @return the current window size for this stream.
- * @see #updateWindowSize(int)
- */
- public int getWindowSize();
-
- /**
- * <p>Updates the window size for this stream by the given amount,
- * that can be positive or negative.</p>
- * <p>Senders and recipients of data frames update the window size,
- * respectively, with negative values and positive values.</p>
- *
- * @param delta the signed amount the window size needs to be updated
- * @see #getWindowSize()
- */
- public void updateWindowSize(int delta);
-
- /**
- * @param listener the stream frame listener associated to this stream
- * as returned by {@link SessionFrameListener#onSyn(Stream, SynInfo)}
- */
- public void setStreamFrameListener(StreamFrameListener listener);
-
- /**
- * @return the stream frame listener associated to this stream
- */
- public StreamFrameListener getStreamFrameListener();
-
- /**
- * <p>A stream can be open, {@link #isHalfClosed() half closed} or
- * {@link #isClosed() closed} and this method updates the close state
- * of this stream.</p>
- * <p>If the stream is open, calling this method with a value of true
- * puts the stream into half closed state.</p>
- * <p>If the stream is half closed, calling this method with a value
- * of true puts the stream into closed state.</p>
- *
- * @param close whether the close state should be updated
- * @param local whether the close is local or remote
- */
- public void updateCloseState(boolean close, boolean local);
-
- /**
- * <p>Processes the given control frame,
- * for example by updating the stream's state or by calling listeners.</p>
- *
- * @param frame the control frame to process
- * @see #process(DataInfo)
- */
- public void process(ControlFrame frame);
-
- /**
- * <p>Processes the given {@code dataInfo},
- * for example by updating the stream's state or by calling listeners.</p>
- *
- * @param dataInfo the DataInfo to process
- * @see #process(ControlFrame)
- */
- public void process(DataInfo dataInfo);
-
- /**
- * <p>Associate the given {@link IStream} to this {@link IStream}.</p>
- *
- * @param stream the stream to associate with this stream
- */
- public void associate(IStream stream);
-
- /**
- * <p>remove the given associated {@link IStream} from this stream</p>
- *
- * @param stream the stream to be removed
- */
- public void disassociate(IStream stream);
-
- /**
- * <p>Overrides Stream.getAssociatedStream() to return an instance of IStream instead of Stream
- *
- * @see Stream#getAssociatedStream()
- */
- @Override
- public IStream getAssociatedStream();
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java
deleted file mode 100644
index f674ddde6f..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-public interface IdleListener
-{
- public void onIdle(boolean idle);
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java
deleted file mode 100644
index 0755515b99..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import org.eclipse.jetty.spdy.api.PushInfo;
-import org.eclipse.jetty.spdy.api.SynInfo;
-
-/* ------------------------------------------------------------ */
-/**
- * <p>A subclass container of {@link SynInfo} for unidirectional streams</p>
- */
-public class PushSynInfo extends SynInfo
-{
- public static final byte FLAG_UNIDIRECTIONAL = 2;
-
- private int associatedStreamId;
-
- public PushSynInfo(int associatedStreamId, PushInfo pushInfo){
- super(pushInfo.getTimeout(), pushInfo.getUnit(), pushInfo.getHeaders(), pushInfo.isClose(), (byte)0);
- this.associatedStreamId = associatedStreamId;
- }
-
- /**
- * @return the close and unidirectional flags as integer
- * @see #FLAG_CLOSE
- * @see #FLAG_UNIDIRECTIONAL
- */
- @Override
- public byte getFlags()
- {
- byte flags = super.getFlags();
- flags += FLAG_UNIDIRECTIONAL;
- return flags;
- }
-
- /**
- * @return the id of the associated stream
- */
- public int getAssociatedStreamId()
- {
- return associatedStreamId;
- }
-
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java
deleted file mode 100644
index a6205ebdf7..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.api.Stream;
-import org.eclipse.jetty.spdy.frames.WindowUpdateFrame;
-import org.eclipse.jetty.util.Callback;
-
-public class SPDYv3FlowControlStrategy implements FlowControlStrategy
-{
- private volatile int windowSize;
-
- @Override
- public int getWindowSize(ISession session)
- {
- return windowSize;
- }
-
- @Override
- public void setWindowSize(ISession session, int windowSize)
- {
- int prevWindowSize = this.windowSize;
- this.windowSize = windowSize;
- for (Stream stream : session.getStreams())
- ((IStream)stream).updateWindowSize(windowSize - prevWindowSize);
- }
-
- @Override
- public void onNewStream(ISession session, IStream stream)
- {
- stream.updateWindowSize(windowSize);
- }
-
- @Override
- public void onWindowUpdate(ISession session, IStream stream, int delta)
- {
- if (stream != null)
- stream.updateWindowSize(delta);
- }
-
- @Override
- public void updateWindow(ISession session, IStream stream, int delta)
- {
- stream.updateWindowSize(delta);
- }
-
- @Override
- public void onDataReceived(ISession session, IStream stream, DataInfo dataInfo)
- {
- // Do nothing
- }
-
- @Override
- public void onDataConsumed(ISession session, IStream stream, DataInfo dataInfo, int delta)
- {
- // This is the algorithm for flow control.
- // This method may be called multiple times with delta=1, but we only send a window
- // update when the whole dataInfo has been consumed.
- // Other policies may be to send window updates when consumed() is greater than
- // a certain threshold, etc. but for now the policy is not pluggable for simplicity.
- // Note that the frequency of window updates depends on the read buffer, that
- // should not be too smaller than the window size to avoid frequent window updates.
- // Therefore, a pluggable policy should be able to modify the read buffer capacity.
- int length = dataInfo.length();
- if (dataInfo.consumed() == length && !stream.isClosed() && length > 0)
- {
- WindowUpdateFrame windowUpdateFrame = new WindowUpdateFrame(session.getVersion(), stream.getId(), length);
- session.control(stream, windowUpdateFrame, 0, TimeUnit.MILLISECONDS, Callback.Adapter.INSTANCE);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java
deleted file mode 100644
index 7e4ac31832..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import org.eclipse.jetty.spdy.api.SessionStatus;
-
-public class SessionException extends RuntimeException
-{
- private final SessionStatus sessionStatus;
-
- public SessionException(SessionStatus sessionStatus)
- {
- this.sessionStatus = sessionStatus;
- }
-
- public SessionException(SessionStatus sessionStatus, String message)
- {
- super(message);
- this.sessionStatus = sessionStatus;
- }
-
- public SessionException(SessionStatus sessionStatus, Throwable cause)
- {
- super(cause);
- this.sessionStatus = sessionStatus;
- }
-
- public SessionStatus getSessionStatus()
- {
- return sessionStatus;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java
deleted file mode 100644
index 1630f4a86e..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.util.zip.DataFormatException;
-import java.util.zip.Deflater;
-import java.util.zip.Inflater;
-import java.util.zip.ZipException;
-
-public class StandardCompressionFactory implements CompressionFactory
-{
- @Override
- public Compressor newCompressor()
- {
- return new StandardCompressor();
- }
-
- @Override
- public Decompressor newDecompressor()
- {
- return new StandardDecompressor();
- }
-
- public static class StandardCompressor implements Compressor
- {
- private final Deflater deflater = new Deflater();
-
- @Override
- public void setInput(byte[] input)
- {
- deflater.setInput(input);
- }
-
- @Override
- public void setDictionary(byte[] dictionary)
- {
- deflater.setDictionary(dictionary);
- }
-
- @Override
- public int compress(byte[] output)
- {
- return deflater.deflate(output, 0, output.length, Deflater.SYNC_FLUSH);
- }
- }
-
- public static class StandardDecompressor implements CompressionFactory.Decompressor
- {
- private final Inflater inflater = new Inflater();
-
- @Override
- public void setDictionary(byte[] dictionary)
- {
- inflater.setDictionary(dictionary);
- }
-
- @Override
- public void setInput(byte[] input)
- {
- inflater.setInput(input);
- }
-
- @Override
- public int decompress(byte[] output) throws ZipException
- {
- try
- {
- return inflater.inflate(output);
- }
- catch (DataFormatException x)
- {
- throw (ZipException)new ZipException().initCause(x);
- }
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
deleted file mode 100644
index 0982271ebe..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
+++ /dev/null
@@ -1,1303 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.InterruptedByTimeoutException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.spdy.api.ByteBufferDataInfo;
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.api.GoAwayInfo;
-import org.eclipse.jetty.spdy.api.GoAwayResultInfo;
-import org.eclipse.jetty.spdy.api.PingInfo;
-import org.eclipse.jetty.spdy.api.PingResultInfo;
-import org.eclipse.jetty.spdy.api.PushInfo;
-import org.eclipse.jetty.spdy.api.RstInfo;
-import org.eclipse.jetty.spdy.api.SPDYException;
-import org.eclipse.jetty.spdy.api.Session;
-import org.eclipse.jetty.spdy.api.SessionFrameListener;
-import org.eclipse.jetty.spdy.api.SessionStatus;
-import org.eclipse.jetty.spdy.api.Settings;
-import org.eclipse.jetty.spdy.api.SettingsInfo;
-import org.eclipse.jetty.spdy.api.Stream;
-import org.eclipse.jetty.spdy.api.StreamFrameListener;
-import org.eclipse.jetty.spdy.api.StreamStatus;
-import org.eclipse.jetty.spdy.api.SynInfo;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.ControlFrameType;
-import org.eclipse.jetty.spdy.frames.CredentialFrame;
-import org.eclipse.jetty.spdy.frames.DataFrame;
-import org.eclipse.jetty.spdy.frames.GoAwayFrame;
-import org.eclipse.jetty.spdy.frames.HeadersFrame;
-import org.eclipse.jetty.spdy.frames.PingFrame;
-import org.eclipse.jetty.spdy.frames.RstStreamFrame;
-import org.eclipse.jetty.spdy.frames.SettingsFrame;
-import org.eclipse.jetty.spdy.frames.SynReplyFrame;
-import org.eclipse.jetty.spdy.frames.SynStreamFrame;
-import org.eclipse.jetty.spdy.frames.WindowUpdateFrame;
-import org.eclipse.jetty.spdy.generator.Generator;
-import org.eclipse.jetty.spdy.parser.Parser;
-import org.eclipse.jetty.util.Atomics;
-import org.eclipse.jetty.util.BufferUtil;
-import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.util.FutureCallback;
-import org.eclipse.jetty.util.FuturePromise;
-import org.eclipse.jetty.util.Promise;
-import org.eclipse.jetty.util.component.ContainerLifeCycle;
-import org.eclipse.jetty.util.component.Dumpable;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-import org.eclipse.jetty.util.thread.Scheduler;
-
-public class StandardSession implements ISession, Parser.Listener, Dumpable
-{
- private static final Logger LOG = Log.getLogger(Session.class);
-
- private final Flusher flusher;
- private final Map<String, Object> attributes = new ConcurrentHashMap<>();
- private final List<Listener> listeners = new CopyOnWriteArrayList<>();
- private final ConcurrentMap<Integer, IStream> streams = new ConcurrentHashMap<>();
- private final ByteBufferPool bufferPool;
- private final Scheduler scheduler;
- private final short version;
- private final Controller controller;
- private final EndPoint endPoint;
- private final IdleListener idleListener;
- private final AtomicInteger streamIds;
- private final AtomicInteger pingIds;
- private final SessionFrameListener listener;
- private final Generator generator;
- private final AtomicBoolean goAwaySent = new AtomicBoolean();
- private final AtomicBoolean goAwayReceived = new AtomicBoolean();
- private final AtomicInteger lastStreamId = new AtomicInteger();
- private final AtomicInteger localStreamCount = new AtomicInteger(0);
- private final FlowControlStrategy flowControlStrategy;
- private volatile int maxConcurrentLocalStreams = -1;
-
- public StandardSession(short version, ByteBufferPool bufferPool, Scheduler scheduler,
- Controller controller, EndPoint endPoint, IdleListener idleListener, int initialStreamId,
- SessionFrameListener listener, Generator generator, FlowControlStrategy flowControlStrategy)
- {
- // TODO this should probably be an aggregate lifecycle
- this.version = version;
- this.bufferPool = bufferPool;
- this.scheduler = scheduler;
- this.controller = controller;
- this.endPoint = endPoint;
- this.idleListener = idleListener;
- this.streamIds = new AtomicInteger(initialStreamId);
- this.pingIds = new AtomicInteger(initialStreamId);
- this.listener = listener;
- this.generator = generator;
- this.flowControlStrategy = flowControlStrategy;
- this.flusher = new Flusher(controller);
- }
-
- @Override
- public short getVersion()
- {
- return version;
- }
-
- @Override
- public void addListener(Listener listener)
- {
- listeners.add(listener);
- }
-
- @Override
- public void removeListener(Listener listener)
- {
- listeners.remove(listener);
- }
-
- @Override
- public Stream syn(SynInfo synInfo, StreamFrameListener listener) throws ExecutionException, InterruptedException, TimeoutException
- {
- FuturePromise<Stream> result = new FuturePromise<>();
- syn(synInfo, listener, result);
- if (synInfo.getTimeout() > 0)
- return result.get(synInfo.getTimeout(), synInfo.getUnit());
- else
- return result.get();
- }
-
- @Override
- public void syn(SynInfo synInfo, StreamFrameListener listener, Promise<Stream> promise)
- {
- // Synchronization is necessary.
- // SPEC v3, 2.3.1 requires that the stream creation be monotonically crescent
- // so we cannot allow thread1 to create stream1 and thread2 create stream3 and
- // have stream3 hit the network before stream1, not only to comply with the spec
- // but also because the compression context for the headers would be wrong, as the
- // frame with a compression history will come before the first compressed frame.
- int associatedStreamId = 0;
- if (synInfo instanceof PushSynInfo)
- associatedStreamId = ((PushSynInfo)synInfo).getAssociatedStreamId();
-
- synchronized (this)
- {
- int streamId = streamIds.getAndAdd(2);
- // TODO: for SPDYv3 we need to support the "slot" argument
- SynStreamFrame synStream = new SynStreamFrame(version, synInfo.getFlags(), streamId, associatedStreamId, synInfo.getPriority(), (short)0, synInfo.getHeaders());
- IStream stream = createStream(synStream, listener, true, promise);
- if (stream == null)
- return;
- generateAndEnqueueControlFrame(stream, synStream, synInfo.getTimeout(), synInfo.getUnit(), stream);
- }
- }
-
- @Override
- public void rst(RstInfo rstInfo) throws InterruptedException, ExecutionException, TimeoutException
- {
- FutureCallback result = new FutureCallback();
- rst(rstInfo, result);
- if (rstInfo.getTimeout() > 0)
- result.get(rstInfo.getTimeout(), rstInfo.getUnit());
- else
- result.get();
- }
-
- @Override
- public void rst(RstInfo rstInfo, Callback callback)
- {
- // SPEC v3, 2.2.2
- if (goAwaySent.get())
- {
- complete(callback);
- }
- else
- {
- int streamId = rstInfo.getStreamId();
- IStream stream = streams.get(streamId);
- RstStreamFrame frame = new RstStreamFrame(version, streamId, rstInfo.getStreamStatus().getCode(version));
- control(stream, frame, rstInfo.getTimeout(), rstInfo.getUnit(), callback);
- if (stream != null)
- {
- stream.process(frame);
- flusher.removeFrameBytesFromQueue(stream);
- removeStream(stream);
- }
- }
- }
-
- @Override
- public void settings(SettingsInfo settingsInfo) throws ExecutionException, InterruptedException, TimeoutException
- {
- FutureCallback result = new FutureCallback();
- settings(settingsInfo, result);
- if (settingsInfo.getTimeout() > 0)
- result.get(settingsInfo.getTimeout(), settingsInfo.getUnit());
- else
- result.get();
- }
-
- @Override
- public void settings(SettingsInfo settingsInfo, Callback callback)
- {
- SettingsFrame frame = new SettingsFrame(version, settingsInfo.getFlags(), settingsInfo.getSettings());
- control(null, frame, settingsInfo.getTimeout(), settingsInfo.getUnit(), callback);
- }
-
- @Override
- public PingResultInfo ping(PingInfo pingInfo) throws ExecutionException, InterruptedException, TimeoutException
- {
- FuturePromise<PingResultInfo> result = new FuturePromise<>();
- ping(pingInfo, result);
- if (pingInfo.getTimeout() > 0)
- return result.get(pingInfo.getTimeout(), pingInfo.getUnit());
- else
- return result.get();
- }
-
- @Override
- public void ping(PingInfo pingInfo, Promise<PingResultInfo> promise)
- {
- int pingId = pingIds.getAndAdd(2);
- PingInfoCallback pingInfoCallback = new PingInfoCallback(pingId, promise);
- PingFrame frame = new PingFrame(version, pingId);
- control(null, frame, pingInfo.getTimeout(), pingInfo.getUnit(), pingInfoCallback);
- }
-
- @Override
- public void goAway(GoAwayInfo goAwayInfo) throws ExecutionException, InterruptedException, TimeoutException
- {
- goAway(goAwayInfo, SessionStatus.OK);
- }
-
- private void goAway(GoAwayInfo goAwayInfo, SessionStatus sessionStatus) throws ExecutionException, InterruptedException, TimeoutException
- {
- FutureCallback result = new FutureCallback();
- goAway(sessionStatus, goAwayInfo.getTimeout(), goAwayInfo.getUnit(), result);
- if (goAwayInfo.getTimeout() > 0)
- result.get(goAwayInfo.getTimeout(), goAwayInfo.getUnit());
- else
- result.get();
- }
-
- @Override
- public void goAway(GoAwayInfo goAwayInfo, Callback callback)
- {
- goAway(SessionStatus.OK, goAwayInfo.getTimeout(), goAwayInfo.getUnit(), callback);
- }
-
- private void goAway(SessionStatus sessionStatus, long timeout, TimeUnit unit, Callback callback)
- {
- if (goAwaySent.compareAndSet(false, true))
- {
- if (!goAwayReceived.get())
- {
- GoAwayFrame frame = new GoAwayFrame(version, lastStreamId.get(), sessionStatus.getCode());
- control(null, frame, timeout, unit, callback);
- return;
- }
- }
- complete(callback);
- }
-
- @Override
- public Set<Stream> getStreams()
- {
- Set<Stream> result = new HashSet<>();
- result.addAll(streams.values());
- return result;
- }
-
- @Override
- public IStream getStream(int streamId)
- {
- return streams.get(streamId);
- }
-
- @Override
- public Object getAttribute(String key)
- {
- return attributes.get(key);
- }
-
- @Override
- public void setAttribute(String key, Object value)
- {
- attributes.put(key, value);
- }
-
- @Override
- public Object removeAttribute(String key)
- {
- return attributes.remove(key);
- }
-
- @Override
- public InetSocketAddress getLocalAddress()
- {
- return endPoint.getLocalAddress();
- }
-
- @Override
- public InetSocketAddress getRemoteAddress()
- {
- return endPoint.getRemoteAddress();
- }
-
- @Override
- public void onControlFrame(ControlFrame frame)
- {
- notifyIdle(idleListener, false);
- try
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Processing {}", frame);
-
- if (goAwaySent.get())
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Skipped processing of {}", frame);
- return;
- }
-
- switch (frame.getType())
- {
- case SYN_STREAM:
- {
- onSyn((SynStreamFrame)frame);
- break;
- }
- case SYN_REPLY:
- {
- onReply((SynReplyFrame)frame);
- break;
- }
- case RST_STREAM:
- {
- onRst((RstStreamFrame)frame);
- break;
- }
- case SETTINGS:
- {
- onSettings((SettingsFrame)frame);
- break;
- }
- case NOOP:
- {
- // Just ignore it
- break;
- }
- case PING:
- {
- onPing((PingFrame)frame);
- break;
- }
- case GO_AWAY:
- {
- onGoAway((GoAwayFrame)frame);
- break;
- }
- case HEADERS:
- {
- onHeaders((HeadersFrame)frame);
- break;
- }
- case WINDOW_UPDATE:
- {
- onWindowUpdate((WindowUpdateFrame)frame);
- break;
- }
- case CREDENTIAL:
- {
- onCredential((CredentialFrame)frame);
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- finally
- {
- notifyIdle(idleListener, true);
- }
- }
-
- @Override
- public void onDataFrame(DataFrame frame, ByteBuffer data)
- {
- notifyIdle(idleListener, false);
- try
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Processing {}, {} data bytes", frame, data.remaining());
-
- if (goAwaySent.get())
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Skipped processing of {}", frame);
- return;
- }
-
- int streamId = frame.getStreamId();
- IStream stream = streams.get(streamId);
- if (stream == null)
- {
- RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
- if (LOG.isDebugEnabled())
- LOG.debug("Unknown stream {}", rstInfo);
- rst(rstInfo, Callback.Adapter.INSTANCE);
- }
- else
- {
- processData(stream, frame, data);
- }
- }
- finally
- {
- notifyIdle(idleListener, true);
- }
- }
-
- private void notifyIdle(IdleListener listener, boolean idle)
- {
- if (listener != null)
- listener.onIdle(idle);
- }
-
- private void processData(final IStream stream, DataFrame frame, ByteBuffer data)
- {
- ByteBufferDataInfo dataInfo = new ByteBufferDataInfo(data, frame.isClose())
- {
- @Override
- public void consume(int delta)
- {
- super.consume(delta);
- flowControlStrategy.onDataConsumed(StandardSession.this, stream, this, delta);
- }
- };
- flowControlStrategy.onDataReceived(this, stream, dataInfo);
- stream.process(dataInfo);
- if (stream.isClosed())
- removeStream(stream);
- }
-
- @Override
- public void onStreamException(StreamException x)
- {
- notifyOnFailure(listener, x); // TODO: notify StreamFrameListener if exists?
- rst(new RstInfo(x.getStreamId(), x.getStreamStatus()), Callback.Adapter.INSTANCE);
- }
-
- @Override
- public void onSessionException(SessionException x)
- {
- Throwable cause = x.getCause();
- notifyOnFailure(listener, cause == null ? x : cause);
- goAway(x.getSessionStatus(), 0, TimeUnit.SECONDS, Callback.Adapter.INSTANCE);
- }
-
- private void onSyn(final SynStreamFrame frame)
- {
- IStream stream = createStream(frame, null, false, new Promise.Adapter<Stream>()
- {
- @Override
- public void failed(Throwable x)
- {
- LOG.debug("Received: {} but creating new Stream failed: {}", frame, x.getMessage());
- }
- });
- if (stream != null)
- processSyn(listener, stream, frame);
- }
-
- private void processSyn(SessionFrameListener listener, IStream stream, SynStreamFrame frame)
- {
- stream.process(frame);
- // Update the last stream id before calling the application (which may send a GO_AWAY)
- updateLastStreamId(stream);
- StreamFrameListener streamListener;
- if (stream.isUnidirectional())
- {
- PushInfo pushInfo = new PushInfo(frame.getHeaders(), frame.isClose());
- streamListener = notifyOnPush(stream.getAssociatedStream().getStreamFrameListener(), stream, pushInfo);
- }
- else
- {
- SynInfo synInfo = new SynInfo(frame.getHeaders(), frame.isClose(), frame.getPriority());
- streamListener = notifyOnSyn(listener, stream, synInfo);
- }
- stream.setStreamFrameListener(streamListener);
- // The onSyn() listener may have sent a frame that closed the stream
- if (stream.isClosed())
- removeStream(stream);
- }
-
- private IStream createStream(SynStreamFrame frame, StreamFrameListener listener, boolean local, Promise<Stream> promise)
- {
- IStream associatedStream = streams.get(frame.getAssociatedStreamId());
- IStream stream = new StandardStream(frame.getStreamId(), frame.getPriority(), this, associatedStream,
- scheduler, promise);
- stream.setIdleTimeout(endPoint.getIdleTimeout());
- flowControlStrategy.onNewStream(this, stream);
-
- stream.updateCloseState(frame.isClose(), local);
- stream.setStreamFrameListener(listener);
-
- if (stream.isUnidirectional())
- {
- // Unidirectional streams are implicitly half closed
- stream.updateCloseState(true, !local);
- if (!stream.isClosed())
- stream.getAssociatedStream().associate(stream);
- }
-
- int streamId = stream.getId();
-
- if (local)
- {
- while (true)
- {
- int oldStreamCountValue = localStreamCount.get();
- int maxConcurrentStreams = maxConcurrentLocalStreams;
- if (maxConcurrentStreams > -1 && oldStreamCountValue >= maxConcurrentStreams)
- {
- String message = String.format("Max concurrent local streams (%d) exceeded.",
- maxConcurrentStreams);
- LOG.debug(message);
- promise.failed(new SPDYException(message));
- return null;
- }
- if (localStreamCount.compareAndSet(oldStreamCountValue, oldStreamCountValue + 1))
- break;
- }
- }
-
- if (streams.putIfAbsent(streamId, stream) != null)
- {
- String message = "Duplicate stream id " + streamId;
- IllegalStateException duplicateIdException = new IllegalStateException(message);
- promise.failed(duplicateIdException);
- if (local)
- {
- localStreamCount.decrementAndGet();
- throw duplicateIdException;
- }
- RstInfo rstInfo = new RstInfo(streamId, StreamStatus.PROTOCOL_ERROR);
- if (LOG.isDebugEnabled())
- LOG.debug("Duplicate stream, {}", rstInfo);
- rst(rstInfo, Callback.Adapter.INSTANCE); // We don't care (too much) if the reset fails.
- return null;
- }
- else
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Created {}", stream);
- notifyStreamCreated(stream);
- return stream;
- }
- }
-
- private void notifyStreamCreated(IStream stream)
- {
- for (Listener listener : listeners)
- {
- if (listener instanceof StreamListener)
- {
- try
- {
- ((StreamListener)listener).onStreamCreated(stream);
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
- }
- }
-
- private void removeStream(IStream stream)
- {
- if (stream.isUnidirectional())
- stream.getAssociatedStream().disassociate(stream);
-
- IStream removed = streams.remove(stream.getId());
- if (removed != null)
- {
- assert removed == stream;
-
- if (streamIds.get() % 2 == stream.getId() % 2)
- localStreamCount.decrementAndGet();
-
- if (LOG.isDebugEnabled())
- LOG.debug("Removed {}", stream);
- notifyStreamClosed(stream);
- }
- }
-
- private void notifyStreamClosed(IStream stream)
- {
- for (Listener listener : listeners)
- {
- if (listener instanceof StreamListener)
- {
- try
- {
- ((StreamListener)listener).onStreamClosed(stream);
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
- }
- }
-
- private void onReply(SynReplyFrame frame)
- {
- int streamId = frame.getStreamId();
- IStream stream = streams.get(streamId);
- if (stream == null)
- {
- RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
- if (LOG.isDebugEnabled())
- LOG.debug("Unknown stream {}", rstInfo);
- rst(rstInfo, Callback.Adapter.INSTANCE);
- }
- else
- {
- processReply(stream, frame);
- }
- }
-
- private void processReply(IStream stream, SynReplyFrame frame)
- {
- stream.process(frame);
- if (stream.isClosed())
- removeStream(stream);
- }
-
- private void onRst(RstStreamFrame frame)
- {
- IStream stream = streams.get(frame.getStreamId());
-
- if (stream != null)
- stream.process(frame);
-
- RstInfo rstInfo = new RstInfo(frame.getStreamId(), StreamStatus.from(frame.getVersion(), frame.getStatusCode()));
- notifyOnRst(listener, rstInfo);
-
- if (stream != null)
- removeStream(stream);
- }
-
- private void onSettings(SettingsFrame frame)
- {
- Settings.Setting windowSizeSetting = frame.getSettings().get(Settings.ID.INITIAL_WINDOW_SIZE);
- if (windowSizeSetting != null)
- {
- int windowSize = windowSizeSetting.value();
- setWindowSize(windowSize);
- if (LOG.isDebugEnabled())
- LOG.debug("Updated session window size to {}", windowSize);
- }
- Settings.Setting maxConcurrentStreamsSetting = frame.getSettings().get(Settings.ID.MAX_CONCURRENT_STREAMS);
- if (maxConcurrentStreamsSetting != null)
- {
- int maxConcurrentStreamsValue = maxConcurrentStreamsSetting.value();
- maxConcurrentLocalStreams = maxConcurrentStreamsValue;
- if (LOG.isDebugEnabled())
- LOG.debug("Updated session maxConcurrentLocalStreams to {}", maxConcurrentStreamsValue);
- }
- SettingsInfo settingsInfo = new SettingsInfo(frame.getSettings(), frame.isClearPersisted());
- notifyOnSettings(listener, settingsInfo);
- }
-
- private void onPing(PingFrame frame)
- {
- int pingId = frame.getPingId();
- if (pingId % 2 == pingIds.get() % 2)
- {
- PingResultInfo pingResultInfo = new PingResultInfo(frame.getPingId());
- notifyOnPing(listener, pingResultInfo);
- }
- else
- {
- control(null, frame, 0, TimeUnit.MILLISECONDS, Callback.Adapter.INSTANCE);
- }
- }
-
- private void onGoAway(GoAwayFrame frame)
- {
- if (goAwayReceived.compareAndSet(false, true))
- {
- GoAwayResultInfo goAwayResultInfo = new GoAwayResultInfo(frame.getLastStreamId(), SessionStatus.from(frame.getStatusCode()));
- notifyOnGoAway(listener, goAwayResultInfo);
- // SPDY does not require to send back a response to a GO_AWAY.
- // We notified the application of the last good stream id and
- // tried our best to flush remaining data.
- }
- }
-
- private void onHeaders(HeadersFrame frame)
- {
- int streamId = frame.getStreamId();
- IStream stream = streams.get(streamId);
- if (stream == null)
- {
- RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
- if (LOG.isDebugEnabled())
- LOG.debug("Unknown stream, {}", rstInfo);
- rst(rstInfo, Callback.Adapter.INSTANCE);
- }
- else
- {
- processHeaders(stream, frame);
- }
- }
-
- private void processHeaders(IStream stream, HeadersFrame frame)
- {
- stream.process(frame);
- if (stream.isClosed())
- removeStream(stream);
- }
-
- private void onWindowUpdate(WindowUpdateFrame frame)
- {
- int streamId = frame.getStreamId();
- IStream stream = streams.get(streamId);
- flowControlStrategy.onWindowUpdate(this, stream, frame.getWindowDelta());
- flusher.flush();
- }
-
- private void onCredential(CredentialFrame frame)
- {
- LOG.warn("{} frame not yet supported", frame.getType());
- }
-
- protected void close()
- {
- // Check for null to support tests
- if (controller != null)
- controller.close(false);
- }
-
- private void notifyOnFailure(SessionFrameListener listener, Throwable x)
- {
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking callback with {} on listener {}", x, listener);
- listener.onFailure(this, x);
- }
- }
- catch (Exception xx)
- {
- LOG.info("Exception while notifying listener " + listener, xx);
- }
- catch (Error xx)
- {
- LOG.info("Exception while notifying listener " + listener, xx);
- throw xx;
- }
- }
-
- private StreamFrameListener notifyOnPush(StreamFrameListener listener, Stream stream, PushInfo pushInfo)
- {
- try
- {
- if (listener == null)
- return null;
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking callback with {} on listener {}", pushInfo, listener);
- return listener.onPush(stream, pushInfo);
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- return null;
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- private StreamFrameListener notifyOnSyn(SessionFrameListener listener, Stream stream, SynInfo synInfo)
- {
- try
- {
- if (listener == null)
- return null;
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking callback with {} on listener {}", synInfo, listener);
- return listener.onSyn(stream, synInfo);
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- return null;
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- private void notifyOnRst(SessionFrameListener listener, RstInfo rstInfo)
- {
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking callback with {} on listener {}", rstInfo, listener);
- listener.onRst(this, rstInfo);
- }
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- private void notifyOnSettings(SessionFrameListener listener, SettingsInfo settingsInfo)
- {
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking callback with {} on listener {}", settingsInfo, listener);
- listener.onSettings(this, settingsInfo);
- }
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- private void notifyOnPing(SessionFrameListener listener, PingResultInfo pingResultInfo)
- {
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking callback with {} on listener {}", pingResultInfo, listener);
- listener.onPing(this, pingResultInfo);
- }
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- private void notifyOnGoAway(SessionFrameListener listener, GoAwayResultInfo goAwayResultInfo)
- {
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking callback with {} on listener {}", goAwayResultInfo, listener);
- listener.onGoAway(this, goAwayResultInfo);
- }
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- @Override
- public void control(IStream stream, ControlFrame frame, long timeout, TimeUnit unit, Callback callback)
- {
- generateAndEnqueueControlFrame(stream, frame, timeout, unit, callback);
- }
-
- private void generateAndEnqueueControlFrame(IStream stream, ControlFrame frame, long timeout, TimeUnit unit, Callback callback)
- {
- try
- {
- // Synchronization is necessary, since we may have concurrent replies
- // and those needs to be generated and enqueued atomically in order
- // to maintain a correct compression context
- ControlFrameBytes frameBytes;
- Throwable throwable;
- synchronized (this)
- {
- ByteBuffer buffer = generator.control(frame);
- if (LOG.isDebugEnabled())
- LOG.debug("Queuing {} on {}", frame, stream);
- frameBytes = new ControlFrameBytes(stream, callback, frame, buffer);
- if (timeout > 0)
- frameBytes.task = scheduler.schedule(frameBytes, timeout, unit);
-
- // Special handling for PING frames, they must be sent as soon as possible
- if (ControlFrameType.PING == frame.getType())
- throwable = flusher.prepend(frameBytes);
- else
- throwable = flusher.append(frameBytes);
- }
- // Flush MUST be done outside synchronized blocks
- flush(frameBytes, throwable);
- }
- catch (Exception x)
- {
- notifyCallbackFailed(callback, x);
- }
- }
-
- private void updateLastStreamId(IStream stream)
- {
- int streamId = stream.getId();
- if (streamId % 2 != streamIds.get() % 2)
- Atomics.updateMax(lastStreamId, streamId);
- }
-
- @Override
- public void data(IStream stream, DataInfo dataInfo, long timeout, TimeUnit unit, Callback callback)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Queuing {} on {}", dataInfo, stream);
- DataFrameBytes frameBytes = new DataFrameBytes(stream, callback, dataInfo);
- if (timeout > 0)
- frameBytes.task = scheduler.schedule(frameBytes, timeout, unit);
- flush(frameBytes, flusher.append(frameBytes));
- }
-
- @Override
- public void shutdown()
- {
- CloseFrameBytes frameBytes = new CloseFrameBytes();
- flush(frameBytes, flusher.append(frameBytes));
- }
-
- private void flush(FrameBytes frameBytes, Throwable throwable)
- {
- if (throwable != null)
- frameBytes.failed(throwable);
- else
- flusher.flush();
- }
-
- private void complete(final Callback callback)
- {
- try
- {
- if (callback != null)
- callback.succeeded();
- }
- catch (Throwable x)
- {
- LOG.info("Exception while notifying callback " + callback, x);
- }
- }
-
- private void notifyCallbackFailed(Callback callback, Throwable failure)
- {
- try
- {
- if (callback != null)
- callback.failed(failure);
- }
- catch (Throwable x)
- {
- LOG.info("Exception while notifying callback " + callback, x);
- }
- }
-
- public int getWindowSize()
- {
- return flowControlStrategy.getWindowSize(this);
- }
-
- public void setWindowSize(int initialWindowSize)
- {
- flowControlStrategy.setWindowSize(this, initialWindowSize);
- }
-
- @Override
- public String toString()
- {
- return String.format("%s@%x{v%d,queueSize=%d,windowSize=%d,streams=%d}", getClass().getSimpleName(),
- hashCode(), version, flusher.getQueueSize(), getWindowSize(), streams.size());
- }
-
- @Override
- public String dump()
- {
- return ContainerLifeCycle.dump(this);
- }
-
- @Override
- public void dump(Appendable out, String indent) throws IOException
- {
- ContainerLifeCycle.dumpObject(out, this);
- ContainerLifeCycle.dump(out, indent, Collections.singletonList(controller), streams.values());
- }
-
- public interface FrameBytes extends Comparable<FrameBytes>, Callback
- {
- public IStream getStream();
-
- public abstract ByteBuffer getByteBuffer();
- }
-
- abstract class AbstractFrameBytes implements FrameBytes, Runnable
- {
- private final IStream stream;
- private final Callback callback;
- protected volatile Scheduler.Task task;
-
- protected AbstractFrameBytes(IStream stream, Callback callback)
- {
- this.stream = stream;
- this.callback = Objects.requireNonNull(callback);
- }
-
- @Override
- public IStream getStream()
- {
- return stream;
- }
-
- @Override
- public int compareTo(FrameBytes that)
- {
- // FrameBytes may have or not have a related stream (for example, PING do not have a related stream)
- // FrameBytes without related streams have higher priority
- IStream thisStream = getStream();
- IStream thatStream = that.getStream();
- if (thisStream == null)
- return thatStream == null ? 0 : -1;
- if (thatStream == null)
- return 1;
- // If this.stream.priority > that.stream.priority => this.stream has less priority than that.stream
- return thatStream.getPriority() - thisStream.getPriority();
- }
-
- private void cancelTask()
- {
- Scheduler.Task task = this.task;
- if (task != null)
- task.cancel();
- }
-
- @Override
- public void run()
- {
- close();
- failed(new InterruptedByTimeoutException());
- }
-
- @Override
- public void succeeded()
- {
- cancelTask();
- StandardSession.this.complete(callback);
- }
-
- @Override
- public void failed(Throwable x)
- {
- cancelTask();
- notifyCallbackFailed(callback, x);
- }
- }
-
- protected class ControlFrameBytes extends AbstractFrameBytes
- {
- private final ControlFrame frame;
- private final ByteBuffer buffer;
-
- private ControlFrameBytes(IStream stream, Callback callback, ControlFrame frame, ByteBuffer buffer)
- {
- super(stream, callback);
- this.frame = frame;
- this.buffer = buffer;
- }
-
- @Override
- public ByteBuffer getByteBuffer()
- {
- return buffer;
- }
-
- @Override
- public void succeeded()
- {
- bufferPool.release(buffer);
-
- super.succeeded();
-
- if (frame.getType() == ControlFrameType.GO_AWAY)
- {
- // After sending a GO_AWAY we need to hard close the connection.
- // Recipients will know the last good stream id and act accordingly.
- close();
- }
- IStream stream = getStream();
- if (stream != null && stream.isClosed())
- removeStream(stream);
- }
-
- @Override
- public String toString()
- {
- return frame.toString();
- }
- }
-
- protected class DataFrameBytes extends AbstractFrameBytes
- {
- private final DataInfo dataInfo;
- private int size;
- private volatile ByteBuffer buffer;
-
- private DataFrameBytes(IStream stream, Callback handler, DataInfo dataInfo)
- {
- super(stream, handler);
- this.dataInfo = dataInfo;
- }
-
- @Override
- public ByteBuffer getByteBuffer()
- {
- try
- {
- IStream stream = getStream();
- int windowSize = stream.getWindowSize();
-
- // TODO: optimization
- // Right now, we use the windowSize to chunk big buffers.
- // However, if the window size is large, we may congest the
- // connection, or favor one stream that does a big download,
- // starving the other streams.
- // Also, SPDY DATA frames have a maximum of 16 MiB size, which
- // is not enforced here.
- // We should have a configurable "preferredDataFrameSize"
- // (or even better autotuning) that will allow to send chunks
- // that will not starve other streams and small enough to
- // not congest the connection, while avoiding to send too many
- // TCP packets.
- // See also comment in class Flusher.
-
- size = dataInfo.available();
- if (size > windowSize)
- size = windowSize;
-
- buffer = generator.data(stream.getId(), size, dataInfo);
- return buffer;
- }
- catch (Throwable x)
- {
- failed(x);
- return null;
- }
- }
-
- @Override
- public void succeeded()
- {
- bufferPool.release(buffer);
- IStream stream = getStream();
- dataInfo.consume(size);
- flowControlStrategy.updateWindow(StandardSession.this, stream, -size);
- if (dataInfo.available() > 0)
- {
- // We have written a frame out of this DataInfo, but there is more to write.
- // We need to keep the correct ordering of frames, to avoid that another
- // DataInfo for the same stream is written before this one is finished.
- flush(this, flusher.prepend(this));
- }
- else
- {
- super.succeeded();
- stream.updateCloseState(dataInfo.isClose(), true);
- if (stream.isClosed())
- removeStream(stream);
- }
- }
-
- @Override
- public String toString()
- {
- return String.format("DATA bytes @%x available=%d consumed=%d on %s", dataInfo.hashCode(), dataInfo.available(), dataInfo.consumed(), getStream());
- }
- }
-
- protected class CloseFrameBytes extends AbstractFrameBytes
- {
- private CloseFrameBytes()
- {
- super(null, Callback.Adapter.INSTANCE);
- }
-
- @Override
- public ByteBuffer getByteBuffer()
- {
- return BufferUtil.EMPTY_BUFFER;
- }
-
- @Override
- public void succeeded()
- {
- super.succeeded();
- close();
- }
- }
-
- private static class PingInfoCallback extends PingResultInfo implements Callback
- {
- private final Promise<PingResultInfo> promise;
-
- public PingInfoCallback(int pingId, Promise<PingResultInfo> promise)
- {
- super(pingId);
- this.promise = promise;
- }
-
- @Override
- public void succeeded()
- {
- if (promise != null)
- promise.succeeded(this);
- }
-
- @Override
- public void failed(Throwable x)
- {
- if (promise != null)
- promise.failed(x);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
deleted file mode 100644
index 34670698f3..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
+++ /dev/null
@@ -1,602 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.eclipse.jetty.io.IdleTimeout;
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.api.HeadersInfo;
-import org.eclipse.jetty.spdy.api.PushInfo;
-import org.eclipse.jetty.spdy.api.ReplyInfo;
-import org.eclipse.jetty.spdy.api.RstInfo;
-import org.eclipse.jetty.spdy.api.Stream;
-import org.eclipse.jetty.spdy.api.StreamFrameListener;
-import org.eclipse.jetty.spdy.api.StreamStatus;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.HeadersFrame;
-import org.eclipse.jetty.spdy.frames.SynReplyFrame;
-import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.util.FutureCallback;
-import org.eclipse.jetty.util.FuturePromise;
-import org.eclipse.jetty.util.Promise;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-import org.eclipse.jetty.util.thread.Scheduler;
-
-public class StandardStream extends IdleTimeout implements IStream
-{
- private static final Logger LOG = Log.getLogger(Stream.class);
- private final Map<String, Object> attributes = new ConcurrentHashMap<>();
- private final int id;
- private final byte priority;
- private final ISession session;
- private final IStream associatedStream;
- private final Promise<Stream> promise;
- private final AtomicInteger windowSize = new AtomicInteger();
- private final Set<Stream> pushedStreams = Collections.newSetFromMap(new ConcurrentHashMap<Stream, Boolean>());
- private volatile StreamFrameListener listener;
- private volatile OpenState openState = OpenState.SYN_SENT;
- private volatile CloseState closeState = CloseState.OPENED;
- private volatile boolean reset = false;
-
- public StandardStream(int id, byte priority, ISession session, IStream associatedStream, Scheduler scheduler, Promise<Stream> promise)
- {
- super(scheduler);
- this.id = id;
- this.priority = priority;
- this.session = session;
- this.associatedStream = associatedStream;
- this.promise = promise;
- }
-
- @Override
- public int getId()
- {
- return id;
- }
-
- @Override
- public IStream getAssociatedStream()
- {
- return associatedStream;
- }
-
- @Override
- public Set<Stream> getPushedStreams()
- {
- return pushedStreams;
- }
-
- @Override
- public void associate(IStream stream)
- {
- pushedStreams.add(stream);
- }
-
- @Override
- public void disassociate(IStream stream)
- {
- pushedStreams.remove(stream);
- }
-
- @Override
- public byte getPriority()
- {
- return priority;
- }
-
- @Override
- protected void onIdleExpired(TimeoutException timeout)
- {
- StreamFrameListener listener = this.listener;
- if (listener != null)
- listener.onFailure(this, timeout);
- // The stream is now gone, we must close it to
- // avoid that its idle timeout is rescheduled.
- close();
- }
-
- private void close()
- {
- closeState = CloseState.CLOSED;
- onClose();
- }
-
- @Override
- public boolean isOpen()
- {
- return !isClosed();
- }
-
- @Override
- public int getWindowSize()
- {
- return windowSize.get();
- }
-
- @Override
- public void updateWindowSize(int delta)
- {
- int size = windowSize.addAndGet(delta);
- if (LOG.isDebugEnabled())
- LOG.debug("Updated window size {} -> {} for {}", size - delta, size, this);
- }
-
- @Override
- public ISession getSession()
- {
- return session;
- }
-
- @Override
- public Object getAttribute(String key)
- {
- return attributes.get(key);
- }
-
- @Override
- public void setAttribute(String key, Object value)
- {
- attributes.put(key, value);
- }
-
- @Override
- public Object removeAttribute(String key)
- {
- return attributes.remove(key);
- }
-
- @Override
- public void setStreamFrameListener(StreamFrameListener listener)
- {
- this.listener = listener;
- }
-
- @Override
- public StreamFrameListener getStreamFrameListener()
- {
- return listener;
- }
-
- @Override
- public void updateCloseState(boolean close, boolean local)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("{} close={} local={}", this, close, local);
- if (close)
- {
- switch (closeState)
- {
- case OPENED:
- {
- closeState = local ? CloseState.LOCALLY_CLOSED : CloseState.REMOTELY_CLOSED;
- break;
- }
- case LOCALLY_CLOSED:
- {
- if (local)
- throw new IllegalStateException();
- else
- close();
- break;
- }
- case REMOTELY_CLOSED:
- {
- if (local)
- close();
- else
- throw new IllegalStateException();
- break;
- }
- default:
- {
- LOG.warn("Already CLOSED! {} local={}", this, local);
- }
- }
- }
- }
-
- @Override
- public void process(ControlFrame frame)
- {
- notIdle();
- switch (frame.getType())
- {
- case SYN_STREAM:
- {
- openState = OpenState.SYN_RECV;
- break;
- }
- case SYN_REPLY:
- {
- openState = OpenState.REPLY_RECV;
- SynReplyFrame synReply = (SynReplyFrame)frame;
- updateCloseState(synReply.isClose(), false);
- ReplyInfo replyInfo = new ReplyInfo(synReply.getHeaders(), synReply.isClose());
- notifyOnReply(replyInfo);
- break;
- }
- case HEADERS:
- {
- HeadersFrame headers = (HeadersFrame)frame;
- updateCloseState(headers.isClose(), false);
- HeadersInfo headersInfo = new HeadersInfo(headers.getHeaders(), headers.isClose(), headers.isResetCompression());
- notifyOnHeaders(headersInfo);
- break;
- }
- case RST_STREAM:
- {
- reset = true;
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
-
- @Override
- public void process(DataInfo dataInfo)
- {
- notIdle();
- // TODO: in v3 we need to send a rst instead of just ignoring
- // ignore data frame if this stream is remotelyClosed already
- if (isRemotelyClosed())
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Stream is remotely closed, ignoring {}", dataInfo);
- return;
- }
-
- if (!canReceive())
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Protocol error receiving {}, resetting", dataInfo);
- session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), Callback.Adapter.INSTANCE);
- return;
- }
-
- updateCloseState(dataInfo.isClose(), false);
- notifyOnData(dataInfo);
- }
-
- @Override
- public void succeeded()
- {
- if (promise != null)
- promise.succeeded(this);
- }
-
- @Override
- public void failed(Throwable x)
- {
- if (promise != null)
- promise.failed(x);
- }
-
- private void notifyOnReply(ReplyInfo replyInfo)
- {
- final StreamFrameListener listener = this.listener;
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking reply callback with {} on listener {}", replyInfo, listener);
- listener.onReply(this, replyInfo);
- }
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- private void notifyOnHeaders(HeadersInfo headersInfo)
- {
- final StreamFrameListener listener = this.listener;
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking headers callback with {} on listener {}", headersInfo, listener);
- listener.onHeaders(this, headersInfo);
- }
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- private void notifyOnData(DataInfo dataInfo)
- {
- final StreamFrameListener listener = this.listener;
- try
- {
- if (listener != null)
- {
- if (LOG.isDebugEnabled())
- LOG.debug("Invoking data callback with {} on listener {}", dataInfo, listener);
- listener.onData(this, dataInfo);
- if (LOG.isDebugEnabled())
- LOG.debug("Invoked data callback with {} on listener {}", dataInfo, listener);
- }
- }
- catch (Exception x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- }
- catch (Error x)
- {
- LOG.info("Exception while notifying listener " + listener, x);
- throw x;
- }
- }
-
- @Override
- public Stream push(PushInfo pushInfo) throws InterruptedException, ExecutionException, TimeoutException
- {
- FuturePromise<Stream> result = new FuturePromise<>();
- push(pushInfo, result);
- if (pushInfo.getTimeout() > 0)
- return result.get(pushInfo.getTimeout(), pushInfo.getUnit());
- else
- return result.get();
- }
-
- @Override
- public void push(PushInfo pushInfo, Promise<Stream> promise)
- {
- notIdle();
- if (isClosed() || isReset())
- {
- close();
- promise.failed(new StreamException(getId(), StreamStatus.STREAM_ALREADY_CLOSED,
- "Stream: " + this + " already closed or reset!"));
- return;
- }
- PushSynInfo pushSynInfo = new PushSynInfo(getId(), pushInfo);
- session.syn(pushSynInfo, null, new StreamPromise(promise));
- }
-
- @Override
- public void reply(ReplyInfo replyInfo) throws InterruptedException, ExecutionException, TimeoutException
- {
- FutureCallback result = new FutureCallback();
- reply(replyInfo, result);
- if (replyInfo.getTimeout() > 0)
- result.get(replyInfo.getTimeout(), replyInfo.getUnit());
- else
- result.get();
- }
-
- @Override
- public void reply(ReplyInfo replyInfo, Callback callback)
- {
- notIdle();
- if (isUnidirectional())
- {
- close();
- throw new IllegalStateException("Protocol violation: cannot send SYN_REPLY frames in unidirectional streams");
- }
- openState = OpenState.REPLY_SENT;
- updateCloseState(replyInfo.isClose(), true);
- SynReplyFrame frame = new SynReplyFrame(session.getVersion(), replyInfo.getFlags(), getId(), replyInfo.getHeaders());
- session.control(this, frame, replyInfo.getTimeout(), replyInfo.getUnit(), new StreamCallback(callback));
- }
-
- @Override
- public void data(DataInfo dataInfo) throws InterruptedException, ExecutionException, TimeoutException
- {
- FutureCallback result = new FutureCallback();
- data(dataInfo, result);
- if (dataInfo.getTimeout() > 0)
- result.get(dataInfo.getTimeout(), dataInfo.getUnit());
- else
- result.get();
- }
-
- @Override
- public void data(DataInfo dataInfo, Callback callback)
- {
- notIdle();
- if (!canSend())
- {
- session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), new StreamCallback());
- throw new IllegalStateException("Protocol violation: cannot send a DATA frame before a SYN_REPLY frame");
- }
- if (isLocallyClosed())
- {
- session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), new StreamCallback());
- throw new IllegalStateException("Protocol violation: cannot send a DATA frame on a locally closed stream");
- }
-
- // Cannot update the close state here, because the data that we send may
- // be flow controlled, so we need the stream to update the window size.
- session.data(this, dataInfo, dataInfo.getTimeout(), dataInfo.getUnit(), new StreamCallback(callback));
- }
-
- @Override
- public void headers(HeadersInfo headersInfo) throws InterruptedException, ExecutionException, TimeoutException
- {
- FutureCallback result = new FutureCallback();
- headers(headersInfo, result);
- if (headersInfo.getTimeout() > 0)
- result.get(headersInfo.getTimeout(), headersInfo.getUnit());
- else
- result.get();
- }
-
- @Override
- public void headers(HeadersInfo headersInfo, Callback callback)
- {
- notIdle();
- if (!canSend())
- {
- session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), new StreamCallback());
- throw new IllegalStateException("Protocol violation: cannot send a HEADERS frame before a SYN_REPLY frame");
- }
- if (isLocallyClosed())
- {
- session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), new StreamCallback());
- throw new IllegalStateException("Protocol violation: cannot send a HEADERS frame on a closed stream");
- }
-
- updateCloseState(headersInfo.isClose(), true);
- HeadersFrame frame = new HeadersFrame(session.getVersion(), headersInfo.getFlags(), getId(), headersInfo.getHeaders());
- session.control(this, frame, headersInfo.getTimeout(), headersInfo.getUnit(), new StreamCallback(callback));
- }
-
- @Override
- public boolean isUnidirectional()
- {
- return associatedStream != null;
- }
-
- @Override
- public boolean isReset()
- {
- return reset;
- }
-
- @Override
- public boolean isHalfClosed()
- {
- CloseState closeState = this.closeState;
- return closeState == CloseState.LOCALLY_CLOSED || closeState == CloseState.REMOTELY_CLOSED || closeState == CloseState.CLOSED;
- }
-
- @Override
- public boolean isClosed()
- {
- return closeState == CloseState.CLOSED;
- }
-
- private boolean isLocallyClosed()
- {
- CloseState closeState = this.closeState;
- return closeState == CloseState.LOCALLY_CLOSED || closeState == CloseState.CLOSED;
- }
-
- private boolean isRemotelyClosed()
- {
- CloseState closeState = this.closeState;
- return closeState == CloseState.REMOTELY_CLOSED || closeState == CloseState.CLOSED;
- }
-
- @Override
- public String toString()
- {
- return String.format("stream=%d v%d windowSize=%d reset=%s prio=%d %s %s", getId(), session.getVersion(),
- getWindowSize(), isReset(), priority, openState, closeState);
- }
-
- private boolean canSend()
- {
- OpenState openState = this.openState;
- return openState == OpenState.SYN_SENT || openState == OpenState.REPLY_RECV || openState == OpenState.REPLY_SENT;
- }
-
- private boolean canReceive()
- {
- OpenState openState = this.openState;
- return openState == OpenState.SYN_RECV || openState == OpenState.REPLY_RECV || openState == OpenState.REPLY_SENT;
- }
-
- private enum OpenState
- {
- SYN_SENT, SYN_RECV, REPLY_SENT, REPLY_RECV
- }
-
- private enum CloseState
- {
- OPENED, LOCALLY_CLOSED, REMOTELY_CLOSED, CLOSED
- }
-
- private class StreamCallback implements Callback
- {
- private final Callback callback;
-
- private StreamCallback()
- {
- this(Callback.Adapter.INSTANCE);
- }
-
- private StreamCallback(Callback callback)
- {
- this.callback = callback;
- }
-
- @Override
- public void succeeded()
- {
- callback.succeeded();
- }
-
- @Override
- public void failed(Throwable x)
- {
- close();
- callback.failed(x);
- }
- }
-
- private class StreamPromise implements Promise<Stream>
- {
- private final Promise<Stream> promise;
-
- public StreamPromise(Promise<Stream> promise)
- {
- this.promise = promise;
- }
-
- @Override
- public void succeeded(Stream result)
- {
- promise.succeeded(result);
- }
-
- @Override
- public void failed(Throwable x)
- {
- close();
- promise.failed(x);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java
deleted file mode 100644
index 97aa70db23..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy;
-
-import org.eclipse.jetty.spdy.api.StreamStatus;
-
-public class StreamException extends RuntimeException
-{
- private final int streamId;
- private final StreamStatus streamStatus;
-
- public StreamException(int streamId, StreamStatus streamStatus)
- {
- this.streamId = streamId;
- this.streamStatus = streamStatus;
- }
-
- public StreamException(int streamId, StreamStatus streamStatus, String message)
- {
- super(message);
- this.streamId = streamId;
- this.streamStatus = streamStatus;
- }
-
- public int getStreamId()
- {
- return streamId;
- }
-
- public StreamStatus getStreamStatus()
- {
- return streamStatus;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java
deleted file mode 100644
index 0ac1bd5b44..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.nio.ByteBuffer;
-import java.util.concurrent.TimeUnit;
-
-/**
- * <p>Specialized {@link DataInfo} for {@link ByteBuffer} content.</p>
- */
-public class ByteBufferDataInfo extends DataInfo
-{
- private final ByteBuffer buffer;
- private final int length;
-
- public ByteBufferDataInfo(ByteBuffer buffer, boolean close)
- {
- this(0, TimeUnit.SECONDS, buffer, close);
- }
-
- public ByteBufferDataInfo(long timeout, TimeUnit unit, ByteBuffer buffer, boolean close)
- {
- super(timeout, unit, close);
- this.buffer = buffer;
- this.length = buffer.remaining();
- }
-
- @Override
- public int length()
- {
- return length;
- }
-
- @Override
- public int available()
- {
- return buffer.remaining();
- }
-
- @Override
- public int readInto(ByteBuffer output)
- {
- int space = output.remaining();
- if (available() > space)
- {
- int limit = buffer.limit();
- buffer.limit(buffer.position() + space);
- output.put(buffer);
- buffer.limit(limit);
- }
- else
- {
- space = buffer.remaining();
- output.put(buffer);
- }
- return space;
- }
-
- @Override
- public int readInto(byte[] bytes, int offset, int length)
- {
- int available = available();
- if (available < length)
- length = available;
- buffer.get(bytes, offset, length);
- return length;
- }
-
- @Override
- protected ByteBuffer allocate(int size)
- {
- return buffer.isDirect() ? ByteBuffer.allocateDirect(size) : super.allocate(size);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java
deleted file mode 100644
index ba67279ddd..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.nio.ByteBuffer;
-import java.util.concurrent.TimeUnit;
-
-/**
- * <p>Specialized {@link DataInfo} for byte array content.</p>
- */
-public class BytesDataInfo extends DataInfo
-{
- private final byte[] bytes;
- private final int offset;
- private final int length;
- private int index;
-
- public BytesDataInfo(byte[] bytes, boolean close)
- {
- this(0, TimeUnit.SECONDS, bytes, close);
- }
-
- public BytesDataInfo(long timeout, TimeUnit unit, byte[] bytes, boolean close)
- {
- this(timeout, unit, bytes, 0, bytes.length, close);
- }
-
- public BytesDataInfo(long timeout, TimeUnit unit, byte[] bytes, int offset, int length, boolean close)
- {
- super(timeout, unit, close);
- this.bytes = bytes;
- this.offset = offset;
- this.length = length;
- this.index = offset;
- }
-
- @Override
- public int length()
- {
- return length;
- }
-
- @Override
- public int available()
- {
- return length - index + offset;
- }
-
- @Override
- public int readInto(ByteBuffer output)
- {
- int space = output.remaining();
- int chunk = Math.min(available(), space);
- output.put(bytes, index, chunk);
- index += chunk;
- return chunk;
- }
-
- @Override
- public int readInto(byte[] bytes, int offset, int length)
- {
- int chunk = Math.min(available(), length);
- System.arraycopy(this.bytes, index, bytes, offset, chunk);
- index += chunk;
- return chunk;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java
deleted file mode 100644
index 067c9e7ec6..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java
+++ /dev/null
@@ -1,264 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * <p>A container for DATA frames metadata and content bytes.</p>
- * <p>Specialized subclasses (like {@link StringDataInfo}) may be used by applications
- * to send specific types of content.</p>
- * <p>Applications may send multiple instances of {@link DataInfo}, usually of the same
- * type, via {@link Stream#data(DataInfo)}. The last instance must have the
- * {@link #isClose() close flag} set, so that the client knows that no more content is
- * expected.</p>
- * <p>Receivers of {@link DataInfo} via {@link StreamFrameListener#onData(Stream, DataInfo)}
- * have two different APIs to read the data content bytes: a {@link #readInto(ByteBuffer) read}
- * API that does not interact with flow control, and a {@link #consumeInto(ByteBuffer) drain}
- * API that interacts with flow control.</p>
- * <p>Flow control is defined so that when the sender wants to sends a number of bytes larger
- * than the {@link Settings.ID#INITIAL_WINDOW_SIZE} value, it will stop sending as soon as it
- * has sent a number of bytes equal to the window size. The receiver has to <em>consume</em>
- * the data bytes that it received in order to tell the sender to send more bytes.</p>
- * <p>Consuming the data bytes can be done only via {@link #consumeInto(ByteBuffer)} or by a combination
- * of {@link #readInto(ByteBuffer)} and {@link #consume(int)} (possibly at different times).</p>
- */
-public abstract class DataInfo extends Info
-{
- /**
- * <p>Flag that indicates that this {@link DataInfo} is the last frame in the stream.</p>
- *
- * @see #isClose()
- * @see #getFlags()
- */
- public final static byte FLAG_CLOSE = 1;
-
- private final AtomicInteger consumed = new AtomicInteger();
- private boolean close;
-
- /**
- * <p>Creates a new {@link DataInfo} with the given close flag and no compression flag.</p>
- *
- * @param close the value of the close flag
- */
- public DataInfo(boolean close)
- {
- setClose(close);
- }
-
- /**
- * <p>Creates a new {@link DataInfo} with the given close flag and no compression flag.</p>
- *
- * @param timeout
- * @param unit
- * @param close the value of the close flag
- */
- protected DataInfo(long timeout, TimeUnit unit, boolean close)
- {
- super(timeout, unit);
- this.close = close;
- }
-
- /**
- * @return the value of the close flag
- * @see #setClose(boolean)
- */
- public boolean isClose()
- {
- return close;
- }
-
- /**
- * @param close the value of the close flag
- * @see #isClose()
- */
- public void setClose(boolean close)
- {
- this.close = close;
- }
-
- /**
- * @return the close and compress flags as integer
- * @see #FLAG_CLOSE
- */
- public byte getFlags()
- {
- return isClose() ? FLAG_CLOSE : 0;
- }
-
- /**
- * @return the total number of content bytes
- * @see #available()
- */
- public abstract int length();
-
- /**
- * <p>Returns the available content bytes that can be read via {@link #readInto(ByteBuffer)}.</p>
- * <p>Each invocation to {@link #readInto(ByteBuffer)} modifies the value returned by this method,
- * until no more content bytes are available.</p>
- *
- * @return the available content bytes
- * @see #readInto(ByteBuffer)
- */
- public abstract int available();
-
- /**
- * <p>Copies the content bytes of this {@link DataInfo} into the given {@link ByteBuffer}.</p>
- * <p>If the given {@link ByteBuffer} cannot contain the whole content of this {@link DataInfo}
- * then after the read {@link #available()} will return a positive value, and further content
- * may be retrieved by invoking again this method with a new output buffer.</p>
- *
- * @param output the {@link ByteBuffer} to copy the bytes into
- * @return the number of bytes copied
- * @see #available()
- * @see #consumeInto(ByteBuffer)
- */
- public abstract int readInto(ByteBuffer output);
-
- /**
- * <p>Copies the content bytes of this {@link DataInfo} into the given byte array.</p>
- * <p>If the given byte array cannot contain the whole content of this {@link DataInfo}
- * then after the read {@link #available()} will return a positive value, and further content
- * may be retrieved by invoking again this method with a new byte array.</p>
- *
- * @param bytes the byte array to copy the bytes into
- * @param offset the index of the byte array to start copying
- * @param length the number of bytes to copy
- * @return the number of bytes copied
- */
- public abstract int readInto(byte[] bytes, int offset, int length);
-
- /**
- * <p>Reads and consumes the content bytes of this {@link DataInfo} into the given {@link ByteBuffer}.</p>
- *
- * @param output the {@link ByteBuffer} to copy the bytes into
- * @return the number of bytes copied
- * @see #consume(int)
- */
- public int consumeInto(ByteBuffer output)
- {
- int read = readInto(output);
- consume(read);
- return read;
- }
-
- /**
- * <p>Reads and consumes the content bytes of this {@link DataInfo} into the given byte array,
- * starting from index {@code offset} for {@code length} bytes.</p>
- *
- * @param bytes the byte array to copy the bytes into
- * @param offset the offset of the byte array to start copying
- * @param length the number of bytes to copy
- * @return the number of bytes copied
- */
- public int consumeInto(byte[] bytes, int offset, int length)
- {
- int read = readInto(bytes, offset, length);
- consume(read);
- return read;
- }
-
- /**
- * <p>Consumes the given number of bytes from this {@link DataInfo}.</p>
- *
- * @param delta the number of bytes consumed
- */
- public void consume(int delta)
- {
- if (delta < 0)
- throw new IllegalArgumentException();
- int read = length() - available();
- int newConsumed = consumed() + delta;
-// if (newConsumed > read)
-// throw new IllegalStateException("Consuming without reading: consumed " + newConsumed + " but only read " + read);
- consumed.addAndGet(delta);
- }
-
- /**
- * @return the number of bytes consumed
- */
- public int consumed()
- {
- return consumed.get();
- }
-
- /**
- *
- * @param charset the charset used to convert the bytes
- * @param consume whether to consume the content
- * @return a String with the content of this {@link DataInfo}
- */
- public String asString(String charset, boolean consume)
- {
- return asString(Charset.forName(charset), consume);
- }
-
- /**
- *
- * @param charset the charset used to convert the bytes
- * @param consume whether to consume the content
- * @return a String with the content of this {@link DataInfo}
- */
- public String asString(Charset charset, boolean consume)
- {
- ByteBuffer buffer = asByteBuffer(consume);
- return charset.decode(buffer).toString();
- }
-
- /**
- * @return a byte array with the content of this {@link DataInfo}
- * @param consume whether to consume the content
- */
- public byte[] asBytes(boolean consume)
- {
- ByteBuffer buffer = asByteBuffer(consume);
- byte[] result = new byte[buffer.remaining()];
- buffer.get(result);
- return result;
- }
-
- /**
- * @return a {@link ByteBuffer} with the content of this {@link DataInfo}
- * @param consume whether to consume the content
- */
- public ByteBuffer asByteBuffer(boolean consume)
- {
- ByteBuffer buffer = allocate(available());
- if (consume)
- consumeInto(buffer);
- else
- readInto(buffer);
- buffer.flip();
- return buffer;
- }
-
- protected ByteBuffer allocate(int size)
- {
- return ByteBuffer.allocate(size);
- }
-
- @Override
- public String toString()
- {
- return String.format("DATA @%x available=%d consumed=%d close=%b", hashCode(), available(), consumed(), isClose());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java
deleted file mode 100644
index 80df510322..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * A GoAwayInfo container. Currently adding nothing to it's base class, but serves to keep the api unchanged in
- * future versions when we need to pass more info to the methods having a {@link GoAwayInfo} parameter.
- */
-public class GoAwayInfo extends Info
-{
- public GoAwayInfo(long timeout, TimeUnit unit)
- {
- super(timeout, unit);
- }
-
- public GoAwayInfo()
- {
- super();
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayResultInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayResultInfo.java
deleted file mode 100644
index e07dc8fd55..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayResultInfo.java
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-/**
- * <p>A container for GOAWAY frames metadata: the last good stream id and
- * the session status.</p>
- */
-public class GoAwayResultInfo
-{
- private final int lastStreamId;
- private final SessionStatus sessionStatus;
-
- /**
- * <p>Creates a new {@link GoAwayResultInfo} with the given last good stream id and session status</p>
- *
- * @param lastStreamId the last good stream id
- * @param sessionStatus the session status
- */
- public GoAwayResultInfo(int lastStreamId, SessionStatus sessionStatus)
- {
- this.lastStreamId = lastStreamId;
- this.sessionStatus = sessionStatus;
- }
-
- /**
- * @return the last good stream id
- */
- public int getLastStreamId()
- {
- return lastStreamId;
- }
-
- /**
- * @return the session status
- */
- public SessionStatus getSessionStatus()
- {
- return sessionStatus;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java
deleted file mode 100644
index 65c0ffbe7d..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.jetty.util.Fields;
-
-/**
- * <p>A container for HEADERS frame metadata and headers.</p>
- */
-public class HeadersInfo extends Info
-{
- /**
- * <p>Flag that indicates that this {@link HeadersInfo} is the last frame in the stream.</p>
- *
- * @see #isClose()
- * @see #getFlags()
- */
- public static final byte FLAG_CLOSE = 1;
- /**
- * <p>Flag that indicates that the compression of the stream must be reset.</p>
- *
- * @see #isResetCompression()
- * @see #getFlags()
- */
- public static final byte FLAG_RESET_COMPRESSION = 2;
-
- private final boolean close;
- private final boolean resetCompression;
- private final Fields headers;
-
- /**
- * <p>Creates a new {@link HeadersInfo} instance with the given headers, the given close flag and no reset
- * compression flag</p>
- *
- * @param headers the {@link Fields}
- * @param close the value of the close flag
- */
- public HeadersInfo(Fields headers, boolean close)
- {
- this(headers, close, false);
- }
-
- /**
- * <p>Creates a new {@link HeadersInfo} instance with the given headers, the given close flag and the given reset
- * compression flag</p>
- *
- * @param headers the {@link Fields}
- * @param close the value of the close flag
- * @param resetCompression the value of the reset compression flag
- */
- public HeadersInfo(Fields headers, boolean close, boolean resetCompression)
- {
- this.headers = headers;
- this.close = close;
- this.resetCompression = resetCompression;
- }
-
- /**
- * <p>Creates a new {@link HeadersInfo} instance with the given headers, the given close flag and the given reset
- * compression flag</p>
- *
- * @param timeout the operation's timeout
- * @param unit the timeout's unit
- * @param headers the {@link Fields}
- * @param close the value of the close flag
- * @param resetCompression the value of the reset compression flag
- */
- public HeadersInfo(long timeout, TimeUnit unit, boolean close, boolean resetCompression, Fields headers)
- {
- super(timeout, unit);
- this.close = close;
- this.resetCompression = resetCompression;
- this.headers = headers;
- }
-
- /**
- * @return the value of the close flag
- */
- public boolean isClose()
- {
- return close;
- }
-
- /**
- * @return the value of the reset compression flag
- */
- public boolean isResetCompression()
- {
- return resetCompression;
- }
-
- /**
- * @return the {@link Fields}
- */
- public Fields getHeaders()
- {
- return headers;
- }
-
- /**
- * @return the close and reset compression flags as integer
- * @see #FLAG_CLOSE
- * @see #FLAG_RESET_COMPRESSION
- */
- public byte getFlags()
- {
- byte flags = isClose() ? FLAG_CLOSE : 0;
- flags += isResetCompression() ? FLAG_RESET_COMPRESSION : 0;
- return flags;
- }
-
- @Override
- public String toString()
- {
- return String.format("HEADER close=%b %s", close, headers);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Info.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Info.java
deleted file mode 100644
index 5eca93e6c5..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Info.java
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * A base class for all *Info classes providing timeout and unit and api to access them
- */
-public class Info
-{
- private final long timeout;
- private final TimeUnit unit;
-
- public Info(long timeout, TimeUnit unit)
- {
- this.timeout = timeout;
- this.unit = unit;
- }
-
- public Info()
- {
- timeout = 0;
- unit = TimeUnit.SECONDS;
- }
-
- public long getTimeout()
- {
- return timeout;
- }
-
- public TimeUnit getUnit()
- {
- return unit;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java
deleted file mode 100644
index 322d987a5c..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * A PingInfo container. Currently adding nothing to it's base class, but serves to keep the api unchanged in
- * future versions when we need to pass more info to the methods having a {@link PingInfo} parameter.
- */
-public class PingInfo extends Info
-{
- public PingInfo(long timeout, TimeUnit unit)
- {
- super(timeout, unit);
- }
-
- public PingInfo()
- {
- this(0, TimeUnit.SECONDS);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingResultInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingResultInfo.java
deleted file mode 100644
index d4f2031bca..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingResultInfo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-/**
- * <p>A container for PING frames data.</p>
- */
-public class PingResultInfo
-{
- private final int pingId;
-
- /**
- * <p>Creates a {@link PingResultInfo} with the given ping id</p>
- * @param pingId the ping id
- */
- public PingResultInfo(int pingId)
- {
- this.pingId = pingId;
- }
-
- /**
- * @return the ping id
- */
- public int getPingId()
- {
- return pingId;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PushInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PushInfo.java
deleted file mode 100644
index 4654475eb2..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PushInfo.java
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.jetty.util.Fields;
-
-/**
- * <p>A container for PUSH_SYN_STREAM frames metadata and data.</p>
- */
-public class PushInfo extends Info
-{
- /**
- * <p>Flag that indicates that this {@link PushInfo} is the last frame in the stream.</p>
- *
- * @see #isClose()
- * @see #getFlags()
- */
- public static final byte FLAG_CLOSE = 1;
-
- private final boolean close;
- private final Fields headers;
-
- /**
- * <p>Creates a {@link PushInfo} instance with the given headers and the given close flag,
- * not unidirectional, without associated stream, and with default priority.</p>
- *
- * @param headers the {@link Fields}
- * @param close the value of the close flag
- */
- public PushInfo(Fields headers, boolean close)
- {
- this(0, TimeUnit.SECONDS, headers, close);
- // either builder or setters for timeout
- }
-
- /**
- * <p>
- * Creates a {@link PushInfo} instance with the given headers, the given close flag and with the given priority.
- * </p>
- * @param timeout the timeout value
- * @param unit the TimeUnit of the timeout
- * @param headers
- * the {@link Fields}
- * @param close
- */
- public PushInfo(long timeout, TimeUnit unit, Fields headers, boolean close)
- {
- super(timeout, unit);
- this.close = close;
- this.headers = headers;
- }
-
- /**
- * @return the value of the close flag
- */
- public boolean isClose()
- {
- return close;
- }
-
- /**
- * @return the {@link Fields}
- */
- public Fields getHeaders()
- {
- return headers;
- }
-
- /**
- * @return the close flag as integer
- * @see #FLAG_CLOSE
- */
- public byte getFlags()
- {
- return isClose() ? FLAG_CLOSE : 0;
- }
-
- @Override
- public String toString()
- {
- return String.format("SYN push close=%b headers=%s", close, headers);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java
deleted file mode 100644
index e3169541ad..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.jetty.util.Fields;
-
-/**
- * <p>A container for SYN_REPLY frames metadata and headers.</p>
- */
-public class ReplyInfo extends Info
-{
- /**
- * <p>Flag that indicates that this {@link ReplyInfo} is the last frame in the stream.</p>
- *
- * @see #isClose()
- * @see #getFlags()
- */
- public static final byte FLAG_CLOSE = 1;
-
- private final Fields headers;
- private final boolean close;
-
- /**
- * <p>Creates a new {@link ReplyInfo} instance with empty headers and the given close flag.</p>
- *
- * @param close the value of the close flag
- */
- public ReplyInfo(boolean close)
- {
- this(new Fields(), close);
- }
-
- /**
- * <p>Creates a {@link ReplyInfo} instance with the given headers and the given close flag.</p>
- *
- * @param headers the {@link Fields}
- * @param close the value of the close flag
- */
- public ReplyInfo(Fields headers, boolean close)
- {
- this(0, TimeUnit.SECONDS, headers, close);
- }
-
- /**
- * <p>Creates a {@link ReplyInfo} instance with the given headers and the given close flag.</p>
- *
- * @param timeout the timeout
- * @param unit the time unit for the timeout
- * @param headers the {@link Fields}
- * @param close the value of the close flag
- */
- public ReplyInfo(long timeout, TimeUnit unit, Fields headers, boolean close)
- {
- super(timeout, unit);
- this.headers = headers;
- this.close = close;
- }
-
- /**
- * @return the {@link Fields}
- */
- public Fields getHeaders()
- {
- return headers;
- }
-
- /**
- * @return the value of the close flag
- */
- public boolean isClose()
- {
- return close;
- }
-
- /**
- * @return the close and reset compression flags as integer
- * @see #FLAG_CLOSE
- */
- public byte getFlags()
- {
- return isClose() ? FLAG_CLOSE : 0;
- }
-
- @Override
- public String toString()
- {
- return String.format("REPLY close=%b %s", close, headers);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java
deleted file mode 100644
index 3b84cd1e03..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * <p>A container for RST_STREAM frames data: the stream id and the stream status.</p>
- */
-public class RstInfo extends Info
-{
- private final int streamId;
- private final StreamStatus streamStatus;
-
- /**
- * <p>Creates a new {@link RstInfo} with the given stream id and stream status</p>
- *
- * @param timeout the operation's timeout
- * @param unit the timeout's unit
- * @param streamId the stream id
- * @param streamStatus the stream status
- */
- public RstInfo(long timeout, TimeUnit unit, int streamId, StreamStatus streamStatus)
- {
- super(timeout, unit);
- this.streamId = streamId;
- this.streamStatus = streamStatus;
- }
-
- /**
- * <p>Creates a new {@link RstInfo} with the given stream id and stream status</p>
- *
- * @param streamId
- * @param streamStatus
- */
- public RstInfo(int streamId, StreamStatus streamStatus)
- {
- this(0, TimeUnit.SECONDS, streamId, streamStatus);
- }
-
- /**
- * @return the stream id
- */
- public int getStreamId()
- {
- return streamId;
- }
-
- /**
- * @return the stream status
- */
- public StreamStatus getStreamStatus()
- {
- return streamStatus;
- }
-
- @Override
- public String toString()
- {
- return String.format("RST stream=%d %s", streamId, streamStatus);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java
deleted file mode 100644
index c8d7af31bf..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-/**
- * <p>Helper class that holds useful SPDY constants.</p>
- */
-public class SPDY
-{
- /**
- * <p>Constant that indicates the version 2 of the SPDY protocol</p>
- */
- public static final short V2 = 2;
-
- /**
- * <p>Constant that indicates the version 3 of the SPDY protocol</p>
- */
- public static final short V3 = 3;
-
- private SPDY()
- {
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java
deleted file mode 100644
index 81000d727c..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-/**
- * <p>An unrecoverable exception that signals to the application that
- * something wrong happened.</p>
- */
-public class SPDYException extends RuntimeException
-{
- public SPDYException()
- {
- }
-
- public SPDYException(String message)
- {
- super(message);
- }
-
- public SPDYException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public SPDYException(Throwable cause)
- {
- super(cause);
- }
-
- public SPDYException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
- {
- super(message, cause, enableSuppression, writableStackTrace);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java
deleted file mode 100644
index 47da10ab35..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java
+++ /dev/null
@@ -1,261 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.net.InetSocketAddress;
-import java.util.EventListener;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.util.Promise;
-
-/**
- * <p>A {@link Session} represents the client-side endpoint of a SPDY connection to a single origin server.</p>
- * <p>Once a {@link Session} has been obtained, it can be used to open SPDY streams:</p>
- * <pre>
- * Session session = ...;
- * SynInfo synInfo = new SynInfo(true);
- * session.push(synInfo, new Stream.FrameListener.Adapter()
- * {
- * public void onReply(Stream stream, ReplyInfo replyInfo)
- * {
- * // Stream reply received
- * }
- * });
- * </pre>
- * <p>A {@link Session} is the active part of the endpoint, and by calling its API applications can generate
- * events on the connection; conversely {@link SessionFrameListener} is the passive part of the endpoint, and
- * has callbacks that are invoked when events happen on the connection.</p>
- *
- * @see SessionFrameListener
- */
-public interface Session
-{
- /**
- * @return the SPDY protocol version used by this session
- */
- public short getVersion();
-
- /**
- * <p>Registers the given {@code listener} to be notified of session events.</p>
- *
- * @param listener the listener to register
- * @see #removeListener(Listener)
- */
- public void addListener(Listener listener);
-
- /**
- * <p>Deregisters the give {@code listener} from being notified of session events.</p>
- *
- * @param listener the listener to deregister
- * @see #addListener(Listener)
- */
- public void removeListener(Listener listener);
-
- /**
- * <p>Sends a SYN_FRAME to create a new {@link Stream SPDY stream}.</p>
- * <p>Callers may use the returned Stream for example, to send data frames.</p>
- *
- * @param synInfo the metadata to send on stream creation
- * @param listener the listener to invoke when events happen on the stream just created
- * @return the stream that will be created
- * @see #syn(SynInfo, StreamFrameListener, Promise)
- */
- public Stream syn(SynInfo synInfo, StreamFrameListener listener) throws ExecutionException, InterruptedException, TimeoutException;
-
- /**
- * <p>Sends asynchronously a SYN_FRAME to create a new {@link Stream SPDY stream}.</p>
- * <p>Callers may pass a non-null completion callback to be notified of when the
- * stream has been created and use the stream, for example, to send data frames.</p>
- *
- *
- * @param synInfo the metadata to send on stream creation
- * @param listener the listener to invoke when events happen on the stream just created
- * @param promise the completion callback that gets notified of stream creation
- * @see #syn(SynInfo, StreamFrameListener)
- */
- public void syn(SynInfo synInfo, StreamFrameListener listener, Promise<Stream> promise);
-
- /**
- * <p>Sends synchronously a RST_STREAM to abort a stream.</p>
- *
- * @param rstInfo the metadata to reset the stream
- * @see #rst(RstInfo, Callback)
- */
- public void rst(RstInfo rstInfo) throws InterruptedException, ExecutionException, TimeoutException;
-
- /**
- * <p>Sends asynchronously a RST_STREAM to abort a stream.</p>
- * <p>Callers may pass a non-null completion callback to be notified of when the
- * reset has been actually sent.</p>
- *
- * @param rstInfo the metadata to reset the stream
- * @param callback the completion callback that gets notified of reset's send
- * @see #rst(RstInfo)
- */
- public void rst(RstInfo rstInfo, Callback callback);
-
- /**
- * <p>Sends synchronously a SETTINGS to configure the SPDY connection.</p>
- *
- * @param settingsInfo the metadata to send
- * @see #settings(SettingsInfo, Callback)
- */
- public void settings(SettingsInfo settingsInfo) throws ExecutionException, InterruptedException, TimeoutException;
-
- /**
- * <p>Sends asynchronously a SETTINGS to configure the SPDY connection.</p>
- * <p>Callers may pass a non-null completion callback to be notified of when the
- * settings has been actually sent.</p>
- *
- *
- * @param settingsInfo the metadata to send
- * @param callback the completion callback that gets notified of settings' send
- * @see #settings(SettingsInfo)
- */
- public void settings(SettingsInfo settingsInfo, Callback callback);
-
- /**
- * <p>Sends synchronously a PING, normally to measure round-trip time.</p>
- *
- * @see #ping(PingInfo, Promise)
- * @param pingInfo
- */
- public PingResultInfo ping(PingInfo pingInfo) throws ExecutionException, InterruptedException, TimeoutException;
-
- /**
- * <p>Sends asynchronously a PING, normally to measure round-trip time.</p>
- * <p>Callers may pass a non-null completion callback to be notified of when the
- * ping has been actually sent.</p>
- *
- * @param pingInfo
- * @param promise the completion callback that gets notified of ping's send
- * @see #ping(PingInfo)
- */
- public void ping(PingInfo pingInfo, Promise<PingResultInfo> promise);
-
- /**
- * <p>Closes gracefully this session, sending a GO_AWAY frame and then closing the TCP connection.</p>
- *
- * @see #goAway(GoAwayInfo, Callback)
- * @param goAwayInfo
- */
- public void goAway(GoAwayInfo goAwayInfo) throws ExecutionException, InterruptedException, TimeoutException;
-
- /**
- * <p>Closes gracefully this session, sending a GO_AWAY frame and then closing the TCP connection.</p>
- * <p>Callers may pass a non-null completion callback to be notified of when the
- * go away has been actually sent.</p>
- *
- * @param goAwayInfo
- * @param callback the completion callback that gets notified of go away's send
- * @see #goAway(GoAwayInfo)
- */
- public void goAway(GoAwayInfo goAwayInfo, Callback callback);
-
- /**
- * @return a snapshot of the streams currently active in this session
- * @see #getStream(int)
- */
- public Set<Stream> getStreams();
-
- /**
- * @param streamId the id of the stream to retrieve
- * @return the stream with the given stream id
- * @see #getStreams()
- */
- public Stream getStream(int streamId);
-
- /**
- * @param key the attribute key
- * @return an arbitrary object associated with the given key to this session
- * @see #setAttribute(String, Object)
- */
- public Object getAttribute(String key);
-
- /**
- * @param key the attribute key
- * @param value an arbitrary object to associate with the given key to this session
- * @see #getAttribute(String)
- * @see #removeAttribute(String)
- */
- public void setAttribute(String key, Object value);
-
- /**
- * @param key the attribute key
- * @return the arbitrary object associated with the given key to this session
- * @see #setAttribute(String, Object)
- */
- public Object removeAttribute(String key);
-
- /**
- * @return the local address of the underlying endpoint
- */
- public InetSocketAddress getLocalAddress();
-
- /**
- * @return the remote address of the underlying endpoint
- */
- public InetSocketAddress getRemoteAddress();
-
- /**
- * <p>Super interface for listeners with callbacks that are invoked on specific session events.</p>
- */
- public interface Listener extends EventListener
- {
- }
-
- /**
- * <p>Specialized listener that is invoked upon creation and removal of streams.</p>
- */
- public interface StreamListener extends Listener
- {
- /**
- * <p>Callback invoked when a new SPDY stream is created.</p>
- *
- * @param stream the stream just created
- */
- public void onStreamCreated(Stream stream);
-
- /**
- * <p>Callback invoked when a SPDY stream is closed.</p>
- *
- * @param stream the stream just closed.
- */
- public void onStreamClosed(Stream stream);
-
- /**
- * <p>Empty implementation of {@link StreamListener}.</p>
- */
- public static class Adapter implements StreamListener
- {
- @Override
- public void onStreamCreated(Stream stream)
- {
- }
-
- @Override
- public void onStreamClosed(Stream stream)
- {
- }
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java
deleted file mode 100644
index 02382f2e60..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.EventListener;
-
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jetty.util.log.Logger;
-
-/**
- * <p>A {@link SessionFrameListener} is the passive counterpart of a {@link Session} and receives events happening
- * on a SPDY session.</p>
- *
- * @see Session
- */
-public interface SessionFrameListener extends EventListener
-{
- /**
- * <p>Callback invoked when a request to create a stream has been received.</p>
- * <p>Application code should implement this method and reply to the stream creation, eventually
- * sending data:</p>
- * <pre>
- * public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
- * {
- * // Do something with the metadata contained in synInfo
- *
- * if (stream.isHalfClosed()) // The other peer will not send data
- * {
- * stream.reply(new ReplyInfo(false));
- * stream.data(new StringDataInfo("foo", true));
- * return null; // Not interested in further stream events
- * }
- *
- * ...
- * }
- * </pre>
- * <p>Alternatively, if the stream creation requires reading data sent from the other peer:</p>
- * <pre>
- * public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
- * {
- * // Do something with the metadata contained in synInfo
- *
- * if (!stream.isHalfClosed()) // The other peer will send data
- * {
- * stream.reply(new ReplyInfo(true));
- * return new Stream.FrameListener.Adapter() // Interested in stream events
- * {
- * public void onData(Stream stream, DataInfo dataInfo)
- * {
- * // Do something with the incoming data in dataInfo
- * }
- * };
- * }
- *
- * ...
- * }
- * </pre>
- *
- * @param stream the stream just created
- * @param synInfo the metadata sent on stream creation
- * @return a listener for stream events, or null if there is no interest in being notified of stream events
- */
- public StreamFrameListener onSyn(Stream stream, SynInfo synInfo);
-
- /**
- * <p>Callback invoked when a stream error happens.</p>
- *
- * @param session the session
- * @param rstInfo the metadata of the stream error
- */
- public void onRst(Session session, RstInfo rstInfo);
-
- /**
- * <p>Callback invoked when a request to configure the SPDY connection has been received.</p>
- *
- * @param session the session
- * @param settingsInfo the metadata sent to configure
- */
- public void onSettings(Session session, SettingsInfo settingsInfo);
-
- /**
- * <p>Callback invoked when a ping request has completed its round-trip.</p>
- *
- * @param session the session
- * @param pingResultInfo the metadata received
- */
- public void onPing(Session session, PingResultInfo pingResultInfo);
-
- /**
- * <p>Callback invoked when the other peer signals that it is closing the connection.</p>
- *
- * @param session the session
- * @param goAwayResultInfo the metadata sent
- */
- public void onGoAway(Session session, GoAwayResultInfo goAwayResultInfo);
-
- /**
- * <p>Callback invoked when an exception is thrown during the processing of an event on a
- * SPDY session.</p>
- * <p>Examples of such conditions are invalid frames received, corrupted headers compression state, etc.</p>
- *
- * @param session the session
- * @param x the exception that caused the event processing failure
- */
- public void onFailure(Session session, Throwable x);
-
-
- /**
- * <p>Empty implementation of {@link SessionFrameListener}</p>
- */
- public static class Adapter implements SessionFrameListener
- {
- private static final Logger logger = Log.getLogger(Adapter.class);
-
- @Override
- public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
- {
- return null;
- }
-
- @Override
- public void onRst(Session session, RstInfo rstInfo)
- {
- }
-
- @Override
- public void onSettings(Session session, SettingsInfo settingsInfo)
- {
- }
-
- @Override
- public void onPing(Session session, PingResultInfo pingResultInfo)
- {
- }
-
- @Override
- public void onGoAway(Session session, GoAwayResultInfo goAwayResultInfo)
- {
- }
-
- @Override
- public void onFailure(Session session, Throwable x)
- {
- logger.info("", x);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java
deleted file mode 100644
index 36d9972f50..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * <p>An enumeration of session statuses.</p>
- */
-public enum SessionStatus
-{
- /**
- * <p>The session status indicating no errors</p>
- */
- OK(0),
- /**
- * <p>The session status indicating a protocol error</p>
- */
- PROTOCOL_ERROR(1);
-
- /**
- * @param code the session status code
- * @return a {@link SessionStatus} from the given code,
- * or null if no status exists
- */
- public static SessionStatus from(int code)
- {
- return Codes.codes.get(code);
- }
-
- private final int code;
-
- private SessionStatus(int code)
- {
- this.code = code;
- Codes.codes.put(code, this);
- }
-
- /**
- * @return the code of this {@link SessionStatus}
- */
- public int getCode()
- {
- return code;
- }
-
- private static class Codes
- {
- private static final Map<Integer, SessionStatus> codes = new HashMap<>();
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java
deleted file mode 100644
index 591dbb7e73..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-public class Settings implements Iterable<Settings.Setting>
-{
- private final Map<ID, Settings.Setting> settings;
-
- public Settings()
- {
- settings = new HashMap<>();
- }
-
- public Settings(Settings original, boolean immutable)
- {
- Map<ID, Settings.Setting> copy = new HashMap<>(original.size());
- copy.putAll(original.settings);
- settings = immutable ? Collections.unmodifiableMap(copy) : copy;
- }
-
- public Setting get(ID id)
- {
- return settings.get(id);
- }
-
- public void put(Setting setting)
- {
- settings.put(setting.id(), setting);
- }
-
- public Setting remove(ID id)
- {
- return settings.remove(id);
- }
-
- public int size()
- {
- return settings.size();
- }
-
- public void clear()
- {
- settings.clear();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null || getClass() != obj.getClass())
- return false;
- Settings that = (Settings)obj;
- return settings.equals(that.settings);
- }
-
- @Override
- public int hashCode()
- {
- return settings.hashCode();
- }
-
- @Override
- public Iterator<Setting> iterator()
- {
- return settings.values().iterator();
- }
-
- @Override
- public String toString()
- {
- return settings.toString();
- }
-
- public static final class ID
- {
- public static final ID UPLOAD_BANDWIDTH = new ID(1);
- public static final ID DOWNLOAD_BANDWIDTH = new ID(2);
- public static final ID ROUND_TRIP_TIME = new ID(3);
- public static final ID MAX_CONCURRENT_STREAMS = new ID(4);
- public static final ID CURRENT_CONGESTION_WINDOW = new ID(5);
- public static final ID DOWNLOAD_RETRANSMISSION_RATE = new ID(6);
- public static final ID INITIAL_WINDOW_SIZE = new ID(7);
-
- public synchronized static ID from(int code)
- {
- ID id = Codes.codes.get(code);
- if (id == null)
- id = new ID(code);
- return id;
- }
-
- private final int code;
-
- private ID(int code)
- {
- this.code = code;
- Codes.codes.put(code, this);
- }
-
- public int code()
- {
- return code;
- }
-
- @Override
- public String toString()
- {
- return String.valueOf(code);
- }
-
- private static class Codes
- {
- private static final Map<Integer, ID> codes = new HashMap<>();
- }
- }
-
- public static enum Flag
- {
- NONE((byte)0),
- PERSIST((byte)1),
- PERSISTED((byte)2);
-
- public static Flag from(byte code)
- {
- return Codes.codes.get(code);
- }
-
- private final byte code;
-
- private Flag(byte code)
- {
- this.code = code;
- Codes.codes.put(code, this);
- }
-
- public byte code()
- {
- return code;
- }
-
- private static class Codes
- {
- private static final Map<Byte, Flag> codes = new HashMap<>();
- }
- }
-
- public static class Setting
- {
- private final ID id;
- private final Flag flag;
- private final int value;
-
- public Setting(ID id, int value)
- {
- this(id, Flag.NONE, value);
- }
-
- public Setting(ID id, Flag flag, int value)
- {
- this.id = id;
- this.flag = flag;
- this.value = value;
- }
-
- public ID id()
- {
- return id;
- }
-
- public Flag flag()
- {
- return flag;
- }
-
- public int value()
- {
- return value;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null || getClass() != obj.getClass())
- return false;
- Setting that = (Setting)obj;
- return value == that.value && flag == that.flag && id == that.id;
- }
-
- @Override
- public int hashCode()
- {
- int result = id.hashCode();
- result = 31 * result + flag.hashCode();
- result = 31 * result + value;
- return result;
- }
-
- @Override
- public String toString()
- {
- return String.format("[id=%s,flags=%s:value=%d]", id(), flag(), value());
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java
deleted file mode 100644
index 43bc2a8f94..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-public class SettingsInfo extends Info
-{
- public static final byte CLEAR_PERSISTED = 1;
-
- private final Settings settings;
- private final boolean clearPersisted;
-
- public SettingsInfo(Settings settings)
- {
- this(0, TimeUnit.SECONDS, settings, false);
- }
-
- public SettingsInfo(long timeout, TimeUnit unit, Settings settings, boolean clearPersisted)
- {
- super(timeout, unit);
- this.settings = settings;
- this.clearPersisted = clearPersisted;
- }
-
- public SettingsInfo(Settings settings, boolean clearPersisted)
- {
- this(0, TimeUnit.SECONDS, settings, clearPersisted);
- }
-
- public boolean isClearPersisted()
- {
- return clearPersisted;
- }
-
- public byte getFlags()
- {
- return isClearPersisted() ? CLEAR_PERSISTED : 0;
- }
-
- public Settings getSettings()
- {
- return settings;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java
deleted file mode 100644
index ced832ea71..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java
+++ /dev/null
@@ -1,237 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.nio.channels.WritePendingException;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.util.Promise;
-
-/**
- * <p>A {@link Stream} represents a bidirectional exchange of data on top of a {@link Session}.</p> <p>Differently from
- * socket streams, where the input and output streams are permanently associated with the socket (and hence with the
- * connection that the socket represents), there can be multiple SPDY streams for a SPDY session.</p> <p>SPDY streams
- * may terminate without this implying that the SPDY session is terminated.</p> <p>If SPDY is used to transport the HTTP
- * protocol, then a SPDY stream maps to a HTTP request/response cycle, and after the request/response cycle is
- * completed, the stream is closed, and other streams may be opened. Differently from HTTP, though, multiple SPDY
- * streams may be opened concurrently on the same SPDY session.</p> <p>Like {@link Session}, {@link Stream} is the
- * active part and by calling its API applications can generate events on the stream; conversely, {@link
- * StreamFrameListener} is the passive part, and its callbacks are invoked when events happen on the stream.</p> <p>A
- * {@link Stream} can send multiple data frames one after the other but implementations use a flow control mechanism
- * that only sends the data frames if the other end has signalled that it can accept the frame.</p> <p>Data frames
- * should be sent sequentially only when the previous frame has been completely sent. The reason for this requirement is
- * to avoid potentially confusing code such as:</p>
- * <pre>
- * // WRONG CODE, DO NOT USE IT
- * final Stream stream = ...;
- * stream.data(StringDataInfo("chunk1", false), 5, TimeUnit.SECONDS, new Handler&lt;Void&gt;() { ... });
- * stream.data(StringDataInfo("chunk2", true), 1, TimeUnit.SECONDS, new Handler&lt;Void&gt;() { ... });
- * </pre>
- * <p>where the second call to {@link #data(DataInfo, Callback)} has a timeout smaller than the previous call.</p>
- * <p>The behavior of such style of invocations is unspecified (it may even throw an exception - similar to {@link
- * WritePendingException}).</p> <p>The correct sending of data frames is the following:</p>
- * <pre>
- * final Stream stream = ...;
- * ...
- * // Blocking version
- * stream.data(new StringDataInfo("chunk1", false)).get(1, TimeUnit.SECONDS);
- * stream.data(new StringDataInfo("chunk2", true)).get(1, TimeUnit.SECONDS);
- *
- * // Asynchronous version
- * stream.data(new StringDataInfo("chunk1", false), 1, TimeUnit.SECONDS, new Handler.Adapter&lt;Void&gt;()
- * {
- * public void completed(Void context)
- * {
- * stream.data(new StringDataInfo("chunk2", true));
- * }
- * });
- * </pre>
- *
- * @see StreamFrameListener
- */
-public interface Stream
-{
- /**
- * @return the id of this stream
- */
- public int getId();
-
- /**
- * @return the priority of this stream
- */
- public byte getPriority();
-
- /**
- * @return the session this stream is associated to
- */
- public Session getSession();
-
- /**
- * <p>Initiate a unidirectional spdy pushstream associated to this stream asynchronously<p> <p>Callers may use the
- * returned future to get the pushstream once it got created</p>
- *
- * @param pushInfo the metadata to send on stream creation
- * @return a future containing the stream once it got established
- * @see #push(PushInfo, Promise)
- */
- public Stream push(PushInfo pushInfo) throws InterruptedException, ExecutionException, TimeoutException;
-
- /**
- * <p>Initiate a unidirectional spdy pushstream associated to this stream asynchronously<p> <p>Callers may pass a
- * non-null completion promise to be notified of when the pushstream has been established.</p>
- *
- * @param pushInfo the metadata to send on stream creation
- * @param promise the completion promise that gets notified once the pushstream is established
- * @see #push(PushInfo)
- */
- public void push(PushInfo pushInfo, Promise<Stream> promise);
-
- /**
- * <p>Sends asynchronously a SYN_REPLY frame in response to a SYN_STREAM frame.</p> <p>Callers may use the returned
- * future to wait for the reply to be actually sent.</p>
- *
- * @param replyInfo the metadata to send
- * @see #reply(ReplyInfo, Callback)
- * @see SessionFrameListener#onSyn(Stream, SynInfo)
- */
- public void reply(ReplyInfo replyInfo) throws InterruptedException, ExecutionException, TimeoutException;
-
- /**
- * <p>Sends asynchronously a SYN_REPLY frame in response to a SYN_STREAM frame.</p> <p>Callers may pass a non-null
- * completion callback to be notified of when the reply has been actually sent.</p>
- *
- * @param replyInfo the metadata to send
- * @param callback the completion callback that gets notified of reply sent
- * @see #reply(ReplyInfo)
- */
- public void reply(ReplyInfo replyInfo, Callback callback);
-
- /**
- * <p>Sends asynchronously a DATA frame on this stream.</p> <p>DATA frames should always be sent after a SYN_REPLY
- * frame.</p> <p>Callers may use the returned future to wait for the data to be actually sent.</p>
- *
- * @param dataInfo the metadata to send
- * @see #data(DataInfo, Callback)
- * @see #reply(ReplyInfo)
- */
- public void data(DataInfo dataInfo) throws InterruptedException, ExecutionException, TimeoutException;
-
- /**
- * <p>Sends asynchronously a DATA frame on this stream.</p> <p>DATA frames should always be sent after a SYN_REPLY
- * frame.</p> <p>Callers may pass a non-null completion callback to be notified of when the data has been actually
- * sent.</p>
- *
- * @param dataInfo the metadata to send
- * @param callback the completion callback that gets notified of data sent
- * @see #data(DataInfo)
- */
- public void data(DataInfo dataInfo, Callback callback);
-
- /**
- * <p>Sends asynchronously a HEADER frame on this stream.</p> <p>HEADERS frames should always be sent after a
- * SYN_REPLY frame.</p> <p>Callers may use the returned future to wait for the headers to be actually sent.</p>
- *
- * @param headersInfo the metadata to send
- * @see #headers(HeadersInfo, Callback)
- * @see #reply(ReplyInfo)
- */
- public void headers(HeadersInfo headersInfo) throws InterruptedException, ExecutionException, TimeoutException;
-
- /**
- * <p>Sends asynchronously a HEADER frame on this stream.</p> <p>HEADERS frames should always be sent after a
- * SYN_REPLY frame.</p> <p>Callers may pass a non-null completion callback to be notified of when the headers have
- * been actually sent.</p>
- *
- * @param headersInfo the metadata to send
- * @param callback the completion callback that gets notified of headers sent
- * @see #headers(HeadersInfo)
- */
- public void headers(HeadersInfo headersInfo, Callback callback);
-
- /**
- * @return whether this stream is unidirectional or not
- */
- public boolean isUnidirectional();
-
- /**
- * @return whether this stream has been reset
- */
- public boolean isReset();
-
- /**
- * @return whether this stream has been closed by both parties
- * @see #isHalfClosed()
- */
- public boolean isClosed();
-
- /**
- * @return whether this stream has been closed by one party only
- * @see #isClosed()
- */
- public boolean isHalfClosed();
-
- /**
- * @param key the attribute key
- * @return an arbitrary object associated with the given key to this stream or null if no object can be found for
- * the given key.
- * @see #setAttribute(String, Object)
- */
- public Object getAttribute(String key);
-
- /**
- * @param key the attribute key
- * @param value an arbitrary object to associate with the given key to this stream
- * @see #getAttribute(String)
- * @see #removeAttribute(String)
- */
- public void setAttribute(String key, Object value);
-
- /**
- * @param key the attribute key
- * @return the arbitrary object associated with the given key to this stream
- * @see #setAttribute(String, Object)
- */
- public Object removeAttribute(String key);
-
- /**
- * @return the associated parent stream or null if this is not an associated stream
- */
- public Stream getAssociatedStream();
-
- /**
- * @return associated child streams or an empty set if no associated streams exist
- */
- public Set<Stream> getPushedStreams();
-
- /**
- * Get the idle timeout set for this particular stream
- * @return the idle timeout
- */
- public long getIdleTimeout();
-
- /**
- * Set an idle timeout for this stream
- * @param timeout
- */
- public void setIdleTimeout(long timeout);
-
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java
deleted file mode 100644
index 534c26b9b0..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.EventListener;
-
-/**
- * <p>A {@link StreamFrameListener} is the passive counterpart of a {@link Stream} and receives
- * events happening on a SPDY stream.</p>
- *
- * @see Stream
- */
-public interface StreamFrameListener extends EventListener
-{
- /**
- * <p>Callback invoked when a reply to a stream creation has been received.</p>
- * <p>Application code may implement this method to send more data to the other end:</p>
- * <pre>
- * public void onReply(Stream stream, ReplyInfo replyInfo)
- * {
- * stream.data(new StringDataInfo("content"), true);
- * }
- * </pre>
- * @param stream the stream
- * @param replyInfo the reply metadata
- */
- public void onReply(Stream stream, ReplyInfo replyInfo);
-
- /**
- * <p>Callback invoked when headers are received on a stream.</p>
- *
- * @param stream the stream
- * @param headersInfo the headers metadata
- */
- public void onHeaders(Stream stream, HeadersInfo headersInfo);
-
- /**
- * <p>Callback invoked when a push syn has been received on a stream.</p>
- *
- * @param stream the push stream just created
- * @param pushInfo the push metadata
- * @return a listener for stream events or null if there is no interest in being notified of stream events
- */
- public StreamFrameListener onPush(Stream stream, PushInfo pushInfo);
-
- /**
- * <p>Callback invoked when data bytes are received on a stream.</p>
- * <p>Implementers should be read or consume the content of the
- * {@link DataInfo} before this method returns.</p>
- *
- * @param stream the stream
- * @param dataInfo the data metadata
- */
- public void onData(Stream stream, DataInfo dataInfo);
-
- /**
- * <p>Callback invoked on errors.</p>
- * @param stream the stream
- * @param x the failure
- */
- public void onFailure(Stream stream, Throwable x);
-
- /**
- * <p>Empty implementation of {@link StreamFrameListener}</p>
- */
- public static class Adapter implements StreamFrameListener
- {
- @Override
- public void onReply(Stream stream, ReplyInfo replyInfo)
- {
- }
-
- @Override
- public void onHeaders(Stream stream, HeadersInfo headersInfo)
- {
- }
-
- @Override
- public StreamFrameListener onPush(Stream stream, PushInfo pushInfo)
- {
- return null;
- }
-
- @Override
- public void onData(Stream stream, DataInfo dataInfo)
- {
- }
-
- @Override
- public void onFailure(Stream stream, Throwable x)
- {
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java
deleted file mode 100644
index 2e3be694df..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * <p>An enumeration of stream statuses.</p>
- */
-public enum StreamStatus
-{
- /**
- * <p>The stream status indicating a protocol error</p>
- */
- PROTOCOL_ERROR(1, 1),
- /**
- * <p>The stream status indicating that the stream is not valid</p>
- */
- INVALID_STREAM(2, 2),
- /**
- * <p>The stream status indicating that the stream has been refused</p>
- */
- REFUSED_STREAM(3, 3),
- /**
- * <p>The stream status indicating that the implementation does not support the SPDY version of the stream</p>
- */
- UNSUPPORTED_VERSION(4, 4),
- /**
- * <p>The stream status indicating that the stream is no longer needed</p>
- */
- CANCEL_STREAM(5, 5),
- /**
- * <p>The stream status indicating an implementation error</p>
- */
- INTERNAL_ERROR(6, 6),
- /**
- * <p>The stream status indicating a flow control error</p>
- */
- FLOW_CONTROL_ERROR(7, 7),
- /**
- * <p>The stream status indicating a stream opened more than once</p>
- */
- STREAM_IN_USE(-1, 8),
- /**
- * <p>The stream status indicating data on a stream already closed</p>
- */
- STREAM_ALREADY_CLOSED(-1, 9),
- /**
- * <p>The stream status indicating credentials not valid</p>
- */
- INVALID_CREDENTIALS(-1, 10),
- /**
- * <p>The stream status indicating that the implementation could not support a frame too large</p>
- */
- FRAME_TOO_LARGE(-1, 11);
-
- /**
- * @param version the SPDY protocol version
- * @param code the stream status code
- * @return a {@link StreamStatus} from the given version and code,
- * or null if no such status exists
- */
- public static StreamStatus from(short version, int code)
- {
- switch (version)
- {
- case SPDY.V2:
- return Codes.v2Codes.get(code);
- case SPDY.V3:
- return Codes.v3Codes.get(code);
- default:
- throw new IllegalStateException();
- }
- }
-
- private final int v2Code;
- private final int v3Code;
-
- private StreamStatus(int v2Code, int v3Code)
- {
- this.v2Code = v2Code;
- if (v2Code >= 0)
- Codes.v2Codes.put(v2Code, this);
- this.v3Code = v3Code;
- if (v3Code >= 0)
- Codes.v3Codes.put(v3Code, this);
- }
-
- /**
- * @param version the SPDY protocol version
- * @return the stream status code
- */
- public int getCode(short version)
- {
- switch (version)
- {
- case SPDY.V2:
- return v2Code;
- case SPDY.V3:
- return v3Code;
- default:
- throw new IllegalStateException();
- }
- }
-
- private static class Codes
- {
- private static final Map<Integer, StreamStatus> v2Codes = new HashMap<>();
- private static final Map<Integer, StreamStatus> v3Codes = new HashMap<>();
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java
deleted file mode 100644
index d9cb3198dd..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.nio.charset.StandardCharsets;
-import java.util.concurrent.TimeUnit;
-
-/**
- * <p>Specialized {@link DataInfo} for {@link String} content.</p>
- */
-public class StringDataInfo extends BytesDataInfo
-{
- public StringDataInfo(String string, boolean close)
- {
- super(string.getBytes(StandardCharsets.UTF_8), close);
- }
-
- public StringDataInfo(long timeout, TimeUnit unit, String string, boolean close)
- {
- super(timeout, unit, string.getBytes(StandardCharsets.UTF_8), close);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java
deleted file mode 100644
index 8713830707..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api;
-
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.jetty.util.Fields;
-
-/**
- * <p>A container for SYN_STREAM frames metadata and data.</p>
- */
-public class SynInfo extends Info
-{
- /**
- * <p>Flag that indicates that this {@link SynInfo} is the last frame in the stream.</p>
- *
- * @see #isClose()
- * @see #getFlags()
- */
- public static final byte FLAG_CLOSE = 1;
-
- private final boolean close;
- private final byte priority;
- private final Fields headers;
-
- /**
- * <p>Creates a {@link SynInfo} instance with the given headers and the given close flag,
- * not unidirectional, without associated stream, and with default priority.</p>
- *
- * @param headers the {@link Fields}
- * @param close the value of the close flag
- */
- public SynInfo(Fields headers, boolean close)
- {
- this(0, TimeUnit.SECONDS, headers, close, (byte)0);
- // either builder or setters for timeout
- }
-
- /**
- * <p>
- * Creates a {@link SynInfo} instance with the given headers, the given close flag and with the given priority.
- * </p>
- * @param headers
- * the {@link Fields}
- * @param close
- * the value of the close flag
- * @param priority
- */
- public SynInfo(Fields headers, boolean close, byte priority)
- {
- this(0, TimeUnit.SECONDS, headers, close, priority);
- }
-
- /**
- * <p>
- * Creates a {@link SynInfo} instance with the given headers, the given close flag and with the given priority.
- * </p>
- * @param timeout the timeout value
- * @param unit the TimeUnit of the timeout
- * @param headers
- * the {@link Fields}
- * @param close
- * the value of the close flag
- * @param priority
- */
- public SynInfo(long timeout, TimeUnit unit, Fields headers, boolean close, byte priority)
- {
- super(timeout, unit);
- this.close = close;
- this.priority = priority;
- this.headers = headers;
- }
-
- /**
- * @return the value of the close flag
- */
- public boolean isClose()
- {
- return close;
- }
-
- /**
- * @return the priority
- */
- public byte getPriority()
- {
- return priority;
- }
-
- /**
- * @return the {@link Fields}
- */
- public Fields getHeaders()
- {
- return headers;
- }
-
- /**
- * @return the close flag as integer
- * @see #FLAG_CLOSE
- */
- public byte getFlags()
- {
- return isClose() ? FLAG_CLOSE : 0;
- }
-
- @Override
- public String toString()
- {
- return String.format("SYN close=%b headers=%s", close, headers);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java
deleted file mode 100644
index 2b7e1400ee..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.api.server;
-
-import org.eclipse.jetty.spdy.api.Session;
-import org.eclipse.jetty.spdy.api.SessionFrameListener;
-
-/**
- * <p>Specific, server-side, {@link SessionFrameListener}.</p>
- * <p>In addition to {@link SessionFrameListener}, this listener adds method
- * {@link #onConnect(Session)} that is called when a client first connects to the
- * server and may be used by a server-side application to send a SETTINGS frame
- * to configure the connection before the client can open any stream.</p>
- */
-public interface ServerSessionFrameListener extends SessionFrameListener
-{
- /**
- * <p>Callback invoked when a client opens a connection.</p>
- *
- * @param session the session
- */
- public void onConnect(Session session);
-
- /**
- * <p>Empty implementation of {@link ServerSessionFrameListener}</p>
- */
- public static class Adapter extends SessionFrameListener.Adapter implements ServerSessionFrameListener
- {
- @Override
- public void onConnect(Session session)
- {
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java
deleted file mode 100644
index 5340db1027..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-public abstract class ControlFrame
-{
- public static final int HEADER_LENGTH = 8;
-
- private final short version;
- private final ControlFrameType type;
- private final byte flags;
-
- public ControlFrame(short version, ControlFrameType type, byte flags)
- {
- this.version = version;
- this.type = type;
- this.flags = flags;
- }
-
- public short getVersion()
- {
- return version;
- }
-
- public ControlFrameType getType()
- {
- return type;
- }
-
- public byte getFlags()
- {
- return flags;
- }
-
- @Override
- public String toString()
- {
- return String.format("%s frame v%s", getType(), getVersion());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java
deleted file mode 100644
index bb614deefa..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum ControlFrameType
-{
- SYN_STREAM((short)1),
- SYN_REPLY((short)2),
- RST_STREAM((short)3),
- SETTINGS((short)4),
- NOOP((short)5),
- PING((short)6),
- GO_AWAY((short)7),
- HEADERS((short)8),
- WINDOW_UPDATE((short)9),
- CREDENTIAL((short)10);
-
- public static ControlFrameType from(short code)
- {
- return Codes.codes.get(code);
- }
-
- private final short code;
-
- private ControlFrameType(short code)
- {
- this.code = code;
- Codes.codes.put(code, this);
- }
-
- public short getCode()
- {
- return code;
- }
-
- private static class Codes
- {
- private static final Map<Short, ControlFrameType> codes = new HashMap<>();
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java
deleted file mode 100644
index cf2af82a14..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import java.security.cert.Certificate;
-
-public class CredentialFrame extends ControlFrame
-{
- private final short slot;
- private final byte[] proof;
- private final Certificate[] certificateChain;
-
- public CredentialFrame(short version, short slot, byte[] proof, Certificate[] certificateChain)
- {
- super(version, ControlFrameType.CREDENTIAL, (byte)0);
- this.slot = slot;
- this.proof = proof;
- this.certificateChain = certificateChain;
- }
-
- public short getSlot()
- {
- return slot;
- }
-
- public byte[] getProof()
- {
- return proof;
- }
-
- public Certificate[] getCertificateChain()
- {
- return certificateChain;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java
deleted file mode 100644
index c58ef2c464..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.api.DataInfo;
-
-public class DataFrame
-{
- public static final int HEADER_LENGTH = 8;
-
- private final int streamId;
- private final byte flags;
- private final int length;
-
- public DataFrame(int streamId, byte flags, int length)
- {
- this.streamId = streamId;
- this.flags = flags;
- this.length = length;
- }
-
- public int getStreamId()
- {
- return streamId;
- }
-
- public byte getFlags()
- {
- return flags;
- }
-
- public int getLength()
- {
- return length;
- }
-
- public boolean isClose()
- {
- return (flags & DataInfo.FLAG_CLOSE) == DataInfo.FLAG_CLOSE;
- }
-
- @Override
- public String toString()
- {
- return String.format("DATA frame stream=%d length=%d close=%b", getStreamId(), getLength(), isClose());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java
deleted file mode 100644
index b7975c75ba..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.api.SessionStatus;
-
-public class GoAwayFrame extends ControlFrame
-{
- private final int lastStreamId;
- private final int statusCode;
-
- public GoAwayFrame(short version, int lastStreamId, int statusCode)
- {
- super(version, ControlFrameType.GO_AWAY, (byte)0);
- this.lastStreamId = lastStreamId;
- this.statusCode = statusCode;
- }
-
- public int getLastStreamId()
- {
- return lastStreamId;
- }
-
- public int getStatusCode()
- {
- return statusCode;
- }
-
- @Override
- public String toString()
- {
- SessionStatus sessionStatus = SessionStatus.from(getStatusCode());
- return String.format("%s last_stream=%d status=%s", super.toString(), getLastStreamId(), sessionStatus == null ? getStatusCode() : sessionStatus);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java
deleted file mode 100644
index 82e13eb362..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.api.HeadersInfo;
-import org.eclipse.jetty.util.Fields;
-
-public class HeadersFrame extends ControlFrame
-{
- private final int streamId;
- private final Fields headers;
-
- public HeadersFrame(short version, byte flags, int streamId, Fields headers)
- {
- super(version, ControlFrameType.HEADERS, flags);
- this.streamId = streamId;
- this.headers = headers;
- }
-
- public int getStreamId()
- {
- return streamId;
- }
-
- public Fields getHeaders()
- {
- return headers;
- }
-
- public boolean isClose()
- {
- return (getFlags() & HeadersInfo.FLAG_CLOSE) == HeadersInfo.FLAG_CLOSE;
- }
-
- public boolean isResetCompression()
- {
- return (getFlags() & HeadersInfo.FLAG_RESET_COMPRESSION) == HeadersInfo.FLAG_RESET_COMPRESSION;
- }
-
- @Override
- public String toString()
- {
- return String.format("%s stream=%d close=%b reset_compression=%b", super.toString(), getStreamId(), isClose(), isResetCompression());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java
deleted file mode 100644
index bb38170e23..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.api.SPDY;
-
-public class NoOpFrame extends ControlFrame
-{
- public NoOpFrame()
- {
- super(SPDY.V2, ControlFrameType.NOOP, (byte)0);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java
deleted file mode 100644
index 4258021ab2..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-public class PingFrame extends ControlFrame
-{
- private final int pingId;
-
- public PingFrame(short version, int pingId)
- {
- super(version, ControlFrameType.PING, (byte)0);
- this.pingId = pingId;
- }
-
- public int getPingId()
- {
- return pingId;
- }
-
- @Override
- public String toString()
- {
- return String.format("%s ping=%d", super.toString(), getPingId());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java
deleted file mode 100644
index d6b09ce93c..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.api.StreamStatus;
-
-public class RstStreamFrame extends ControlFrame
-{
- private final int streamId;
- private final int statusCode;
-
- public RstStreamFrame(short version, int streamId, int statusCode)
- {
- super(version, ControlFrameType.RST_STREAM, (byte)0);
- this.streamId = streamId;
- this.statusCode = statusCode;
- }
-
- public int getStreamId()
- {
- return streamId;
- }
-
- public int getStatusCode()
- {
- return statusCode;
- }
-
- @Override
- public String toString()
- {
- StreamStatus streamStatus = StreamStatus.from(getVersion(), getStatusCode());
- return String.format("%s stream=%d status=%s", super.toString(), getStreamId(), streamStatus == null ? getStatusCode() : streamStatus);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java
deleted file mode 100644
index 263936f230..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.api.Settings;
-import org.eclipse.jetty.spdy.api.SettingsInfo;
-
-public class SettingsFrame extends ControlFrame
-{
- private final Settings settings;
-
- public SettingsFrame(short version, byte flags, Settings settings)
- {
- super(version, ControlFrameType.SETTINGS, flags);
- this.settings = settings;
- }
-
- public boolean isClearPersisted()
- {
- return (getFlags() & SettingsInfo.CLEAR_PERSISTED) == SettingsInfo.CLEAR_PERSISTED;
- }
-
- public Settings getSettings()
- {
- return settings;
- }
-
- @Override
- public String toString()
- {
- return String.format("%s clear_persisted=%b settings=%s", super.toString(), isClearPersisted(), getSettings());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java
deleted file mode 100644
index 372b8eafa3..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.api.ReplyInfo;
-import org.eclipse.jetty.util.Fields;
-
-public class SynReplyFrame extends ControlFrame
-{
- private final int streamId;
- private final Fields headers;
-
- public SynReplyFrame(short version, byte flags, int streamId, Fields headers)
- {
- super(version, ControlFrameType.SYN_REPLY, flags);
- this.streamId = streamId;
- this.headers = headers;
- }
-
- public int getStreamId()
- {
- return streamId;
- }
-
- public Fields getHeaders()
- {
- return headers;
- }
-
- public boolean isClose()
- {
- return (getFlags() & ReplyInfo.FLAG_CLOSE) == ReplyInfo.FLAG_CLOSE;
- }
-
- @Override
- public String toString()
- {
- return String.format("%s stream=%d close=%b", super.toString(), getStreamId(), isClose());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java
deleted file mode 100644
index c6e5757190..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-import org.eclipse.jetty.spdy.PushSynInfo;
-import org.eclipse.jetty.spdy.api.SynInfo;
-import org.eclipse.jetty.util.Fields;
-
-public class SynStreamFrame extends ControlFrame
-{
- private final int streamId;
- private final int associatedStreamId;
- private final byte priority;
- private final short slot;
- private final Fields headers;
-
- public SynStreamFrame(short version, byte flags, int streamId, int associatedStreamId, byte priority, short slot, Fields headers)
- {
- super(version, ControlFrameType.SYN_STREAM, flags);
- this.streamId = streamId;
- this.associatedStreamId = associatedStreamId;
- this.priority = priority;
- this.slot = slot;
- this.headers = headers;
- }
-
- public int getStreamId()
- {
- return streamId;
- }
-
- public int getAssociatedStreamId()
- {
- return associatedStreamId;
- }
-
- public byte getPriority()
- {
- return priority;
- }
-
- public short getSlot()
- {
- return slot;
- }
-
- public Fields getHeaders()
- {
- return headers;
- }
-
- public boolean isClose()
- {
- return (getFlags() & SynInfo.FLAG_CLOSE) == SynInfo.FLAG_CLOSE;
- }
-
- public boolean isUnidirectional()
- {
- return (getFlags() & PushSynInfo.FLAG_UNIDIRECTIONAL) == PushSynInfo.FLAG_UNIDIRECTIONAL;
- }
-
- @Override
- public String toString()
- {
- return String.format("%s stream=%d close=%b", super.toString(), getStreamId(), isClose());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java
deleted file mode 100644
index e39e25efe4..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.frames;
-
-public class WindowUpdateFrame extends ControlFrame
-{
- private final int streamId;
- private final int windowDelta;
-
- public WindowUpdateFrame(short version, int streamId, int windowDelta)
- {
- super(version, ControlFrameType.WINDOW_UPDATE, (byte)0);
- this.streamId = streamId;
- this.windowDelta = windowDelta;
- }
-
- public int getStreamId()
- {
- return streamId;
- }
-
- public int getWindowDelta()
- {
- return windowDelta;
- }
-
- @Override
- public String toString()
- {
- return String.format("%s stream=%d delta=%d", super.toString(), getStreamId(), getWindowDelta());
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java
deleted file mode 100644
index 9a68cae1f2..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-
-public abstract class ControlFrameGenerator
-{
- private final ByteBufferPool bufferPool;
-
- protected ControlFrameGenerator(ByteBufferPool bufferPool)
- {
- this.bufferPool = bufferPool;
- }
-
- protected ByteBufferPool getByteBufferPool()
- {
- return bufferPool;
- }
-
- public abstract ByteBuffer generate(ControlFrame frame);
-
- protected void generateControlFrameHeader(ControlFrame frame, int frameLength, ByteBuffer buffer)
- {
- buffer.putShort((short)(0x8000 + frame.getVersion()));
- buffer.putShort(frame.getType().getCode());
- int flagsAndLength = frame.getFlags();
- flagsAndLength <<= 24;
- flagsAndLength += frameLength;
- buffer.putInt(flagsAndLength);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java
deleted file mode 100644
index 14e6cf11d6..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.SessionException;
-import org.eclipse.jetty.spdy.api.SessionStatus;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.CredentialFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class CredentialGenerator extends ControlFrameGenerator
-{
- public CredentialGenerator(ByteBufferPool bufferPool)
- {
- super(bufferPool);
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- CredentialFrame credential = (CredentialFrame)frame;
-
- byte[] proof = credential.getProof();
-
- List<byte[]> certificates = serializeCertificates(credential.getCertificateChain());
- int certificatesLength = 0;
- for (byte[] certificate : certificates)
- certificatesLength += certificate.length;
-
- int frameBodyLength = 2 + 4 + proof.length + certificates.size() * 4 + certificatesLength;
-
- int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(credential, frameBodyLength, buffer);
-
- buffer.putShort(credential.getSlot());
- buffer.putInt(proof.length);
- buffer.put(proof);
- for (byte[] certificate : certificates)
- {
- buffer.putInt(certificate.length);
- buffer.put(certificate);
- }
-
- buffer.flip();
- return buffer;
- }
-
- private List<byte[]> serializeCertificates(Certificate[] certificates)
- {
- try
- {
- List<byte[]> result = new ArrayList<>(certificates.length);
- for (Certificate certificate : certificates)
- result.add(certificate.getEncoded());
- return result;
- }
- catch (CertificateEncodingException x)
- {
- throw new SessionException(SessionStatus.PROTOCOL_ERROR, x);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java
deleted file mode 100644
index 998acd5bee..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.frames.DataFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class DataFrameGenerator
-{
- private final ByteBufferPool bufferPool;
-
- public DataFrameGenerator(ByteBufferPool bufferPool)
- {
- this.bufferPool = bufferPool;
- }
-
- public ByteBuffer generate(int streamId, int length, DataInfo dataInfo)
- {
- ByteBuffer buffer = bufferPool.acquire(DataFrame.HEADER_LENGTH + length, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- buffer.limit(length + DataFrame.HEADER_LENGTH);
- buffer.position(DataFrame.HEADER_LENGTH);
- // Guaranteed to always be >= 0
- int read = dataInfo.readInto(buffer);
-
- buffer.putInt(0, streamId & 0x7F_FF_FF_FF);
- buffer.putInt(4, read & 0x00_FF_FF_FF);
-
- byte flags = dataInfo.getFlags();
- if (dataInfo.available() > 0)
- flags &= ~DataInfo.FLAG_CLOSE;
- buffer.put(4, flags);
-
- buffer.flip();
- return buffer;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java
deleted file mode 100644
index 46a35a0509..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-import java.util.EnumMap;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.CompressionFactory;
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.ControlFrameType;
-
-public class Generator
-{
- final static boolean useDirectBuffers=false;
- private final EnumMap<ControlFrameType, ControlFrameGenerator> generators = new EnumMap<>(ControlFrameType.class);
- private final DataFrameGenerator dataFrameGenerator;
-
- public Generator(ByteBufferPool bufferPool, CompressionFactory.Compressor compressor)
- {
- HeadersBlockGenerator headersBlockGenerator = new HeadersBlockGenerator(compressor);
- generators.put(ControlFrameType.SYN_STREAM, new SynStreamGenerator(bufferPool, headersBlockGenerator));
- generators.put(ControlFrameType.SYN_REPLY, new SynReplyGenerator(bufferPool, headersBlockGenerator));
- generators.put(ControlFrameType.RST_STREAM, new RstStreamGenerator(bufferPool));
- generators.put(ControlFrameType.SETTINGS, new SettingsGenerator(bufferPool));
- generators.put(ControlFrameType.NOOP, new NoOpGenerator(bufferPool));
- generators.put(ControlFrameType.PING, new PingGenerator(bufferPool));
- generators.put(ControlFrameType.GO_AWAY, new GoAwayGenerator(bufferPool));
- generators.put(ControlFrameType.HEADERS, new HeadersGenerator(bufferPool, headersBlockGenerator));
- generators.put(ControlFrameType.WINDOW_UPDATE, new WindowUpdateGenerator(bufferPool));
- generators.put(ControlFrameType.CREDENTIAL, new CredentialGenerator(bufferPool));
-
- dataFrameGenerator = new DataFrameGenerator(bufferPool);
- }
-
- public ByteBuffer control(ControlFrame frame)
- {
- ControlFrameGenerator generator = generators.get(frame.getType());
- return generator.generate(frame);
- }
-
- public ByteBuffer data(int streamId, int length, DataInfo dataInfo)
- {
- return dataFrameGenerator.generate(streamId, length, dataInfo);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java
deleted file mode 100644
index 2a2e717697..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.GoAwayFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class GoAwayGenerator extends ControlFrameGenerator
-{
- public GoAwayGenerator(ByteBufferPool bufferPool)
- {
- super(bufferPool);
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- GoAwayFrame goAway = (GoAwayFrame)frame;
-
- int frameBodyLength = 8;
- int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(goAway, frameBodyLength, buffer);
-
- buffer.putInt(goAway.getLastStreamId() & 0x7F_FF_FF_FF);
- writeStatusCode(goAway, buffer);
-
- buffer.flip();
- return buffer;
- }
-
- private void writeStatusCode(GoAwayFrame goAway, ByteBuffer buffer)
- {
- switch (goAway.getVersion())
- {
- case SPDY.V2:
- break;
- case SPDY.V3:
- buffer.putInt(goAway.getStatusCode());
- break;
- default:
- throw new IllegalStateException();
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java
deleted file mode 100644
index 68e56bcb3a..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java
+++ /dev/null
@@ -1,150 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.io.ByteArrayOutputStream;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.jetty.spdy.CompressionDictionary;
-import org.eclipse.jetty.spdy.CompressionFactory;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.util.Fields;
-
-public class HeadersBlockGenerator
-{
- private final CompressionFactory.Compressor compressor;
- private boolean needsDictionary = true;
-
- public HeadersBlockGenerator(CompressionFactory.Compressor compressor)
- {
- this.compressor = compressor;
- }
-
- public ByteBuffer generate(short version, Fields headers)
- {
- // TODO: ByteArrayOutputStream is quite inefficient, but grows on demand; optimize using ByteBuffer ?
- final Charset iso1 = StandardCharsets.ISO_8859_1;
- ByteArrayOutputStream buffer = new ByteArrayOutputStream(headers.getSize() * 64);
- writeCount(version, buffer, headers.getSize());
- for (Fields.Field header : headers)
- {
- String name = header.getName().toLowerCase(Locale.ENGLISH);
- byte[] nameBytes = name.getBytes(iso1);
- writeNameLength(version, buffer, nameBytes.length);
- buffer.write(nameBytes, 0, nameBytes.length);
-
- // Most common path first
- String value = header.getValue();
- byte[] valueBytes = value.getBytes(iso1);
- if (header.hasMultipleValues())
- {
- List<String> values = header.getValues();
- for (int i = 1; i < values.size(); ++i)
- {
- byte[] moreValueBytes = values.get(i).getBytes(iso1);
- byte[] newValueBytes = Arrays.copyOf(valueBytes,valueBytes.length + 1 + moreValueBytes.length);
- newValueBytes[valueBytes.length] = 0;
- System.arraycopy(moreValueBytes, 0, newValueBytes, valueBytes.length + 1, moreValueBytes.length);
- valueBytes = newValueBytes;
- }
- }
-
- writeValueLength(version, buffer, valueBytes.length);
- buffer.write(valueBytes, 0, valueBytes.length);
- }
-
- return compress(version, buffer.toByteArray());
- }
-
- private ByteBuffer compress(short version, byte[] bytes)
- {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream(bytes.length);
-
- // The headers compression context is per-session, so we need to synchronize
- synchronized (compressor)
- {
- if (needsDictionary)
- {
- compressor.setDictionary(CompressionDictionary.get(version));
- needsDictionary = false;
- }
-
- compressor.setInput(bytes);
-
- // Compressed bytes may be bigger than input bytes, so we need to loop and accumulate them
- // Beware that the minimum amount of bytes generated by the compressor is few bytes, so we
- // need to use an output buffer that is big enough to exit the compress loop
- buffer.reset();
- int compressed;
- byte[] output = new byte[Math.max(256, bytes.length)];
- while (true)
- {
- // SPDY uses the SYNC_FLUSH mode
- compressed = compressor.compress(output);
- buffer.write(output, 0, compressed);
- if (compressed < output.length)
- break;
- }
- }
-
- return ByteBuffer.wrap(buffer.toByteArray());
- }
-
- private void writeCount(short version, ByteArrayOutputStream buffer, int value)
- {
- switch (version)
- {
- case SPDY.V2:
- {
- buffer.write((value & 0xFF_00) >>> 8);
- buffer.write(value & 0x00_FF);
- break;
- }
- case SPDY.V3:
- {
- buffer.write((value & 0xFF_00_00_00) >>> 24);
- buffer.write((value & 0x00_FF_00_00) >>> 16);
- buffer.write((value & 0x00_00_FF_00) >>> 8);
- buffer.write(value & 0x00_00_00_FF);
- break;
- }
- default:
- {
- // Here the version is trusted to be correct; if it's not
- // then it's a bug rather than an application error
- throw new IllegalStateException();
- }
- }
- }
-
- private void writeNameLength(short version, ByteArrayOutputStream buffer, int length)
- {
- writeCount(version, buffer, length);
- }
-
- private void writeValueLength(short version, ByteArrayOutputStream buffer, int length)
- {
- writeCount(version, buffer, length);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java
deleted file mode 100644
index 23b75eb206..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.SessionException;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.api.SessionStatus;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.HeadersFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class HeadersGenerator extends ControlFrameGenerator
-{
- private final HeadersBlockGenerator headersBlockGenerator;
-
- public HeadersGenerator(ByteBufferPool bufferPool, HeadersBlockGenerator headersBlockGenerator)
- {
- super(bufferPool);
- this.headersBlockGenerator = headersBlockGenerator;
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- HeadersFrame headers = (HeadersFrame)frame;
- short version = headers.getVersion();
-
- ByteBuffer headersBuffer = headersBlockGenerator.generate(version, headers.getHeaders());
-
- int frameBodyLength = 4;
- if (frame.getVersion() == SPDY.V2)
- frameBodyLength += 2;
-
- int frameLength = frameBodyLength + headersBuffer.remaining();
- if (frameLength > 0xFF_FF_FF)
- {
- // Too many headers, but unfortunately we have already modified the compression
- // context, so we have no other choice than tear down the connection.
- throw new SessionException(SessionStatus.PROTOCOL_ERROR, "Too many headers");
- }
-
- int totalLength = ControlFrame.HEADER_LENGTH + frameLength;
-
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(headers, frameLength, buffer);
-
- buffer.putInt(headers.getStreamId() & 0x7F_FF_FF_FF);
- if (frame.getVersion() == SPDY.V2)
- buffer.putShort((short)0);
-
- buffer.put(headersBuffer);
-
- buffer.flip();
- return buffer;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java
deleted file mode 100644
index 0c7c650486..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.NoOpFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class NoOpGenerator extends ControlFrameGenerator
-{
- public NoOpGenerator(ByteBufferPool bufferPool)
- {
- super(bufferPool);
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- NoOpFrame noOp = (NoOpFrame)frame;
-
- int frameBodyLength = 0;
- int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(noOp, frameBodyLength, buffer);
-
- buffer.flip();
- return buffer;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java
deleted file mode 100644
index 7237471784..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.PingFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class PingGenerator extends ControlFrameGenerator
-{
- public PingGenerator(ByteBufferPool bufferPool)
- {
- super(bufferPool);
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- PingFrame ping = (PingFrame)frame;
-
- int frameBodyLength = 4;
- int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(ping, frameBodyLength, buffer);
-
- buffer.putInt(ping.getPingId());
-
- buffer.flip();
- return buffer;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java
deleted file mode 100644
index 47b123cc3f..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.RstStreamFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class RstStreamGenerator extends ControlFrameGenerator
-{
- public RstStreamGenerator(ByteBufferPool bufferPool)
- {
- super(bufferPool);
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- RstStreamFrame rstStream = (RstStreamFrame)frame;
-
- int frameBodyLength = 8;
- int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(rstStream, frameBodyLength, buffer);
-
- buffer.putInt(rstStream.getStreamId() & 0x7F_FF_FF_FF);
- buffer.putInt(rstStream.getStatusCode());
-
- buffer.flip();
- return buffer;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java
deleted file mode 100644
index 0fcf2cf72b..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.api.Settings;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.SettingsFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class SettingsGenerator extends ControlFrameGenerator
-{
- public SettingsGenerator(ByteBufferPool bufferPool)
- {
- super(bufferPool);
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- SettingsFrame settingsFrame = (SettingsFrame)frame;
-
- Settings settings = settingsFrame.getSettings();
- int size = settings.size();
- int frameBodyLength = 4 + 8 * size;
- int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(settingsFrame, frameBodyLength, buffer);
-
- buffer.putInt(size);
-
- for (Settings.Setting setting : settings)
- {
- int id = setting.id().code();
- byte flags = setting.flag().code();
- int idAndFlags = convertIdAndFlags(frame.getVersion(), id, flags);
- buffer.putInt(idAndFlags);
- buffer.putInt(setting.value());
- }
-
- buffer.flip();
- return buffer;
- }
-
- private int convertIdAndFlags(short version, int id, byte flags)
- {
- switch (version)
- {
- case SPDY.V2:
- {
- // In v2 the format is 24 bits of ID + 8 bits of flag
- int idAndFlags = (id << 8) + (flags & 0xFF);
- // A bug in the Chromium implementation forces v2 to have
- // the 3 ID bytes little endian, so we swap first and third
- int result = idAndFlags & 0x00_FF_00_FF;
- result += (idAndFlags & 0xFF_00_00_00) >>> 16;
- result += (idAndFlags & 0x00_00_FF_00) << 16;
- return result;
- }
- case SPDY.V3:
- {
- // In v3 the format is 8 bits of flags + 24 bits of ID
- return (flags << 24) + (id & 0xFF_FF_FF);
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java
deleted file mode 100644
index 26ba734589..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.SessionException;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.api.SessionStatus;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.SynReplyFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class SynReplyGenerator extends ControlFrameGenerator
-{
- private final HeadersBlockGenerator headersBlockGenerator;
-
- public SynReplyGenerator(ByteBufferPool bufferPool, HeadersBlockGenerator headersBlockGenerator)
- {
- super(bufferPool);
- this.headersBlockGenerator = headersBlockGenerator;
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- SynReplyFrame synReply = (SynReplyFrame)frame;
- short version = synReply.getVersion();
-
- ByteBuffer headersBuffer = headersBlockGenerator.generate(version, synReply.getHeaders());
-
- int frameBodyLength = getFrameDataLength(version);
-
- int frameLength = frameBodyLength + headersBuffer.remaining();
- if (frameLength > 0xFF_FF_FF)
- {
- // Too many headers, but unfortunately we have already modified the compression
- // context, so we have no other choice than tear down the connection.
- throw new SessionException(SessionStatus.PROTOCOL_ERROR, "Too many headers");
- }
-
- int totalLength = ControlFrame.HEADER_LENGTH + frameLength;
-
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(synReply, frameLength, buffer);
-
- buffer.putInt(synReply.getStreamId() & 0x7F_FF_FF_FF);
- writeAdditional(version, buffer);
-
- buffer.put(headersBuffer);
-
- buffer.flip();
- return buffer;
- }
-
- private int getFrameDataLength(short version)
- {
- switch (version)
- {
- case SPDY.V2:
- return 6;
- case SPDY.V3:
- return 4;
- default:
- // Here the version is trusted to be correct; if it's not
- // then it's a bug rather than an application error
- throw new IllegalStateException();
- }
- }
-
- private void writeAdditional(short version, ByteBuffer buffer)
- {
- switch (version)
- {
- case SPDY.V2:
- buffer.putShort((short)0);
- break;
- case SPDY.V3:
- break;
- default:
- // Here the version is trusted to be correct; if it's not
- // then it's a bug rather than an application error
- throw new IllegalStateException();
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java
deleted file mode 100644
index 2ad58fcc79..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.SessionException;
-import org.eclipse.jetty.spdy.StreamException;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.api.SessionStatus;
-import org.eclipse.jetty.spdy.api.StreamStatus;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.SynStreamFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class SynStreamGenerator extends ControlFrameGenerator
-{
- private final HeadersBlockGenerator headersBlockGenerator;
-
- public SynStreamGenerator(ByteBufferPool bufferPool, HeadersBlockGenerator headersBlockGenerator)
- {
- super(bufferPool);
- this.headersBlockGenerator = headersBlockGenerator;
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- SynStreamFrame synStream = (SynStreamFrame)frame;
- short version = synStream.getVersion();
-
- ByteBuffer headersBuffer = headersBlockGenerator.generate(version, synStream.getHeaders());
-
- int frameBodyLength = 10;
-
- int frameLength = frameBodyLength + headersBuffer.remaining();
- if (frameLength > 0xFF_FF_FF)
- {
- // Too many headers, but unfortunately we have already modified the compression
- // context, so we have no other choice than tear down the connection.
- throw new SessionException(SessionStatus.PROTOCOL_ERROR, "Too many headers");
- }
-
- int totalLength = ControlFrame.HEADER_LENGTH + frameLength;
-
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(synStream, frameLength, buffer);
-
- int streamId = synStream.getStreamId();
- buffer.putInt(streamId & 0x7F_FF_FF_FF);
- buffer.putInt(synStream.getAssociatedStreamId() & 0x7F_FF_FF_FF);
- writePriority(streamId, version, synStream.getPriority(), buffer);
- buffer.put((byte)synStream.getSlot());
-
- buffer.put(headersBuffer);
-
- buffer.flip();
- return buffer;
- }
-
- private void writePriority(int streamId, short version, byte priority, ByteBuffer buffer)
- {
- switch (version)
- {
- case SPDY.V2:
- priority <<= 6;
- break;
- case SPDY.V3:
- priority <<= 5;
- break;
- default:
- throw new StreamException(streamId, StreamStatus.UNSUPPORTED_VERSION);
- }
- buffer.put(priority);
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java
deleted file mode 100644
index 2ee745e718..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.generator;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.WindowUpdateFrame;
-import org.eclipse.jetty.util.BufferUtil;
-
-public class WindowUpdateGenerator extends ControlFrameGenerator
-{
- public WindowUpdateGenerator(ByteBufferPool bufferPool)
- {
- super(bufferPool);
- }
-
- @Override
- public ByteBuffer generate(ControlFrame frame)
- {
- WindowUpdateFrame windowUpdate = (WindowUpdateFrame)frame;
-
- int frameBodyLength = 8;
- int totalLength = ControlFrame.HEADER_LENGTH + frameBodyLength;
- ByteBuffer buffer = getByteBufferPool().acquire(totalLength, Generator.useDirectBuffers);
- BufferUtil.clearToFill(buffer);
- generateControlFrameHeader(windowUpdate, frameBodyLength, buffer);
-
- buffer.putInt(windowUpdate.getStreamId() & 0x7F_FF_FF_FF);
- buffer.putInt(windowUpdate.getWindowDelta() & 0x7F_FF_FF_FF);
-
- buffer.flip();
- return buffer;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java
deleted file mode 100644
index 435f887e8f..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.nio.ByteBuffer;
-
-public abstract class ControlFrameBodyParser
-{
- public abstract boolean parse(ByteBuffer buffer);
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java
deleted file mode 100644
index e4162a7703..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.nio.ByteBuffer;
-import java.util.EnumMap;
-
-import org.eclipse.jetty.spdy.CompressionFactory;
-import org.eclipse.jetty.spdy.frames.ControlFrame;
-import org.eclipse.jetty.spdy.frames.ControlFrameType;
-
-public abstract class ControlFrameParser
-{
- private final EnumMap<ControlFrameType, ControlFrameBodyParser> parsers = new EnumMap<>(ControlFrameType.class);
- private final ControlFrameBodyParser unknownParser = new UnknownControlFrameBodyParser(this);
- private State state = State.VERSION;
- private int cursor;
- private short version;
- private short type;
- private byte flags;
- private int length;
- private ControlFrameBodyParser bodyParser;
- private int bytesToSkip = 0;
-
- public ControlFrameParser(CompressionFactory.Decompressor decompressor)
- {
- parsers.put(ControlFrameType.SYN_STREAM, new SynStreamBodyParser(decompressor, this));
- parsers.put(ControlFrameType.SYN_REPLY, new SynReplyBodyParser(decompressor, this));
- parsers.put(ControlFrameType.RST_STREAM, new RstStreamBodyParser(this));
- parsers.put(ControlFrameType.SETTINGS, new SettingsBodyParser(this));
- parsers.put(ControlFrameType.NOOP, new NoOpBodyParser(this));
- parsers.put(ControlFrameType.PING, new PingBodyParser(this));
- parsers.put(ControlFrameType.GO_AWAY, new GoAwayBodyParser(this));
- parsers.put(ControlFrameType.HEADERS, new HeadersBodyParser(decompressor, this));
- parsers.put(ControlFrameType.WINDOW_UPDATE, new WindowUpdateBodyParser(this));
- parsers.put(ControlFrameType.CREDENTIAL, new CredentialBodyParser(this));
- }
-
- public short getVersion()
- {
- return version;
- }
-
- public byte getFlags()
- {
- return flags;
- }
-
- public int getLength()
- {
- return length;
- }
-
- public void skip(int bytesToSkip)
- {
- state = State.SKIP;
- this.bytesToSkip = bytesToSkip;
- }
-
- public boolean parse(ByteBuffer buffer)
- {
- while (buffer.hasRemaining())
- {
- switch (state)
- {
- case VERSION:
- {
- if (buffer.remaining() >= 2)
- {
- version = (short)(buffer.getShort() & 0x7F_FF);
- state = State.TYPE;
- }
- else
- {
- state = State.VERSION_BYTES;
- cursor = 2;
- }
- break;
- }
- case VERSION_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- version += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- {
- version &= 0x7F_FF;
- state = State.TYPE;
- }
- break;
- }
- case TYPE:
- {
- if (buffer.remaining() >= 2)
- {
- type = buffer.getShort();
- state = State.FLAGS;
- }
- else
- {
- state = State.TYPE_BYTES;
- cursor = 2;
- }
- break;
- }
- case TYPE_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- type += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- state = State.FLAGS;
- break;
- }
- case FLAGS:
- {
- flags = buffer.get();
- cursor = 3;
- state = State.LENGTH;
- break;
- }
- case LENGTH:
- {
- byte currByte = buffer.get();
- --cursor;
- length += (currByte & 0xFF) << 8 * cursor;
- if (cursor > 0)
- break;
-
- ControlFrameType controlFrameType = ControlFrameType.from(type);
-
- // SPEC v3, 2.2.1: unrecognized control frames must be ignored
- if (controlFrameType == null)
- bodyParser = unknownParser;
- else
- bodyParser = parsers.get(controlFrameType);
-
- state = State.BODY;
-
- // We have to let it fall through the next switch:
- // the NOOP frame has no body and we cannot break
- // because the buffer may be consumed and we will
- // never enter the BODY case.
- }
- case BODY:
- {
- if (bodyParser.parse(buffer))
- {
- reset();
- return true;
- }
- break;
- }
- case SKIP:
- {
- int remaining = buffer.remaining();
- if (remaining >= bytesToSkip)
- {
- buffer.position(buffer.position() + bytesToSkip);
- reset();
- return true;
- }
- else
- {
- buffer.position(buffer.limit());
- bytesToSkip = bytesToSkip - remaining;
- return false;
- }
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- return false;
- }
-
- void reset()
- {
- state = State.VERSION;
- cursor = 0;
- version = 0;
- type = 0;
- flags = 0;
- length = 0;
- bodyParser = null;
- bytesToSkip = 0;
- }
-
- protected abstract void onControlFrame(ControlFrame frame);
-
- private enum State
- {
- VERSION, VERSION_BYTES, TYPE, TYPE_BYTES, FLAGS, LENGTH, BODY, SKIP
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java
deleted file mode 100644
index a0e38e596e..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java
+++ /dev/null
@@ -1,274 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.io.ByteArrayInputStream;
-import java.nio.ByteBuffer;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jetty.spdy.SessionException;
-import org.eclipse.jetty.spdy.api.SessionStatus;
-import org.eclipse.jetty.spdy.frames.ControlFrameType;
-import org.eclipse.jetty.spdy.frames.CredentialFrame;
-
-public class CredentialBodyParser extends ControlFrameBodyParser
-{
- private final List<Certificate> certificates = new ArrayList<>();
- private final ControlFrameParser controlFrameParser;
- private State state = State.SLOT;
- private int totalLength;
- private int cursor;
- private short slot;
- private int proofLength;
- private byte[] proof;
- private int certificateLength;
- private byte[] certificate;
-
- public CredentialBodyParser(ControlFrameParser controlFrameParser)
- {
- this.controlFrameParser = controlFrameParser;
- }
-
- @Override
- public boolean parse(ByteBuffer buffer)
- {
- while (buffer.hasRemaining())
- {
- switch (state)
- {
- case SLOT:
- {
- if (buffer.remaining() >= 2)
- {
- slot = buffer.getShort();
- checkSlotValid();
- state = State.PROOF_LENGTH;
- }
- else
- {
- state = State.SLOT_BYTES;
- cursor = 2;
- }
- break;
- }
- case SLOT_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- slot += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- {
- checkSlotValid();
- state = State.PROOF_LENGTH;
- }
- break;
- }
- case PROOF_LENGTH:
- {
- if (buffer.remaining() >= 4)
- {
- proofLength = buffer.getInt() & 0x7F_FF_FF_FF;
- state = State.PROOF;
- }
- else
- {
- state = State.PROOF_LENGTH_BYTES;
- cursor = 4;
- }
- break;
- }
- case PROOF_LENGTH_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- proofLength += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- {
- proofLength &= 0x7F_FF_FF_FF;
- state = State.PROOF;
- }
- break;
- }
- case PROOF:
- {
- totalLength = controlFrameParser.getLength() - 2 - 4 - proofLength;
- proof = new byte[proofLength];
- if (buffer.remaining() >= proofLength)
- {
- buffer.get(proof);
- state = State.CERTIFICATE_LENGTH;
- if (totalLength == 0)
- {
- onCredential();
- return true;
- }
- }
- else
- {
- state = State.PROOF_BYTES;
- cursor = proofLength;
- }
- break;
- }
- case PROOF_BYTES:
- {
- proof[proofLength - cursor] = buffer.get();
- --cursor;
- if (cursor == 0)
- {
- state = State.CERTIFICATE_LENGTH;
- if (totalLength == 0)
- {
- onCredential();
- return true;
- }
- }
- break;
- }
- case CERTIFICATE_LENGTH:
- {
- if (buffer.remaining() >= 4)
- {
- certificateLength = buffer.getInt() & 0x7F_FF_FF_FF;
- state = State.CERTIFICATE;
- }
- else
- {
- state = State.CERTIFICATE_LENGTH_BYTES;
- cursor = 4;
- }
- break;
- }
- case CERTIFICATE_LENGTH_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- certificateLength += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- {
- certificateLength &= 0x7F_FF_FF_FF;
- state = State.CERTIFICATE;
- }
- break;
- }
- case CERTIFICATE:
- {
- totalLength -= 4 + certificateLength;
- certificate = new byte[certificateLength];
- if (buffer.remaining() >= certificateLength)
- {
- buffer.get(certificate);
- if (onCertificate())
- return true;
- }
- else
- {
- state = State.CERTIFICATE_BYTES;
- cursor = certificateLength;
- }
- break;
- }
- case CERTIFICATE_BYTES:
- {
- certificate[certificateLength - cursor] = buffer.get();
- --cursor;
- if (cursor == 0)
- {
- if (onCertificate())
- return true;
- }
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- return false;
- }
-
- private void checkSlotValid()
- {
- if (slot <= 0)
- throw new SessionException(SessionStatus.PROTOCOL_ERROR,
- "Invalid slot " + slot + " for " + ControlFrameType.CREDENTIAL + " frame");
- }
-
- private boolean onCertificate()
- {
- certificates.add(deserializeCertificate(certificate));
- if (totalLength == 0)
- {
- onCredential();
- return true;
- }
- else
- {
- certificateLength = 0;
- state = State.CERTIFICATE_LENGTH;
- }
- return false;
- }
-
- private Certificate deserializeCertificate(byte[] bytes)
- {
- try
- {
- CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
- return certificateFactory.generateCertificate(new ByteArrayInputStream(bytes));
- }
- catch (CertificateException x)
- {
- throw new SessionException(SessionStatus.PROTOCOL_ERROR, x);
- }
- }
-
- private void onCredential()
- {
- CredentialFrame frame = new CredentialFrame(controlFrameParser.getVersion(), slot,
- Arrays.copyOf(proof, proof.length), certificates.toArray(new Certificate[certificates.size()]));
- controlFrameParser.onControlFrame(frame);
- reset();
- }
-
- private void reset()
- {
- state = State.SLOT;
- totalLength = 0;
- cursor = 0;
- slot = 0;
- proofLength = 0;
- proof = null;
- certificateLength = 0;
- certificate = null;
- certificates.clear();
- }
-
- public enum State
- {
- SLOT, SLOT_BYTES, PROOF_LENGTH, PROOF_LENGTH_BYTES, PROOF, PROOF_BYTES,
- CERTIFICATE_LENGTH, CERTIFICATE_LENGTH_BYTES, CERTIFICATE, CERTIFICATE_BYTES
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java
deleted file mode 100644
index 49f6c9796f..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.spdy.api.DataInfo;
-import org.eclipse.jetty.spdy.frames.DataFrame;
-
-public abstract class DataFrameParser
-{
- private State state = State.STREAM_ID;
- private int cursor;
- private int streamId;
- private byte flags;
- private int length;
-
- /**
- * <p>Parses the given {@link ByteBuffer} for a data frame.</p>
- *
- * @param buffer the {@link ByteBuffer} to parse
- * @return true if the data frame has been fully parsed, false otherwise
- */
- public boolean parse(ByteBuffer buffer)
- {
- while (buffer.hasRemaining())
- {
- switch (state)
- {
- case STREAM_ID:
- {
- if (buffer.remaining() >= 4)
- {
- streamId = buffer.getInt() & 0x7F_FF_FF_FF;
- state = State.FLAGS;
- }
- else
- {
- state = State.STREAM_ID_BYTES;
- cursor = 4;
- }
- break;
- }
- case STREAM_ID_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- streamId += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- state = State.FLAGS;
- break;
- }
- case FLAGS:
- {
- flags = buffer.get();
- cursor = 3;
- state = State.LENGTH;
- break;
- }
- case LENGTH:
- {
- byte currByte = buffer.get();
- --cursor;
- length += (currByte & 0xFF) << 8 * cursor;
- if (cursor > 0)
- break;
- state = State.DATA;
- // Fall down if length == 0: we can't loop because the buffer
- // may be empty but we need to invoke the application anyway
- if (length > 0)
- break;
- }
- case DATA:
- {
- // Length can only be at most 3 bytes, which is 16_777_215 i.e. 16 MiB.
- // However, compliant clients should implement flow control, so it's
- // unlikely that we will get that 16 MiB chunk.
- // However, TCP may further split the flow control window, so we may
- // only have part of the data at this point.
-
- int size = Math.min(length, buffer.remaining());
- int limit = buffer.limit();
- buffer.limit(buffer.position() + size);
- ByteBuffer bytes = buffer.slice();
- buffer.limit(limit);
- buffer.position(buffer.position() + size);
- length -= size;
- if (length == 0)
- {
- onDataFrame(bytes);
- return true;
- }
- else
- {
- // We got only part of the frame data bytes,
- // so we generate a synthetic data frame
- onDataFragment(bytes);
- }
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- return false;
- }
-
- private void onDataFrame(ByteBuffer bytes)
- {
- DataFrame frame = new DataFrame(streamId, flags, bytes.remaining());
- onDataFrame(frame, bytes);
- reset();
- }
-
- private void onDataFragment(ByteBuffer bytes)
- {
- DataFrame frame = new DataFrame(streamId, (byte)(flags & ~DataInfo.FLAG_CLOSE), bytes.remaining());
- onDataFrame(frame, bytes);
- // Do not reset, we're expecting more data
- }
-
- protected abstract void onDataFrame(DataFrame frame, ByteBuffer data);
-
- private void reset()
- {
- state = State.STREAM_ID;
- cursor = 0;
- streamId = 0;
- flags = 0;
- length = 0;
- }
-
- private enum State
- {
- STREAM_ID, STREAM_ID_BYTES, FLAGS, LENGTH, DATA
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java
deleted file mode 100644
index 9b536d06eb..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.frames.GoAwayFrame;
-
-public class GoAwayBodyParser extends ControlFrameBodyParser
-{
- private final ControlFrameParser controlFrameParser;
- private State state = State.LAST_GOOD_STREAM_ID;
- private int cursor;
- private int lastStreamId;
- private int statusCode;
-
- public GoAwayBodyParser(ControlFrameParser controlFrameParser)
- {
- this.controlFrameParser = controlFrameParser;
- }
-
- @Override
- public boolean parse(ByteBuffer buffer)
- {
- while (buffer.hasRemaining())
- {
- switch (state)
- {
- case LAST_GOOD_STREAM_ID:
- {
- if (buffer.remaining() >= 4)
- {
- lastStreamId = buffer.getInt() & 0x7F_FF_FF_FF;
- switch (controlFrameParser.getVersion())
- {
- case SPDY.V2:
- {
- onGoAway();
- return true;
- }
- case SPDY.V3:
- {
- state = State.STATUS_CODE;
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- else
- {
- state = State.LAST_GOOD_STREAM_ID_BYTES;
- cursor = 4;
- }
- break;
- }
- case LAST_GOOD_STREAM_ID_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- lastStreamId += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- {
- lastStreamId &= 0x7F_FF_FF_FF;
- switch (controlFrameParser.getVersion())
- {
- case SPDY.V2:
- {
- onGoAway();
- return true;
- }
- case SPDY.V3:
- {
- state = State.STATUS_CODE;
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- break;
- }
- case STATUS_CODE:
- {
- if (buffer.remaining() >= 4)
- {
- statusCode = buffer.getInt();
- onGoAway();
- return true;
- }
- else
- {
- state = State.STATUS_CODE_BYTES;
- cursor = 4;
- }
- break;
- }
- case STATUS_CODE_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- statusCode += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- {
- onGoAway();
- return true;
- }
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- return false;
- }
-
- private void onGoAway()
- {
- GoAwayFrame frame = new GoAwayFrame(controlFrameParser.getVersion(), lastStreamId, statusCode);
- controlFrameParser.onControlFrame(frame);
- reset();
- }
-
- private void reset()
- {
- state = State.LAST_GOOD_STREAM_ID;
- cursor = 0;
- lastStreamId = 0;
- statusCode = 0;
- }
-
- private enum State
- {
- LAST_GOOD_STREAM_ID, LAST_GOOD_STREAM_ID_BYTES, STATUS_CODE, STATUS_CODE_BYTES
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java
deleted file mode 100644
index 8337d13efc..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java
+++ /dev/null
@@ -1,230 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.zip.ZipException;
-
-import org.eclipse.jetty.spdy.CompressionDictionary;
-import org.eclipse.jetty.spdy.CompressionFactory;
-import org.eclipse.jetty.spdy.SessionException;
-import org.eclipse.jetty.spdy.StreamException;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.api.SessionStatus;
-import org.eclipse.jetty.spdy.api.StreamStatus;
-
-public abstract class HeadersBlockParser
-{
- private final CompressionFactory.Decompressor decompressor;
- private byte[] data;
- private boolean needsDictionary = true;
-
- protected HeadersBlockParser(CompressionFactory.Decompressor decompressor)
- {
- this.decompressor = decompressor;
- }
-
- public boolean parse(int streamId, short version, int length, ByteBuffer buffer)
- {
- // Need to be sure that all the compressed data has arrived
- // Because SPDY uses SYNC_FLUSH mode, and the Java API
- // does not expose when decompression is finished with this mode
- // (but only when using NO_FLUSH), then we need to
- // accumulate the compressed bytes until we have all of them
-
- boolean accumulated = accumulate(length, buffer);
- if (!accumulated)
- return false;
-
- byte[] compressedHeaders = data;
- data = null;
- ByteBuffer decompressedHeaders = decompress(version, compressedHeaders);
-
- Charset iso1 = StandardCharsets.ISO_8859_1;
- // We know the decoded bytes contain the full headers,
- // so optimize instead of looping byte by byte
- int count = readCount(version, decompressedHeaders);
- for (int i = 0; i < count; ++i)
- {
- int nameLength = readNameLength(version, decompressedHeaders);
- if (nameLength == 0)
- throw new StreamException(streamId, StreamStatus.PROTOCOL_ERROR, "Invalid header name length");
- byte[] nameBytes = new byte[nameLength];
- decompressedHeaders.get(nameBytes);
- String name = new String(nameBytes, iso1);
-
- int valueLength = readValueLength(version, decompressedHeaders);
- if (valueLength == 0)
- throw new StreamException(streamId, StreamStatus.PROTOCOL_ERROR, "Invalid header value length");
- byte[] valueBytes = new byte[valueLength];
- decompressedHeaders.get(valueBytes);
- String value = new String(valueBytes, iso1);
- // Multi valued headers are separate by NUL
- String[] values = value.split("\u0000");
- // Check if there are multiple NULs (section 2.6.9)
- for (String v : values)
- if (v.length() == 0)
- throw new StreamException(streamId, StreamStatus.PROTOCOL_ERROR, "Invalid multi valued header");
-
- onHeader(name, values);
- }
-
- return true;
- }
-
- private boolean accumulate(int length, ByteBuffer buffer)
- {
- int remaining = buffer.remaining();
- if (data == null)
- {
- if (remaining < length)
- {
- data = new byte[remaining];
- buffer.get(data);
- return false;
- }
- else
- {
- data = new byte[length];
- buffer.get(data);
- return true;
- }
- }
- else
- {
- int accumulated = data.length;
- int needed = length - accumulated;
- if (remaining < needed)
- {
- byte[] local = Arrays.copyOf(data,accumulated + remaining);
- buffer.get(local, accumulated, remaining);
- data = local;
- return false;
- }
- else
- {
- byte[] local = Arrays.copyOf(data,length);
- buffer.get(local, accumulated, needed);
- data = local;
- return true;
- }
- }
- }
-
- private int readCount(int version, ByteBuffer buffer)
- {
- switch (version)
- {
- case SPDY.V2:
- return buffer.getShort();
- case SPDY.V3:
- return buffer.getInt();
- default:
- throw new IllegalStateException();
- }
- }
-
- private int readNameLength(int version, ByteBuffer buffer)
- {
- return readCount(version, buffer);
- }
-
- private int readValueLength(int version, ByteBuffer buffer)
- {
- return readCount(version, buffer);
- }
-
- protected abstract void onHeader(String name, String[] values);
-
- private ByteBuffer decompress(short version, byte[] compressed)
- {
- // Differently from compression, decompression always happens
- // non-concurrently because we read and parse with a single
- // thread, and therefore there is no need for synchronization.
-
- try
- {
- byte[] decompressed = null;
- byte[] buffer = new byte[compressed.length * 2];
- decompressor.setInput(compressed);
-
- while (true)
- {
- int count = decompressor.decompress(buffer);
- if (count == 0)
- {
- if (decompressed != null)
- {
- return ByteBuffer.wrap(decompressed);
- }
- else if (needsDictionary)
- {
- decompressor.setDictionary(CompressionDictionary.get(version));
- needsDictionary = false;
- }
- else
- {
- throw new IllegalStateException();
- }
- }
- else
- {
- if (count < buffer.length)
- {
- if (decompressed == null)
- {
- // Only one pass was needed to decompress
- return ByteBuffer.wrap(buffer, 0, count);
- }
- else
- {
- // Last pass needed to decompress, merge decompressed bytes
- byte[] result = Arrays.copyOf(decompressed,decompressed.length+count);
- System.arraycopy(buffer, 0, result, decompressed.length, count);
- return ByteBuffer.wrap(result);
- }
- }
- else
- {
- if (decompressed == null)
- {
- decompressed = buffer;
- buffer = new byte[buffer.length];
- }
- else
- {
- byte[] result = Arrays.copyOf(decompressed,decompressed.length+buffer.length);
- System.arraycopy(buffer, 0, result, decompressed.length, buffer.length);
- decompressed = result;
- }
- }
- }
- }
- }
- catch (ZipException x)
- {
- // We had a compression problem, and since the compression context
- // is per-connection, we need to tear down the connection
- throw new SessionException(SessionStatus.PROTOCOL_ERROR, x);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java
deleted file mode 100644
index 5484a11169..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java
+++ /dev/null
@@ -1,173 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.spdy.CompressionFactory;
-import org.eclipse.jetty.spdy.api.HeadersInfo;
-import org.eclipse.jetty.spdy.api.SPDY;
-import org.eclipse.jetty.spdy.frames.ControlFrameType;
-import org.eclipse.jetty.spdy.frames.HeadersFrame;
-import org.eclipse.jetty.util.Fields;
-
-public class HeadersBodyParser extends ControlFrameBodyParser
-{
- private final Fields headers = new Fields();
- private final ControlFrameParser controlFrameParser;
- private final HeadersBlockParser headersBlockParser;
- private State state = State.STREAM_ID;
- private int cursor;
- private int streamId;
-
- public HeadersBodyParser(CompressionFactory.Decompressor decompressor, ControlFrameParser controlFrameParser)
- {
- this.controlFrameParser = controlFrameParser;
- this.headersBlockParser = new HeadersHeadersBlockParser(decompressor);
- }
-
- @Override
- public boolean parse(ByteBuffer buffer)
- {
- while (buffer.hasRemaining())
- {
- switch (state)
- {
- case STREAM_ID:
- {
- if (buffer.remaining() >= 4)
- {
- streamId = buffer.getInt() & 0x7F_FF_FF_FF;
- state = State.ADDITIONAL;
- }
- else
- {
- state = State.STREAM_ID_BYTES;
- cursor = 4;
- }
- break;
- }
- case STREAM_ID_BYTES:
- {
- byte currByte = buffer.get();
- --cursor;
- streamId += (currByte & 0xFF) << 8 * cursor;
- if (cursor == 0)
- {
- streamId &= 0x7F_FF_FF_FF;
- state = State.ADDITIONAL;
- }
- break;
- }
- case ADDITIONAL:
- {
- switch (controlFrameParser.getVersion())
- {
- case SPDY.V2:
- {
- if (buffer.remaining() >= 2)
- {
- buffer.getShort();
- state = State.HEADERS;
- }
- else
- {
- state = State.ADDITIONAL_BYTES;
- cursor = 2;
- }
- break;
- }
- case SPDY.V3:
- {
- state = State.HEADERS;
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- break;
- }
- case ADDITIONAL_BYTES:
- {
- assert controlFrameParser.getVersion() == SPDY.V2;
- buffer.get();
- --cursor;
- if (cursor == 0)
- state = State.HEADERS;
- break;
- }
- case HEADERS:
- {
- short version = controlFrameParser.getVersion();
- int length = controlFrameParser.getLength() - 4;
- if (version == SPDY.V2)
- length -= 2;
- if (headersBlockParser.parse(streamId, version, length, buffer))
- {
- byte flags = controlFrameParser.getFlags();
- if (flags != 0 && flags != HeadersInfo.FLAG_CLOSE && flags != HeadersInfo.FLAG_RESET_COMPRESSION)
- throw new IllegalArgumentException("Invalid flag " + flags + " for frame " + ControlFrameType.HEADERS);
-
- HeadersFrame frame = new HeadersFrame(version, flags, streamId, new Fields(headers, true));
- controlFrameParser.onControlFrame(frame);
-
- reset();
- return true;
- }
- break;
- }
- default:
- {
- throw new IllegalStateException();
- }
- }
- }
- return false;
- }
-
- private void reset()
- {
- headers.clear();
- state = State.STREAM_ID;
- cursor = 0;
- streamId = 0;
- }
-
- private enum State
- {
- STREAM_ID, STREAM_ID_BYTES, ADDITIONAL, ADDITIONAL_BYTES, HEADERS
- }
-
- private class HeadersHeadersBlockParser extends HeadersBlockParser
- {
- public HeadersHeadersBlockParser(CompressionFactory.Decompressor decompressor)
- {
- super(decompressor);
- }
-
- @Override
- protected void onHeader(String name, String[] values)
- {
- for (String value : values)
- headers.add(name, value);
- }
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java
deleted file mode 100644
index 1855c59f4a..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 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.spdy.parser;
-
-import java.nio.ByteBuffer;
-
-import org.eclipse.jetty.spdy.frames.NoOpFrame;
-
-public class NoOpBodyParser extends ControlFrameBodyParser
-{
- private final ControlFrameParser controlFrameParser;
-
- public NoOpBodyParser(ControlFrameParser controlFrameParser)
- {
- this.controlFrameParser = controlFrameParser;
- }
-
- @Override
- public boolean parse(ByteBuffer buffer)
- {
- NoOpFrame frame = new NoOpFrame();
- controlFrameParser.onControlFrame(frame);
- return true;
- }
-}
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java
deleted file mode 100644
index 97d1dd0fcf..0000000000
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java
+++ /dev/null
@@ -1,240 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made