1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

Bump MiniDNS version to 0.4.0-alpha5

This commit is contained in:
Florian Schmaus 2020-05-24 13:11:50 +02:00
parent cac874bdc7
commit c7c5b10c41
3 changed files with 8 additions and 18 deletions

View file

@ -123,7 +123,7 @@ allprojects {
// - https://issues.apache.org/jira/browse/MNG-6232 // - https://issues.apache.org/jira/browse/MNG-6232
// - https://issues.igniterealtime.org/browse/SMACK-858 // - https://issues.igniterealtime.org/browse/SMACK-858
jxmppVersion = '0.7.0-alpha5' jxmppVersion = '0.7.0-alpha5'
miniDnsVersion = '0.4.0-alpha3' miniDnsVersion = '0.4.0-alpha5'
smackMinAndroidSdk = 19 smackMinAndroidSdk = 19
junitVersion = '5.6.0' junitVersion = '5.6.0'
commonsIoVersion = '2.6' commonsIoVersion = '2.6'

View file

@ -16,18 +16,14 @@
*/ */
package org.jivesoftware.smack.tcp.rce; package org.jivesoftware.smack.tcp.rce;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress; import java.net.InetAddress;
import org.jivesoftware.smack.datatypes.UInt16; import org.jivesoftware.smack.datatypes.UInt16;
import org.jivesoftware.smack.util.rce.SingleAddressRemoteConnectionEndpoint; import org.jivesoftware.smack.util.rce.SingleAddressRemoteConnectionEndpoint;
import org.minidns.record.A;
import org.minidns.record.AAAA;
import org.minidns.record.InternetAddressRR; import org.minidns.record.InternetAddressRR;
public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR> public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR<?>>
implements Rfc6120TcpRemoteConnectionEndpoint, SingleAddressRemoteConnectionEndpoint { implements Rfc6120TcpRemoteConnectionEndpoint, SingleAddressRemoteConnectionEndpoint {
private final CharSequence host; private final CharSequence host;
@ -42,17 +38,11 @@ public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR>
this.internetAddressResourceRecord = internetAddressResourceRecord; this.internetAddressResourceRecord = internetAddressResourceRecord;
} }
public static IpTcpRemoteConnectionEndpoint<InternetAddressRR> from(CharSequence host, UInt16 port, public static IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> from(CharSequence host, UInt16 port,
InetAddress inetAddress) { InetAddress inetAddress) {
InternetAddressRR internetAddressResourceRecord; InternetAddressRR<?> internetAddressResourceRecord = InternetAddressRR.from(inetAddress);
// TODO: Use InternetAddressRR.from(InetAddress) once MiniDNS is updated.
if (inetAddress instanceof Inet4Address) {
internetAddressResourceRecord = new A((Inet4Address) inetAddress);
} else {
internetAddressResourceRecord = new AAAA((Inet6Address) inetAddress);
}
return new IpTcpRemoteConnectionEndpoint<InternetAddressRR>(host, port, return new IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>>(host, port,
internetAddressResourceRecord); internetAddressResourceRecord);
} }

View file

@ -62,7 +62,7 @@ public class RemoteXmppTcpConnectionEndpoints {
if (hostAddress != null) { if (hostAddress != null) {
lookupFailures = Collections.emptyList(); lookupFailures = Collections.emptyList();
IpTcpRemoteConnectionEndpoint<InternetAddressRR> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from( IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from(
hostAddress.toString(), config.getPort(), hostAddress); hostAddress.toString(), config.getPort(), hostAddress);
discoveredRemoteConnectionEndpoints = Collections.singletonList(connectionEndpoint); discoveredRemoteConnectionEndpoints = Collections.singletonList(connectionEndpoint);
} else if (host != null) { } else if (host != null) {
@ -75,7 +75,7 @@ public class RemoteXmppTcpConnectionEndpoints {
discoveredRemoteConnectionEndpoints = new ArrayList<>(hostAddresses.size()); discoveredRemoteConnectionEndpoints = new ArrayList<>(hostAddresses.size());
UInt16 port = config.getPort(); UInt16 port = config.getPort();
for (InetAddress inetAddress : hostAddresses) { for (InetAddress inetAddress : hostAddresses) {
IpTcpRemoteConnectionEndpoint<InternetAddressRR> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from( IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from(
host, port, inetAddress); host, port, inetAddress);
discoveredRemoteConnectionEndpoints.add(connectionEndpoint); discoveredRemoteConnectionEndpoints.add(connectionEndpoint);
} }
@ -215,7 +215,7 @@ public class RemoteXmppTcpConnectionEndpoints {
List<InetAddress> hostAddresses = dnsResolver.lookupHostAddress(domain, lookupFailures, dnssecMode); List<InetAddress> hostAddresses = dnsResolver.lookupHostAddress(domain, lookupFailures, dnssecMode);
if (hostAddresses != null) { if (hostAddresses != null) {
for (InetAddress inetAddress : hostAddresses) { for (InetAddress inetAddress : hostAddresses) {
IpTcpRemoteConnectionEndpoint<InternetAddressRR> endpoint = IpTcpRemoteConnectionEndpoint.from(domain, defaultPort, inetAddress); IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> endpoint = IpTcpRemoteConnectionEndpoint.from(domain, defaultPort, inetAddress);
endpoints.add(endpoint); endpoints.add(endpoint);
} }
} }