change BrotliOptions to not leaking brotli4j classes
This commit is contained in:
parent
5e8af038c8
commit
49b6c772a5
24 changed files with 343 additions and 111 deletions
58
NOTICE.txt
58
NOTICE.txt
|
@ -24,6 +24,7 @@ The following changes were performed on the original source code:
|
||||||
- removed all windows related code
|
- removed all windows related code
|
||||||
- removed all macos related code (including kqueue)
|
- removed all macos related code (including kqueue)
|
||||||
- removed all aarch64 related code
|
- removed all aarch64 related code
|
||||||
|
- removed the direct brotli4j dependency by rewriting Brotli4jOptions to not use Encoder.Parameters
|
||||||
|
|
||||||
Challenges for Netty build on JDK 21
|
Challenges for Netty build on JDK 21
|
||||||
|
|
||||||
|
@ -33,37 +34,38 @@ Challenges for Netty build on JDK 21
|
||||||
--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED
|
--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED
|
||||||
- finalize() calls in PoolThreadCache, PoolArena are deprecated
|
- finalize() calls in PoolThreadCache, PoolArena are deprecated
|
||||||
- when using boringssl static, setting of SSLContent.useTasks to false makes tests hang. Tests using false setting were removed.
|
- when using boringssl static, setting of SSLContent.useTasks to false makes tests hang. Tests using false setting were removed.
|
||||||
|
- native code jars with module info
|
||||||
|
|
||||||
Subproject organization
|
Subproject organization
|
||||||
|
|
||||||
Original netty subproject names are not related to package names. I reorganized the names to allow better assignment
|
Original netty subproject names are not related to package names. I reorganized the names to allow better assignment
|
||||||
between subproject name, package name, artifact names, and java module. The following reorgnizations were performed:
|
between subproject name, package name, artifact names, and java module. The following reorgnizations were performed:
|
||||||
|
|
||||||
all -> [todo]
|
netty/all -> [todo]
|
||||||
bom -> [todo]
|
netty/bom -> [todo]
|
||||||
buffer -> netty-buffer
|
netty/buffer -> netty-buffer
|
||||||
codec -> netty-handler-codec, netty-handler-codec-compression, netty-handler-codec-protobuf
|
netty/codec -> netty-handler-codec, netty-handler-codec-compression, netty-handler-codec-protobuf
|
||||||
codec-dns -> [todo]
|
netty/codec-dns -> [todo]
|
||||||
codec-haproxy -> [todo]
|
netty/codec-haproxy -> [todo]
|
||||||
codec-http -> netty-handler-codec-http, netty-handler-codec-rtsp, netty-handler-codec-spdy
|
netty/codec-http -> netty-handler-codec-http, netty-handler-codec-rtsp, netty-handler-codec-spdy
|
||||||
codec-http2 ->
|
netty/codec-http2 ->
|
||||||
codec-memcache ->
|
netty/codec-memcache ->
|
||||||
codec-mqtt ->
|
netty/codec-mqtt ->
|
||||||
codec-redis ->
|
netty/codec-redis ->
|
||||||
codec-smtp ->
|
netty/codec-smtp ->
|
||||||
codec-socks ->
|
netty/codec-socks ->
|
||||||
codec->stomp ->
|
netty/codec->stomp ->
|
||||||
codec-xml ->
|
netty/codec-xml ->
|
||||||
common -> netty-util
|
netty/common -> netty-util
|
||||||
handler -> netty-handler
|
netty/handler -> netty-handler
|
||||||
handler-proxy
|
netty/handler-proxy
|
||||||
handler-ssl-ocsp
|
netty/handler-ssl-ocsp
|
||||||
resolver -> netty-resolver
|
netty/resolver -> netty-resolver
|
||||||
resolver-dns ->
|
netty/resolver-dns ->
|
||||||
resolver-dns-classes-macos -> [dropped]
|
netty/resolver-dns-classes-macos -> [dropped]
|
||||||
resolver-dns-native-macos -> [dropped]
|
netty/resolver-dns-native-macos -> [dropped]
|
||||||
transport -> netty-channel
|
netty/transport -> netty-channel
|
||||||
transport-classes-epoll -> netty-channel-epoll
|
netty/transport-classes-epoll -> netty-channel-epoll
|
||||||
transport-native-kqueue -> [dropped]
|
netty/transport-native-kqueue -> [dropped]
|
||||||
transport-native-unix-common -> netty-channel-unix
|
netty/transport-native-unix-common -> netty-channel-unix
|
||||||
transport-native-unix-common-tests -> netty-channel-unix
|
netty/transport-native-unix-common-tests -> netty-channel-unix
|
||||||
|
|
|
@ -3,13 +3,16 @@ plugins {
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'signing'
|
id 'signing'
|
||||||
id "io.github.gradle-nexus.publish-plugin" version "2.0.0-rc-1"
|
id "io.github.gradle-nexus.publish-plugin" version "2.0.0-rc-1"
|
||||||
|
id "com.google.osdetector" version "1.7.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapper {
|
wrapper {
|
||||||
gradleVersion = libs.versions.gradle.get()
|
gradleVersion = libs.versions.gradle.get()
|
||||||
distributionType = Wrapper.DistributionType.ALL
|
distributionType = Wrapper.DistributionType.BIN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.google.osdetector'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
user = 'joerg'
|
user = 'joerg'
|
||||||
name = 'netty'
|
name = 'netty'
|
||||||
|
@ -23,6 +26,8 @@ ext {
|
||||||
issueManagementUrl = ext.scmUrl + '/issues'
|
issueManagementUrl = ext.scmUrl + '/issues'
|
||||||
licenseName = 'The Apache License, Version 2.0'
|
licenseName = 'The Apache License, Version 2.0'
|
||||||
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||||
|
organizationName = 'xbib'
|
||||||
|
organizationUrl = 'https://xbib.org'
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
|
|
@ -30,7 +30,10 @@ test {
|
||||||
'--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED',
|
'--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED',
|
||||||
'-Dio.netty.bootstrap.extensions=serviceload'
|
'-Dio.netty.bootstrap.extensions=serviceload'
|
||||||
systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties'
|
systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties'
|
||||||
|
// we have remove native images, this is no longer used
|
||||||
systemProperty "nativeImage.handlerMetadataGroupId", "io.netty"
|
systemProperty "nativeImage.handlerMetadataGroupId", "io.netty"
|
||||||
|
// we have remove native images
|
||||||
|
// we have remove native images, this is no longer used
|
||||||
systemProperty "nativeimage.handlerMetadataArtifactId", "netty-transport"
|
systemProperty "nativeimage.handlerMetadataArtifactId", "netty-transport"
|
||||||
afterSuite { desc, result ->
|
afterSuite { desc, result ->
|
||||||
if (!desc.parent) {
|
if (!desc.parent) {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
|
||||||
|
apply plugin: 'com.google.osdetector'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':netty-handler-codec')
|
api project(':netty-handler-codec')
|
||||||
implementation project(':netty-bzip2')
|
implementation project(':netty-bzip2')
|
||||||
|
@ -6,11 +9,7 @@ dependencies {
|
||||||
implementation libs.lz4
|
implementation libs.lz4
|
||||||
implementation libs.lzf
|
implementation libs.lzf
|
||||||
implementation libs.zstd
|
implementation libs.zstd
|
||||||
|
runtimeOnly libs.brotli4j.native."${osdetector.os}"."${osdetector.arch.replace('_','')}"
|
||||||
testImplementation testLibs.commons.compress
|
testImplementation testLibs.commons.compress
|
||||||
testImplementation testLibs.mockito.core
|
testImplementation testLibs.mockito.core
|
||||||
testRuntimeOnly testLibs.brotli4j.native.linux.x8664
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.linux.aarch64
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.osx.x8664
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.osx.aarch64
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.windows.x8664
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,12 +27,12 @@ import io.netty.channel.ChannelPromise;
|
||||||
import io.netty.handler.codec.MessageToByteEncoder;
|
import io.netty.handler.codec.MessageToByteEncoder;
|
||||||
import io.netty.util.AttributeKey;
|
import io.netty.util.AttributeKey;
|
||||||
import io.netty.util.ReferenceCountUtil;
|
import io.netty.util.ReferenceCountUtil;
|
||||||
import io.netty.util.internal.ObjectUtil;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.ClosedChannelException;
|
import java.nio.channels.ClosedChannelException;
|
||||||
import java.nio.channels.WritableByteChannel;
|
import java.nio.channels.WritableByteChannel;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compress a {@link ByteBuf} with the Brotli compression.
|
* Compress a {@link ByteBuf} with the Brotli compression.
|
||||||
|
@ -44,8 +44,10 @@ public final class BrotliEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||||
|
|
||||||
private static final AttributeKey<Writer> ATTR = AttributeKey.valueOf("BrotliEncoderWriter");
|
private static final AttributeKey<Writer> ATTR = AttributeKey.valueOf("BrotliEncoderWriter");
|
||||||
|
|
||||||
private final Encoder.Parameters parameters;
|
private final BrotliOptions brotliOptions;
|
||||||
|
|
||||||
private final boolean isSharable;
|
private final boolean isSharable;
|
||||||
|
|
||||||
private Writer writer;
|
private Writer writer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +55,7 @@ public final class BrotliEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||||
* and {@link #isSharable()} set to {@code true}
|
* and {@link #isSharable()} set to {@code true}
|
||||||
*/
|
*/
|
||||||
public BrotliEncoder() {
|
public BrotliEncoder() {
|
||||||
this(BrotliOptions.DEFAULT);
|
this(BrotliOptions.DEFAULT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,17 +65,7 @@ public final class BrotliEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||||
* {@link #isSharable()} set to {@code true}
|
* {@link #isSharable()} set to {@code true}
|
||||||
*/
|
*/
|
||||||
public BrotliEncoder(BrotliOptions brotliOptions) {
|
public BrotliEncoder(BrotliOptions brotliOptions) {
|
||||||
this(brotliOptions.parameters());
|
this(brotliOptions, true);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new {@link BrotliEncoder} Instance
|
|
||||||
* and {@link #isSharable()} set to {@code true}
|
|
||||||
*
|
|
||||||
* @param parameters {@link Encoder.Parameters} to use
|
|
||||||
*/
|
|
||||||
public BrotliEncoder(Encoder.Parameters parameters) {
|
|
||||||
this(parameters, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,17 +81,16 @@ public final class BrotliEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||||
* with the appropriate channel. And this will add a overhead. So it is recommended to set {@link #isSharable()}
|
* with the appropriate channel. And this will add a overhead. So it is recommended to set {@link #isSharable()}
|
||||||
* to {@code false} and create new {@link BrotliEncoder} instance for every pipeline.
|
* to {@code false} and create new {@link BrotliEncoder} instance for every pipeline.
|
||||||
*
|
*
|
||||||
* @param parameters {@link Encoder.Parameters} to use
|
|
||||||
* @param isSharable Set to {@code true} if this instance is shared else set to {@code false}
|
* @param isSharable Set to {@code true} if this instance is shared else set to {@code false}
|
||||||
*/
|
*/
|
||||||
public BrotliEncoder(Encoder.Parameters parameters, boolean isSharable) {
|
public BrotliEncoder(BrotliOptions brotliOptions, boolean isSharable) {
|
||||||
this.parameters = ObjectUtil.checkNotNull(parameters, "Parameters");
|
this.brotliOptions = brotliOptions;
|
||||||
this.isSharable = isSharable;
|
this.isSharable = isSharable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
|
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
|
||||||
Writer writer = new Writer(parameters, ctx);
|
Writer writer = new Writer(brotliOptions, ctx);
|
||||||
if (isSharable) {
|
if (isSharable) {
|
||||||
ctx.channel().attr(ATTR).set(writer);
|
ctx.channel().attr(ATTR).set(writer);
|
||||||
} else {
|
} else {
|
||||||
|
@ -189,7 +180,11 @@ public final class BrotliEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||||
private final ChannelHandlerContext ctx;
|
private final ChannelHandlerContext ctx;
|
||||||
private boolean isClosed;
|
private boolean isClosed;
|
||||||
|
|
||||||
private Writer(Encoder.Parameters parameters, ChannelHandlerContext ctx) throws IOException {
|
private Writer(BrotliOptions brotliOptions, ChannelHandlerContext ctx) throws IOException {
|
||||||
|
Encoder.Parameters parameters = new Encoder.Parameters()
|
||||||
|
.setMode(Encoder.Mode.valueOf(brotliOptions.getMode().toUpperCase(Locale.ROOT)))
|
||||||
|
.setQuality(brotliOptions.getQuality())
|
||||||
|
.setWindow(brotliOptions.getWindow());
|
||||||
brotliEncoderChannel = new BrotliEncoderChannel(this, parameters);
|
brotliEncoderChannel = new BrotliEncoderChannel(this, parameters);
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
}
|
}
|
||||||
|
@ -242,15 +237,12 @@ public final class BrotliEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||||
public void close() {
|
public void close() {
|
||||||
final ChannelPromise promise = ctx.newPromise();
|
final ChannelPromise promise = ctx.newPromise();
|
||||||
|
|
||||||
ctx.executor().execute(new Runnable() {
|
ctx.executor().execute(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
try {
|
||||||
finish(promise);
|
finish(promise);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
promise.setFailure(new IllegalStateException("Failed to finish encoding", ex));
|
promise.setFailure(new IllegalStateException("Failed to finish encoding", ex));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,33 +15,43 @@
|
||||||
*/
|
*/
|
||||||
package io.netty.handler.codec.compression;
|
package io.netty.handler.codec.compression;
|
||||||
|
|
||||||
import com.aayushatharva.brotli4j.encoder.Encoder;
|
import java.util.Objects;
|
||||||
import io.netty.util.internal.ObjectUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link BrotliOptions} holds {@link Encoder.Parameters} for
|
* {@link BrotliOptions} holds configuration options for
|
||||||
* Brotli compression.
|
* Brotli compression.
|
||||||
*/
|
*/
|
||||||
public final class BrotliOptions implements CompressionOptions {
|
public final class BrotliOptions implements CompressionOptions {
|
||||||
|
|
||||||
private final Encoder.Parameters parameters;
|
private final String mode;
|
||||||
|
|
||||||
|
private final int quality;
|
||||||
|
|
||||||
|
private final int window;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see StandardCompressionOptions#brotli()
|
* @see StandardCompressionOptions#brotli()
|
||||||
*/
|
*/
|
||||||
static final BrotliOptions DEFAULT = new BrotliOptions(
|
static final BrotliOptions DEFAULT = new BrotliOptions("text", 4, -1);
|
||||||
new Encoder.Parameters().setQuality(4).setMode(Encoder.Mode.TEXT)
|
|
||||||
);
|
|
||||||
|
|
||||||
BrotliOptions(Encoder.Parameters parameters) {
|
BrotliOptions(String mode, int quality, int window) {
|
||||||
if (!Brotli.isAvailable()) {
|
if (!Brotli.isAvailable()) {
|
||||||
throw new IllegalStateException("Brotli is not available", Brotli.cause());
|
throw new IllegalStateException("Brotli is not available", Brotli.cause());
|
||||||
}
|
}
|
||||||
|
this.mode = Objects.requireNonNull(mode);
|
||||||
this.parameters = ObjectUtil.checkNotNull(parameters, "Parameters");
|
this.quality = quality;
|
||||||
|
this.window = window;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Encoder.Parameters parameters() {
|
public String getMode() {
|
||||||
return parameters;
|
return mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getQuality() {
|
||||||
|
return quality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWindow() {
|
||||||
|
return window;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ public final class StandardCompressionOptions {
|
||||||
/**
|
/**
|
||||||
* Default implementation of {@link BrotliOptions} with {@link Encoder.Parameters#setQuality(int)} set to 4
|
* Default implementation of {@link BrotliOptions} with {@link Encoder.Parameters#setQuality(int)} set to 4
|
||||||
* and {@link Encoder.Parameters#setMode(Encoder.Mode)} set to {@link Encoder.Mode#TEXT}
|
* and {@link Encoder.Parameters#setMode(Encoder.Mode)} set to {@link Encoder.Mode#TEXT}
|
||||||
|
* and {@link Encoder.Parameters#setWindow(int)}} set to -1
|
||||||
*/
|
*/
|
||||||
public static BrotliOptions brotli() {
|
public static BrotliOptions brotli() {
|
||||||
return BrotliOptions.DEFAULT;
|
return BrotliOptions.DEFAULT;
|
||||||
|
@ -38,11 +39,10 @@ public final class StandardCompressionOptions {
|
||||||
/**
|
/**
|
||||||
* Create a new {@link BrotliOptions}
|
* Create a new {@link BrotliOptions}
|
||||||
*
|
*
|
||||||
* @param parameters {@link Encoder.Parameters} Instance
|
|
||||||
* @throws NullPointerException If {@link Encoder.Parameters} is {@code null}
|
* @throws NullPointerException If {@link Encoder.Parameters} is {@code null}
|
||||||
*/
|
*/
|
||||||
public static BrotliOptions brotli(Encoder.Parameters parameters) {
|
public static BrotliOptions brotli(String mode, int quality, int window) {
|
||||||
return new BrotliOptions(parameters);
|
return new BrotliOptions(mode, quality, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,12 +3,8 @@ dependencies {
|
||||||
api project(':netty-handler-ssl')
|
api project(':netty-handler-ssl')
|
||||||
api project(':netty-handler-codec-compression')
|
api project(':netty-handler-codec-compression')
|
||||||
implementation project(':netty-zlib')
|
implementation project(':netty-zlib')
|
||||||
implementation libs.brotli4j // accessing com.aayushatharva.brotli4j.encoder.Encoder
|
testImplementation libs.brotli4j
|
||||||
testImplementation testLibs.assertj
|
testImplementation testLibs.assertj
|
||||||
testImplementation testLibs.mockito.core
|
testImplementation testLibs.mockito.core
|
||||||
testRuntimeOnly testLibs.brotli4j.native.linux.x8664
|
testRuntimeOnly libs.brotli4j.native."${osdetector.os}"."${osdetector.arch.replace('_','')}"
|
||||||
testRuntimeOnly testLibs.brotli4j.native.linux.aarch64
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.osx.x8664
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.osx.aarch64
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.windows.x8664
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -444,7 +444,7 @@ public class HttpContentCompressor extends HttpContentEncoder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MessageToByteEncoder<ByteBuf> createEncoder() {
|
public MessageToByteEncoder<ByteBuf> createEncoder() {
|
||||||
return new BrotliEncoder(brotliOptions.parameters());
|
return new BrotliEncoder(brotliOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,5 @@ module org.xbib.io.netty.handler.codec.http {
|
||||||
requires org.xbib.io.netty.handler.ssl;
|
requires org.xbib.io.netty.handler.ssl;
|
||||||
requires org.xbib.io.netty.util;
|
requires org.xbib.io.netty.util;
|
||||||
requires org.xbib.io.netty.zlib;
|
requires org.xbib.io.netty.zlib;
|
||||||
requires com.aayushatharva.brotli4j;
|
//requires com.aayushatharva.brotli4j;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,8 @@
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':netty-handler-codec-http')
|
api project(':netty-handler-codec-http')
|
||||||
implementation libs.brotli4j // accessing com.aayushatharva.brotli4j.encoder.Encoder
|
|
||||||
testImplementation testLibs.gson
|
testImplementation testLibs.gson
|
||||||
testImplementation testLibs.assertj
|
testImplementation testLibs.assertj
|
||||||
testImplementation testLibs.mockito.core
|
testImplementation testLibs.mockito.core
|
||||||
testRuntimeOnly(variantOf(testLibs.netty.tcnative.boringssl.static) {
|
testRuntimeOnly project(path: ':netty-tcnative-boringssl-static', configuration: osdetector.classifier)
|
||||||
classifier('linux-x86_64')
|
testRuntimeOnly libs.brotli4j.native."${osdetector.os}"."${osdetector.arch.replace('_','')}"
|
||||||
})
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.linux.x8664
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.linux.aarch64
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.osx.x8664
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.osx.aarch64
|
|
||||||
testRuntimeOnly testLibs.brotli4j.native.windows.x8664
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,10 +87,14 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE
|
||||||
StandardCompressionOptions.brotli(),
|
StandardCompressionOptions.brotli(),
|
||||||
StandardCompressionOptions.snappy(),
|
StandardCompressionOptions.snappy(),
|
||||||
StandardCompressionOptions.gzip(),
|
StandardCompressionOptions.gzip(),
|
||||||
StandardCompressionOptions.deflate() };
|
StandardCompressionOptions.deflate()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return new CompressionOptions[] { StandardCompressionOptions.snappy(),
|
return new CompressionOptions[] {
|
||||||
StandardCompressionOptions.gzip(), StandardCompressionOptions.deflate() };
|
StandardCompressionOptions.snappy(),
|
||||||
|
StandardCompressionOptions.gzip(),
|
||||||
|
StandardCompressionOptions.deflate()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -284,7 +288,7 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE
|
||||||
}
|
}
|
||||||
if (Brotli.isAvailable() && brotliOptions != null && BR.contentEqualsIgnoreCase(contentEncoding)) {
|
if (Brotli.isAvailable() && brotliOptions != null && BR.contentEqualsIgnoreCase(contentEncoding)) {
|
||||||
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
|
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
|
||||||
ctx.channel().config(), new BrotliEncoder(brotliOptions.parameters()));
|
ctx.channel().config(), new BrotliEncoder(brotliOptions));
|
||||||
}
|
}
|
||||||
if (zstdOptions != null && ZSTD.contentEqualsIgnoreCase(contentEncoding)) {
|
if (zstdOptions != null && ZSTD.contentEqualsIgnoreCase(contentEncoding)) {
|
||||||
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
|
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
|
||||||
|
|
|
@ -8,5 +8,4 @@ module org.xbib.io.netty.handler.codec.httptwo {
|
||||||
requires org.xbib.io.netty.handler.codec.http;
|
requires org.xbib.io.netty.handler.codec.http;
|
||||||
requires org.xbib.io.netty.handler.ssl;
|
requires org.xbib.io.netty.handler.ssl;
|
||||||
requires org.xbib.io.netty.util;
|
requires org.xbib.io.netty.util;
|
||||||
requires com.aayushatharva.brotli4j;
|
|
||||||
}
|
}
|
||||||
|
|
70
netty-handler-codec-quic-native/build.gradle
Normal file
70
netty-handler-codec-quic-native/build.gradle
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
|
||||||
|
task nettyQuicLinuxX8664(type: Jar) {
|
||||||
|
archiveBaseName.set('netty-handler-codec-quic-native')
|
||||||
|
archiveClassifier.set('linux-x86_64')
|
||||||
|
version rootProject.version
|
||||||
|
from (sourceSets.main.output) {
|
||||||
|
include 'META-INF/native/libnetty_quiche_linux_x86_64.so'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemble.dependsOn(nettyQuicLinuxX8664)
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
'linux-x86_64' {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
extendsFrom runtimeOnly
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
'linux-x86_64'(nettyQuicLinuxX8664)
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
publishNettyQuicLinuxX8664(MavenPublication) {
|
||||||
|
groupId rootProject.group
|
||||||
|
artifactId project.name
|
||||||
|
version rootProject.version
|
||||||
|
artifact nettyQuicLinuxX8664
|
||||||
|
pom {
|
||||||
|
artifactId = project.name
|
||||||
|
name = project.name
|
||||||
|
version = project.version
|
||||||
|
description = rootProject.ext.description
|
||||||
|
url = rootProject.ext.url
|
||||||
|
inceptionYear = rootProject.ext.inceptionYear
|
||||||
|
packaging = 'jar'
|
||||||
|
organization {
|
||||||
|
name = rootProject.ext.organizationName
|
||||||
|
url = rootProject.ext.organizationUrl
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = 'jprante'
|
||||||
|
name = 'Jörg Prante'
|
||||||
|
email = 'joergprante@gmail.com'
|
||||||
|
url = 'https://xbib.org/joerg'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
url = rootProject.ext.scmUrl
|
||||||
|
connection = rootProject.ext.scmConnection
|
||||||
|
developerConnection = rootProject.ext.scmDeveloperConnection
|
||||||
|
}
|
||||||
|
issueManagement {
|
||||||
|
system = rootProject.ext.issueManagementSystem
|
||||||
|
url = rootProject.ext.issueManagementUrl
|
||||||
|
}
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = rootProject.ext.licenseName
|
||||||
|
url = rootProject.ext.licenseUrl
|
||||||
|
distribution = 'repo'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,4 +2,5 @@ dependencies {
|
||||||
api project(':netty-handler-ssl')
|
api project(':netty-handler-ssl')
|
||||||
implementation project(':netty-channel-epoll')
|
implementation project(':netty-channel-epoll')
|
||||||
implementation project(':netty-channel-unix')
|
implementation project(':netty-channel-unix')
|
||||||
|
runtimeOnly project(path: ':netty-handler-codec-quic-native', configuration: osdetector.classifier)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
|
||||||
|
apply plugin: 'com.google.osdetector'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':netty-handler-codec')
|
api project(':netty-handler-codec')
|
||||||
api project(':netty-internal-tcnative')
|
api project(':netty-internal-tcnative')
|
||||||
|
@ -9,10 +12,8 @@ dependencies {
|
||||||
testImplementation project(':netty-handler')
|
testImplementation project(':netty-handler')
|
||||||
testImplementation (testLibs.amazonCorrettoCrypt) {
|
testImplementation (testLibs.amazonCorrettoCrypt) {
|
||||||
artifact {
|
artifact {
|
||||||
classifier = 'linux-x86_64'
|
classifier = osdetector.classifier
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
testRuntimeOnly(variantOf(testLibs.netty.tcnative.boringssl.static) {
|
testRuntimeOnly project(path: ':netty-tcnative-boringssl-static', configuration: osdetector.classifier)
|
||||||
classifier('linux-x86_64')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
158
netty-tcnative-boringssl-static/build.gradle
Normal file
158
netty-tcnative-boringssl-static/build.gradle
Normal file
|
@ -0,0 +1,158 @@
|
||||||
|
|
||||||
|
task nettyTcNativeBoringSslStaticLinuxX8664(type: Jar) {
|
||||||
|
archiveBaseName.set('netty-tcnative-boringssl-static')
|
||||||
|
archiveClassifier.set('linux-x86_64')
|
||||||
|
version rootProject.version
|
||||||
|
from (sourceSets.main.output) {
|
||||||
|
include 'META-INF/native/libnetty_tcnative_linux_x86_64.so'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemble.dependsOn(nettyTcNativeBoringSslStaticLinuxX8664)
|
||||||
|
|
||||||
|
task nettyTcNativeBoringSslStaticLinuxAarch64(type: Jar) {
|
||||||
|
archiveBaseName.set('netty-tcnative-boringssl-static')
|
||||||
|
archiveClassifier.set('linux-aarch_64')
|
||||||
|
version rootProject.version
|
||||||
|
from (sourceSets.main.output) {
|
||||||
|
include 'META-INF/native/libnetty_tcnative_linux_aarch_64.so'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemble.dependsOn(nettyTcNativeBoringSslStaticLinuxAarch64)
|
||||||
|
|
||||||
|
task nettyTcNativeBoringSslStaticOsxX8664(type: Jar) {
|
||||||
|
archiveBaseName.set('netty-tcnative-boringssl-static')
|
||||||
|
archiveClassifier.set('osx-x86_64')
|
||||||
|
version rootProject.version
|
||||||
|
from (sourceSets.main.output) {
|
||||||
|
include 'META-INF/native/libnetty_tcnative_osx_x86_64.jnilib'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemble.dependsOn(nettyTcNativeBoringSslStaticOsxX8664)
|
||||||
|
|
||||||
|
task nettyTcNativeBoringSslStaticOsxAarch64(type: Jar) {
|
||||||
|
archiveBaseName.set('netty-tcnative-boringssl-static')
|
||||||
|
archiveClassifier.set('osx-aarch_64')
|
||||||
|
version rootProject.version
|
||||||
|
from (sourceSets.main.output) {
|
||||||
|
include 'META-INF/native/libnetty_tcnative_osx_aarch_64.jnilib'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemble.dependsOn(nettyTcNativeBoringSslStaticOsxAarch64)
|
||||||
|
|
||||||
|
task nettyTcNativeBoringSslStaticWindowsX8664(type: Jar) {
|
||||||
|
archiveBaseName.set('netty-tcnative-boringssl-static')
|
||||||
|
archiveClassifier.set('windows-x86_64')
|
||||||
|
version rootProject.version
|
||||||
|
from (sourceSets.main.output) {
|
||||||
|
include 'META-INF/native/libnetty_tcnative_windows_x86_64.dll'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemble.dependsOn(nettyTcNativeBoringSslStaticWindowsX8664)
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
'linux-x86_64' {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
extendsFrom runtimeOnly
|
||||||
|
}
|
||||||
|
'linux-aarch64' {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
extendsFrom runtimeOnly
|
||||||
|
}
|
||||||
|
'osx-x86_64' {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
extendsFrom runtimeOnly
|
||||||
|
}
|
||||||
|
'osx-aarch64' {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
extendsFrom runtimeOnly
|
||||||
|
}
|
||||||
|
'windows-x86_64' {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
extendsFrom runtimeOnly
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
'linux-x86_64'(nettyTcNativeBoringSslStaticLinuxX8664)
|
||||||
|
'linux-aarch64'(nettyTcNativeBoringSslStaticLinuxAarch64)
|
||||||
|
'osx-x86_64'(nettyTcNativeBoringSslStaticOsxX8664)
|
||||||
|
'osx-aarch64'(nettyTcNativeBoringSslStaticOsxAarch64)
|
||||||
|
'windows-x86_64'(nettyTcNativeBoringSslStaticWindowsX8664)
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
publishNettyTcNaticeBoringSslStaticLinuxX8664(MavenPublication) {
|
||||||
|
groupId rootProject.group
|
||||||
|
artifactId project.name
|
||||||
|
version rootProject.version
|
||||||
|
artifact nettyTcNativeBoringSslStaticLinuxX8664
|
||||||
|
pom {
|
||||||
|
artifactId = project.name
|
||||||
|
name = project.name
|
||||||
|
version = project.version
|
||||||
|
description = rootProject.ext.description
|
||||||
|
url = rootProject.ext.url
|
||||||
|
inceptionYear = rootProject.ext.inceptionYear
|
||||||
|
packaging = 'jar'
|
||||||
|
organization {
|
||||||
|
name = rootProject.ext.organizationName
|
||||||
|
url = rootProject.ext.organizationUrl
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = 'jprante'
|
||||||
|
name = 'Jörg Prante'
|
||||||
|
email = 'joergprante@gmail.com'
|
||||||
|
url = 'https://xbib.org/joerg'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
url = rootProject.ext.scmUrl
|
||||||
|
connection = rootProject.ext.scmConnection
|
||||||
|
developerConnection = rootProject.ext.scmDeveloperConnection
|
||||||
|
}
|
||||||
|
issueManagement {
|
||||||
|
system = rootProject.ext.issueManagementSystem
|
||||||
|
url = rootProject.ext.issueManagementUrl
|
||||||
|
}
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = rootProject.ext.licenseName
|
||||||
|
url = rootProject.ext.licenseUrl
|
||||||
|
distribution = 'repo'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishNettyTcNativeBoringSslStaticLinuxAarch64(MavenPublication) {
|
||||||
|
groupId rootProject.group
|
||||||
|
artifactId project.name
|
||||||
|
version rootProject.version
|
||||||
|
artifact nettyTcNativeBoringSslStaticLinuxAarch64
|
||||||
|
}
|
||||||
|
publishNettyTcNaticeBoringSslStaticOsxX8664(MavenPublication) {
|
||||||
|
groupId rootProject.group
|
||||||
|
artifactId project.name
|
||||||
|
version rootProject.version
|
||||||
|
artifact nettyTcNativeBoringSslStaticOsxX8664
|
||||||
|
}
|
||||||
|
publishNettyTcNativeBoringSslStaticOsxAarch64(MavenPublication) {
|
||||||
|
groupId rootProject.group
|
||||||
|
artifactId project.name
|
||||||
|
version rootProject.version
|
||||||
|
artifact nettyTcNativeBoringSslStaticOsxAarch64
|
||||||
|
}
|
||||||
|
publishNettyTcNaticeBoringSslStaticWindowsX8664(MavenPublication) {
|
||||||
|
groupId rootProject.group
|
||||||
|
artifactId project.name
|
||||||
|
version rootProject.version
|
||||||
|
artifact nettyTcNativeBoringSslStaticWindowsX8664
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -24,10 +24,15 @@ dependencyResolutionManagement {
|
||||||
library('lzf', 'com.ning', 'compress-lzf').version('1.1.2')
|
library('lzf', 'com.ning', 'compress-lzf').version('1.1.2')
|
||||||
library('zstd', 'com.github.luben', 'zstd-jni').version('1.5.5-11')
|
library('zstd', 'com.github.luben', 'zstd-jni').version('1.5.5-11')
|
||||||
library('protobuf', 'com.google.protobuf', 'protobuf-java').version('4.0.0-rc-2')
|
library('protobuf', 'com.google.protobuf', 'protobuf-java').version('4.0.0-rc-2')
|
||||||
|
library('brotli4j-native-linux-x8664', 'com.aayushatharva.brotli4j', 'native-linux-x86_64').versionRef('brotli4j')
|
||||||
|
library('brotli4j-native-linux-aarch64', 'com.aayushatharva.brotli4j', 'native-linux-aarch64').versionRef('brotli4j')
|
||||||
|
library('brotli4j-native-linux-riscv64', 'com.aayushatharva.brotli4j', 'native-linux-riscv64').versionRef('brotli4j')
|
||||||
|
library('brotli4j-native-osx-x8664', 'com.aayushatharva.brotli4j', 'native-osx-x86_64').versionRef('brotli4j')
|
||||||
|
library('brotli4j-native-osx-aarch64', 'com.aayushatharva.brotli4j', 'native-osx-aarch64').versionRef('brotli4j')
|
||||||
|
library('brotli4j-native-windows-x8664', 'com.aayushatharva.brotli4j', 'native-windows-x86_64').versionRef('brotli4j')
|
||||||
}
|
}
|
||||||
testLibs {
|
testLibs {
|
||||||
version('junit', '5.10.1')
|
version('junit', '5.10.1')
|
||||||
version('brotli4j', '1.15.0')
|
|
||||||
library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')
|
library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')
|
||||||
library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit')
|
library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit')
|
||||||
library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit')
|
library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit')
|
||||||
|
@ -45,13 +50,6 @@ dependencyResolutionManagement {
|
||||||
library('reflections', 'org.reflections', 'reflections').version('0.10.2')
|
library('reflections', 'org.reflections', 'reflections').version('0.10.2')
|
||||||
library('amazonCorrettoCrypt', 'software.amazon.cryptools', 'AmazonCorrettoCryptoProvider').version('2.3.2')
|
library('amazonCorrettoCrypt', 'software.amazon.cryptools', 'AmazonCorrettoCryptoProvider').version('2.3.2')
|
||||||
library('commons-compress', 'org.apache.commons', 'commons-compress').version('1.25.0')
|
library('commons-compress', 'org.apache.commons', 'commons-compress').version('1.25.0')
|
||||||
library('brotli4j-native-linux-x8664', 'com.aayushatharva.brotli4j', 'native-linux-x86_64').versionRef('brotli4j')
|
|
||||||
library('brotli4j-native-linux-aarch64', 'com.aayushatharva.brotli4j', 'native-linux-aarch64').versionRef('brotli4j')
|
|
||||||
library('brotli4j-native-linux-riscv64', 'com.aayushatharva.brotli4j', 'native-linux-riscv64').versionRef('brotli4j')
|
|
||||||
library('brotli4j-native-osx-x8664', 'com.aayushatharva.brotli4j', 'native-osx-x86_64').versionRef('brotli4j')
|
|
||||||
library('brotli4j-native-osx-aarch64', 'com.aayushatharva.brotli4j', 'native-osx-aarch64').versionRef('brotli4j')
|
|
||||||
library('brotli4j-native-windows-x8664', 'com.aayushatharva.brotli4j', 'native-windows-x86_64').versionRef('brotli4j')
|
|
||||||
library('netty.tcnative.boringssl.static', 'io.netty', 'netty-tcnative-boringssl-static').version('2.0.62.Final')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,11 +67,13 @@ include 'netty-handler-codec-http2'
|
||||||
include 'netty-handler-codec-http3'
|
include 'netty-handler-codec-http3'
|
||||||
include 'netty-handler-codec-protobuf'
|
include 'netty-handler-codec-protobuf'
|
||||||
include 'netty-handler-codec-quic'
|
include 'netty-handler-codec-quic'
|
||||||
|
include 'netty-handler-codec-quic-native'
|
||||||
include 'netty-handler-codec-rtsp'
|
include 'netty-handler-codec-rtsp'
|
||||||
include 'netty-handler-codec-spdy'
|
include 'netty-handler-codec-spdy'
|
||||||
include 'netty-handler-ssl'
|
include 'netty-handler-ssl'
|
||||||
include 'netty-internal-tcnative'
|
include 'netty-internal-tcnative'
|
||||||
include 'netty-jctools'
|
include 'netty-jctools'
|
||||||
include 'netty-resolver'
|
include 'netty-resolver'
|
||||||
|
include 'netty-tcnative-boringssl-static'
|
||||||
include 'netty-util'
|
include 'netty-util'
|
||||||
include 'netty-zlib'
|
include 'netty-zlib'
|
||||||
|
|
Loading…
Reference in a new issue