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

Merge branch '4.4'

This commit is contained in:
Florian Schmaus 2020-11-14 15:33:42 +01:00
commit a2636b2f60
3 changed files with 10 additions and 6 deletions

View file

@ -19,6 +19,7 @@ package org.jivesoftware.smack.tcp.rce;
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.Objects;
import org.jivesoftware.smack.util.rce.SingleAddressRemoteConnectionEndpoint; import org.jivesoftware.smack.util.rce.SingleAddressRemoteConnectionEndpoint;
import org.minidns.record.InternetAddressRR; import org.minidns.record.InternetAddressRR;
@ -33,9 +34,9 @@ public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR<
private final IARR internetAddressResourceRecord; private final IARR internetAddressResourceRecord;
public IpTcpRemoteConnectionEndpoint(CharSequence host, UInt16 port, IARR internetAddressResourceRecord) { public IpTcpRemoteConnectionEndpoint(CharSequence host, UInt16 port, IARR internetAddressResourceRecord) {
this.host = host; this.host = Objects.requireNonNull(host);
this.port = port; this.port = Objects.requireNonNull(port);
this.internetAddressResourceRecord = internetAddressResourceRecord; this.internetAddressResourceRecord = Objects.requireNonNull(internetAddressResourceRecord);
} }
public static IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> from(CharSequence host, UInt16 port, public static IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> from(CharSequence host, UInt16 port,

View file

@ -192,9 +192,11 @@ public class RemoteXmppTcpConnectionEndpoints {
for (SRV srv : sortedSrvRecords) { for (SRV srv : sortedSrvRecords) {
List<InetAddress> targetInetAddresses = dnsResolver.lookupHostAddress(srv.target, lookupFailures, dnssecMode); List<InetAddress> targetInetAddresses = dnsResolver.lookupHostAddress(srv.target, lookupFailures, dnssecMode);
if (targetInetAddresses != null) {
SrvXmppRemoteConnectionEndpoint endpoint = new SrvXmppRemoteConnectionEndpoint(srv, targetInetAddresses); SrvXmppRemoteConnectionEndpoint endpoint = new SrvXmppRemoteConnectionEndpoint(srv, targetInetAddresses);
endpoints.add(endpoint); endpoints.add(endpoint);
} }
}
} else { } else {
LOGGER.info("Could not resolve DNS SRV resource records for " + srvDomain + ". Consider adding those."); LOGGER.info("Could not resolve DNS SRV resource records for " + srvDomain + ". Consider adding those.");
} }

View file

@ -21,6 +21,7 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import org.jivesoftware.smack.datatypes.UInt16; import org.jivesoftware.smack.datatypes.UInt16;
import org.jivesoftware.smack.util.Objects;
import org.jivesoftware.smack.util.rce.RemoteConnectionEndpoint; import org.jivesoftware.smack.util.rce.RemoteConnectionEndpoint;
import org.minidns.record.SRV; import org.minidns.record.SRV;
@ -36,7 +37,7 @@ public abstract class SrvRemoteConnectionEndpoint implements RemoteConnectionEnd
protected SrvRemoteConnectionEndpoint(SRV srv, List<? extends InetAddress> inetAddresses) { protected SrvRemoteConnectionEndpoint(SRV srv, List<? extends InetAddress> inetAddresses) {
this.srv = srv; this.srv = srv;
this.port = UInt16.from(srv.port); this.port = UInt16.from(srv.port);
this.inetAddresses = inetAddresses; this.inetAddresses = Objects.requireNonNull(inetAddresses);
} }
@Override @Override