Skip to content

Commit

Permalink
Update grizzly to 2.3.29 and handle gzip/lzma content-encoding of req…
Browse files Browse the repository at this point in the history
…uests (#1425)

Update grizzly to 2.3.29 and handle gzip/lzma content-encoding of requests PAYARA-1288 PAYARA-1441
  • Loading branch information
matthiasblaesing authored and smillidge committed Mar 3, 2017
1 parent 8ab2ae1 commit 4b1eb74
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ public void configure(final ServiceLocator habitat,
}
}

if (spdyVersions == null || spdyVersions.length == 0) {
spdyVersions = GlassFishSpdyAddOn.getAllVersions();
if(spdyVersions != null && spdyVersions.length > 0) {
spdyAddOn = new GlassFishSpdyAddOn(spdyMode, spdyVersions);
} else {
spdyAddOn = new GlassFishSpdyAddOn(spdyMode);
}

spdyAddOn = new GlassFishSpdyAddOn(spdyMode, spdyVersions);

spdyAddOn.setInitialWindowSize(Integer.getInteger(spdy.getInitialWindowSizeInBytes()));
spdyAddOn.setMaxConcurrentStreams(Integer.getInteger(spdy.getMaxConcurrentStreams()));
spdyAddOn.setMaxFrameLength(Integer.getInteger(spdy.getMaxFrameLengthInBytes()));
Expand All @@ -130,6 +130,10 @@ public void setup(
private static class GlassFishSpdyAddOn extends SpdyAddOn {
private FilterChainBuilder filterChainBuilder;

public GlassFishSpdyAddOn(final SpdyMode mode) {
super(mode);
}

public GlassFishSpdyAddOn(final SpdyMode mode,
final SpdyVersion... supportedSpdyVersions) {
super(mode, supportedSpdyVersions);
Expand All @@ -149,9 +153,6 @@ protected TransportProbe getConfigProbe() {
return new SpdyNpnConfigProbe(filterChainBuilder);
}

private static SpdyVersion[] getAllVersions() {
return ALL_SPDY_VERSIONS;
}
// ---------------------------------------------------------- Nested Classes

private final class SpdyNpnConfigProbe extends TransportProbe.Adapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ protected void configureHttpProtocol(final ServiceLocator habitat,
getTimeoutSeconds(http), TimeUnit.SECONDS));
final org.glassfish.grizzly.http.HttpServerFilter httpServerFilter =
createHttpServerCodecFilter(http);
httpServerFilter.setRemoveHandledContentEncodingHeaders(true);
final Set<ContentEncoding> contentEncodings =
configureContentEncodings(http);
for (ContentEncoding contentEncoding : contentEncodings) {
Expand Down Expand Up @@ -1102,11 +1103,15 @@ protected Set<ContentEncoding> configureCompressionEncodings(Http http) {
new CompressionEncodingFilter(compressionLevel, compressionMinSize,
compressableMimeTypes,
noCompressionUserAgents,
GZipContentEncoding.getGzipAliases()));
GZipContentEncoding.getGzipAliases(),
compressionLevel != CompressionLevel.OFF
));
final ContentEncoding lzmaEncoding = new LZMAContentEncoding(new CompressionEncodingFilter(compressionLevel, compressionMinSize,
compressableMimeTypes,
noCompressionUserAgents,
LZMAContentEncoding.getLzmaAliases()));
LZMAContentEncoding.getLzmaAliases(),
compressionLevel != CompressionLevel.OFF
));
final Set<ContentEncoding> set = new HashSet<ContentEncoding>(2);
set.add(gzipContentEncoding);
set.add(lzmaEncoding);
Expand Down
2 changes: 1 addition & 1 deletion nucleus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<stax-api.version>1.0-2</stax-api.version>
<management-api.version>1.1-rev-1</management-api.version>
<servlet-api.version>3.1.0</servlet-api.version>
<grizzly.version>2.3.27</grizzly.version>
<grizzly.version>2.3.29</grizzly.version>
<saaj-api.version>1.3.4</saaj-api.version>
<hk2.version>2.4.0</hk2.version>
<hk2.plugin.version>2.4.0</hk2.plugin.version>
Expand Down

0 comments on commit 4b1eb74

Please sign in to comment.