Skip to content

Commit

Permalink
Update to Vert.x 4.5.7
Browse files Browse the repository at this point in the history
Based on commit 3c651a7.

- Fix netty native compilation settings
  • Loading branch information
cescoffier committed Apr 12, 2024
1 parent a333dc1 commit 1dcdc11
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ NativeImageConfigBuildItem build(
.addRuntimeInitializedClass("io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder")
.addRuntimeInitializedClass("io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder")
.addRuntimeInitializedClass("io.netty.handler.codec.compression.ZstdOptions")
.addRuntimeInitializedClass("io.netty.handler.codec.compression.ZstdConstants")
.addRuntimeInitializedClass("io.netty.handler.codec.compression.BrotliOptions");
} else {
log.debug("Not registering Netty HTTP classes as they were not found");
Expand Down Expand Up @@ -163,7 +164,9 @@ NativeImageConfigBuildItem build(
}

builder.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent")
.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent0");
.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent0")
.addRuntimeInitializedClass("io.netty.handler.ssl.JdkSslServerContext");
;

if (QuarkusClassLoader.isClassPresentAtRuntime("io.netty.buffer.UnpooledByteBufAllocator")) {
builder.addRuntimeReinitializedClass("io.netty.buffer.UnpooledByteBufAllocator")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ public void flush(final ChannelHandlerContext ctx) {
}
}

@Substitute
@TargetClass(className = "io.netty.handler.codec.compression.ZstdConstants", onlyWith = IsZstdAbsent.class)
public static final class ZstdConstants {

// The constants make <clinit> calls to com.github.luben.zstd.Zstd so we cut links with that substitution.

static final int DEFAULT_COMPRESSION_LEVEL = 0;

static final int MIN_COMPRESSION_LEVEL = 0;

static final int MAX_COMPRESSION_LEVEL = 0;

static final int MAX_BLOCK_SIZE = 0;

static final int DEFAULT_BLOCK_SIZE = 0;
}

public static class IsZstdAbsent implements BooleanSupplier {

private boolean zstdAbsent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void visitCode() {
};
}

if (name.equals("getLocal")) {
if (name.equals("getLocal") && descriptor.equals("(Ljava/lang/Object;)Ljava/lang/Object;")) {
return new MethodVisitor(Gizmo.ASM_API_VERSION, visitor) {
@Override
public void visitCode() {
Expand All @@ -153,7 +153,7 @@ public void visitCode() {
};
}

if (name.equals("putLocal")) {
if (name.equals("putLocal") && descriptor.equals("(Ljava/lang/Object;Ljava/lang/Object;)V")) {
return new MethodVisitor(Gizmo.ASM_API_VERSION, visitor) {
@Override
public void visitCode() {
Expand All @@ -170,7 +170,7 @@ public void visitCode() {
};
}

if (name.equals("removeLocal")) {
if (name.equals("removeLocal") && descriptor.equals("(Ljava/lang/Object;)Z")) {
return new MethodVisitor(Gizmo.ASM_API_VERSION, visitor) {
@Override
public void visitCode() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
quarkus.http.virtual=true


0 comments on commit 1dcdc11

Please sign in to comment.