From 4062346e6173d4a68cc929033169d0995a187336 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 22 Jun 2023 07:12:50 +0200 Subject: [PATCH 1/2] Update to brotli4j 1.12.0 for Netty 4.1.94.Final --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 27cdce5246c..4e6c4f9863f 100644 --- a/pom.xml +++ b/pom.xml @@ -194,7 +194,7 @@ com.aayushatharva.brotli4j brotli4j - 1.8.0 + 1.12.0 test From 2b716af3aa99359a0f82117867efae48f8d17163 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 22 Jun 2023 07:17:31 +0200 Subject: [PATCH 2/2] Remove null domain socket address workaround after upgrade to Netty 4.1.94.Final --- .../java/io/vertx/core/net/impl/ConnectionBase.java | 10 ++++++---- src/test/java/io/vertx/core/net/NetTest.java | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/vertx/core/net/impl/ConnectionBase.java b/src/main/java/io/vertx/core/net/impl/ConnectionBase.java index a5394ba175a..c354feac77c 100644 --- a/src/main/java/io/vertx/core/net/impl/ConnectionBase.java +++ b/src/main/java/io/vertx/core/net/impl/ConnectionBase.java @@ -629,6 +629,9 @@ public SocketAddress remoteAddress() { address = socketAdressOverride(REMOTE_ADDRESS_OVERRIDE); if (address == null) { address = channelRemoteAddress(); + if (address != null && address.isDomainSocket() && address.path().isEmpty()) { + address = channelLocalAddress(); + } } if (address != null) { remoteAddress = address; @@ -654,10 +657,6 @@ public SocketAddress remoteAddress(boolean real) { private SocketAddress channelLocalAddress() { java.net.SocketAddress addr = chctx.channel().localAddress(); - if (addr == null && channel().getClass().getSimpleName().endsWith("DomainSocketChannel")) { - // Workaround bug https://github.com/netty/netty/issues/13417 - return SocketAddress.domainSocketAddress(""); - } return addr != null ? vertx.transport().convert(addr) : null; } @@ -667,6 +666,9 @@ public SocketAddress localAddress() { address = socketAdressOverride(LOCAL_ADDRESS_OVERRIDE); if (address == null) { address = channelLocalAddress(); + if (address != null && address.isDomainSocket() && address.path().isEmpty()) { + address = channelRemoteAddress(); + } } if (address != null) { localAddress = address; diff --git a/src/test/java/io/vertx/core/net/NetTest.java b/src/test/java/io/vertx/core/net/NetTest.java index d7e0604b97a..902d49b0329 100755 --- a/src/test/java/io/vertx/core/net/NetTest.java +++ b/src/test/java/io/vertx/core/net/NetTest.java @@ -2215,7 +2215,7 @@ public void testSocketAddress() { assertEquals("127.0.0.1", addr.hostAddress()); } else { assertEquals(testAddress.path(), addr.path()); - assertEquals("", socket.remoteAddress().path()); + assertEquals(testAddress.path(), socket.remoteAddress().path()); } socket.close(); }).listen(1234, "localhost").onComplete(onSuccess(v -> { @@ -2228,7 +2228,7 @@ public void testSocketAddress() { assertEquals(addr.port(), 1234); } else { assertEquals(testAddress.path(), addr.path()); - assertEquals("", socket.localAddress().path()); + assertEquals(testAddress.path(), socket.localAddress().path()); } socket.closeHandler(v2 -> testComplete()); }));