opt http dns
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.mogo.utils.network;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -54,8 +56,10 @@ public final class OkHttpFactory {
|
||||
builder.dns( hostname -> {
|
||||
List< InetAddress > addresses = httpDns.lookup( hostname );
|
||||
if ( addresses != null && !addresses.isEmpty() ) {
|
||||
Logger.d("OkHttpFactory","look up hostname: "+hostname+" address: "+addresses.get(0).getHostAddress());
|
||||
return addresses;
|
||||
}
|
||||
Logger.d("OkHttpFactory","hostname: "+hostname+" no address");
|
||||
return Dns.SYSTEM.lookup( hostname );
|
||||
} );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user