Update dnsjava to 3.1.0 and add result to debug output.

This commit is contained in:
Steveice10 2020-05-30 15:22:11 -07:00
parent d82b1b688d
commit 12d26014fa
2 changed files with 4 additions and 3 deletions

View file

@ -55,7 +55,7 @@
<dependency> <dependency>
<groupId>dnsjava</groupId> <groupId>dnsjava</groupId>
<artifactId>dnsjava</artifactId> <artifactId>dnsjava</artifactId>
<version>3.0.2</version> <version>3.1.0</version>
</dependency> </dependency>
<!-- Silence dnsjava slf4j warnings --> <!-- Silence dnsjava slf4j warnings -->
<dependency> <dependency>

View file

@ -108,7 +108,8 @@ public class TcpClientSession extends TcpSession {
int port = getPort(); int port = getPort();
try { try {
Record[] records = new Lookup(getPacketProtocol().getSRVRecordPrefix() + "._tcp." + host, Type.SRV).run(); Lookup lookup = new Lookup(getPacketProtocol().getSRVRecordPrefix() + "._tcp." + host, Type.SRV);
Record[] records = lookup.run();
if(records != null && records.length > 0) { if(records != null && records.length > 0) {
SRVRecord srv = (SRVRecord) records[0]; SRVRecord srv = (SRVRecord) records[0];
@ -119,7 +120,7 @@ public class TcpClientSession extends TcpSession {
System.out.println("[PacketLib] Found SRV record for \"" + host + ":" + port + "\"."); System.out.println("[PacketLib] Found SRV record for \"" + host + ":" + port + "\".");
} }
} else if(debug) { } else if(debug) {
System.out.println("[PacketLib] No SRV records found."); System.out.println("[PacketLib] No SRV records found; resolver returned \"" + lookup.getErrorString() + "\".");
} }
} catch(TextParseException e) { } catch(TextParseException e) {
if(debug) { if(debug) {