This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push: new 765f944 BZ 64311. Allow for java.net.preferIPv4Stack in APR AnyLocalAddress test 765f944 is described below commit 765f94482637d31cf1e5b561504107288ad498ea Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Apr 8 16:10:20 2020 +0100 BZ 64311. Allow for java.net.preferIPv4Stack in APR AnyLocalAddress test Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=64311 --- test/org/apache/tomcat/jni/TestSocketServerAnyLocalAddress.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/org/apache/tomcat/jni/TestSocketServerAnyLocalAddress.java b/test/org/apache/tomcat/jni/TestSocketServerAnyLocalAddress.java index e1f78d6..0023db2 100644 --- a/test/org/apache/tomcat/jni/TestSocketServerAnyLocalAddress.java +++ b/test/org/apache/tomcat/jni/TestSocketServerAnyLocalAddress.java @@ -43,8 +43,13 @@ public class TestSocketServerAnyLocalAddress extends AbstractJniTest { @Before public void init() throws Exception { long serverPool = Pool.create(0); - long inetAddress = Address.info(null, Socket.APR_UNSPEC, - 0, 0, serverPool); + int family; + if (Boolean.getBoolean("java.net.preferIPv4Stack")) { + family = Socket.APR_INET; + } else { + family = Socket.APR_UNSPEC; + } + long inetAddress = Address.info(null, family, 0, 0, serverPool); serverSocket = Socket.create(Address.getInfo(inetAddress).family, Socket.SOCK_STREAM, Socket.APR_PROTO_TCP, serverPool); if (OS.IS_UNIX) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org