mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-24 15:22:07 +01:00
Bump MiniDNS version to 0.4.0-alpha5
This commit is contained in:
parent
cac874bdc7
commit
c7c5b10c41
3 changed files with 8 additions and 18 deletions
|
@ -123,7 +123,7 @@ allprojects {
|
|||
// - https://issues.apache.org/jira/browse/MNG-6232
|
||||
// - https://issues.igniterealtime.org/browse/SMACK-858
|
||||
jxmppVersion = '0.7.0-alpha5'
|
||||
miniDnsVersion = '0.4.0-alpha3'
|
||||
miniDnsVersion = '0.4.0-alpha5'
|
||||
smackMinAndroidSdk = 19
|
||||
junitVersion = '5.6.0'
|
||||
commonsIoVersion = '2.6'
|
||||
|
|
|
@ -16,18 +16,14 @@
|
|||
*/
|
||||
package org.jivesoftware.smack.tcp.rce;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import org.jivesoftware.smack.datatypes.UInt16;
|
||||
import org.jivesoftware.smack.util.rce.SingleAddressRemoteConnectionEndpoint;
|
||||
|
||||
import org.minidns.record.A;
|
||||
import org.minidns.record.AAAA;
|
||||
import org.minidns.record.InternetAddressRR;
|
||||
|
||||
public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR>
|
||||
public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR<?>>
|
||||
implements Rfc6120TcpRemoteConnectionEndpoint, SingleAddressRemoteConnectionEndpoint {
|
||||
|
||||
private final CharSequence host;
|
||||
|
@ -42,17 +38,11 @@ public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR>
|
|||
this.internetAddressResourceRecord = internetAddressResourceRecord;
|
||||
}
|
||||
|
||||
public static IpTcpRemoteConnectionEndpoint<InternetAddressRR> from(CharSequence host, UInt16 port,
|
||||
public static IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> from(CharSequence host, UInt16 port,
|
||||
InetAddress inetAddress) {
|
||||
InternetAddressRR internetAddressResourceRecord;
|
||||
// TODO: Use InternetAddressRR.from(InetAddress) once MiniDNS is updated.
|
||||
if (inetAddress instanceof Inet4Address) {
|
||||
internetAddressResourceRecord = new A((Inet4Address) inetAddress);
|
||||
} else {
|
||||
internetAddressResourceRecord = new AAAA((Inet6Address) inetAddress);
|
||||
}
|
||||
InternetAddressRR<?> internetAddressResourceRecord = InternetAddressRR.from(inetAddress);
|
||||
|
||||
return new IpTcpRemoteConnectionEndpoint<InternetAddressRR>(host, port,
|
||||
return new IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>>(host, port,
|
||||
internetAddressResourceRecord);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public class RemoteXmppTcpConnectionEndpoints {
|
|||
if (hostAddress != null) {
|
||||
lookupFailures = Collections.emptyList();
|
||||
|
||||
IpTcpRemoteConnectionEndpoint<InternetAddressRR> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from(
|
||||
IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from(
|
||||
hostAddress.toString(), config.getPort(), hostAddress);
|
||||
discoveredRemoteConnectionEndpoints = Collections.singletonList(connectionEndpoint);
|
||||
} else if (host != null) {
|
||||
|
@ -75,7 +75,7 @@ public class RemoteXmppTcpConnectionEndpoints {
|
|||
discoveredRemoteConnectionEndpoints = new ArrayList<>(hostAddresses.size());
|
||||
UInt16 port = config.getPort();
|
||||
for (InetAddress inetAddress : hostAddresses) {
|
||||
IpTcpRemoteConnectionEndpoint<InternetAddressRR> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from(
|
||||
IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from(
|
||||
host, port, inetAddress);
|
||||
discoveredRemoteConnectionEndpoints.add(connectionEndpoint);
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ public class RemoteXmppTcpConnectionEndpoints {
|
|||
List<InetAddress> hostAddresses = dnsResolver.lookupHostAddress(domain, lookupFailures, dnssecMode);
|
||||
if (hostAddresses != null) {
|
||||
for (InetAddress inetAddress : hostAddresses) {
|
||||
IpTcpRemoteConnectionEndpoint<InternetAddressRR> endpoint = IpTcpRemoteConnectionEndpoint.from(domain, defaultPort, inetAddress);
|
||||
IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> endpoint = IpTcpRemoteConnectionEndpoint.from(domain, defaultPort, inetAddress);
|
||||
endpoints.add(endpoint);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue