a few comments

This commit is contained in:
Anuken
2023-05-09 16:45:46 -04:00
parent 6eb049c419
commit 584b22300d
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -16,7 +16,8 @@ public class Dns{
private static final Pattern ipPattern = Pattern.compile("^((0|1\\d?\\d?|2[0-4]?\\d?|25[0-5]?|[3-9]\\d?)\\.){3}(0|1\\d?\\d?|2[0-4]?\\d?|25[0-5]?|[3-9]\\d?)$"); private static final Pattern ipPattern = Pattern.compile("^((0|1\\d?\\d?|2[0-4]?\\d?|25[0-5]?|[3-9]\\d?)\\.){3}(0|1\\d?\\d?|2[0-4]?\\d?|25[0-5]?|[3-9]\\d?)$");
private static final int aRecord = 1, srvRecord = 33; private static final int aRecord = 1, srvRecord = 33;
private static IntMap<ObjectMap<String, Seq<?>>> cache = new IntMap<>(); private static IntMap<ObjectMap<String, Seq<?>>> cache = new IntMap<>();
private static Seq<InetSocketAddress> defNameservers = Seq.with(new InetSocketAddress("1.1.1.1", 53), new InetSocketAddress("8.8.8.8", 53)); //TODO remove these
//private static Seq<InetSocketAddress> defNameservers = Seq.with(new InetSocketAddress("1.1.1.1", 53), new InetSocketAddress("8.8.8.8", 53));
static <T> void resolve(int type, String domain, Func<ByteBuffer, T> reader, Cons<Seq<T>> result, Cons<Exception> error){ static <T> void resolve(int type, String domain, Func<ByteBuffer, T> reader, Cons<Seq<T>> result, Cons<Exception> error){
ObjectMap<String, Seq<?>> map; ObjectMap<String, Seq<?>> map;
@@ -41,6 +42,8 @@ public class Dns{
}, error); }, error);
} }
//TODO breaks for ipv6
//TODO no SRV recrod support
static void resolveAddress(String domain, Cons<InetAddress> result, Cons<Exception> error){ static void resolveAddress(String domain, Cons<InetAddress> result, Cons<Exception> error){
if(ipPattern.matcher(domain).matches()){ if(ipPattern.matcher(domain).matches()){
try{ try{
+1 -1
View File
@@ -25,4 +25,4 @@ org.gradle.caching=true
#used for slow jitpack builds; TODO see if this actually works #used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000 org.gradle.internal.http.connectionTimeout=100000
archash=77461f1c82 archash=eb3b8bdd10