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>
<groupId>dnsjava</groupId>
<artifactId>dnsjava</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</dependency>
<!-- Silence dnsjava slf4j warnings -->
<dependency>

View file

@ -108,7 +108,8 @@ public class TcpClientSession extends TcpSession {
int port = getPort();
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) {
SRVRecord srv = (SRVRecord) records[0];
@ -119,7 +120,7 @@ public class TcpClientSession extends TcpSession {
System.out.println("[PacketLib] Found SRV record for \"" + host + ":" + port + "\".");
}
} 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) {
if(debug) {