geforkt von Mirrors/Velocity
Don't resolve IP addresses in the config except for the bind one.
Dieser Commit ist enthalten in:
Ursprung
de51ea18cc
Commit
472f45df08
@ -242,7 +242,7 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
|
||||
}
|
||||
|
||||
public InetSocketAddress getBind() {
|
||||
return AddressUtil.parseAddress(bind);
|
||||
return AddressUtil.parseAndResolveAddress(bind);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,7 +51,6 @@ public final class ConnectionManager {
|
||||
this.resolverGroup = new DnsAddressResolverGroup(
|
||||
new DnsNameResolverBuilder()
|
||||
.channelType(this.transportType.datagramChannelClass)
|
||||
.ttl(300, 86400)
|
||||
.negativeTtl(15)
|
||||
.ndots(1)
|
||||
);
|
||||
|
@ -10,12 +10,26 @@ public class AddressUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to parse an IP address of the form <code>127.0.0.1:25565</code>.
|
||||
* Attempts to parse an IP address of the form <code>127.0.0.1:25565</code>. The returned
|
||||
* {@link InetSocketAddress} is not resolved.
|
||||
*
|
||||
* @param ip the IP to parse
|
||||
* @return the parsed address
|
||||
*/
|
||||
public static InetSocketAddress parseAddress(String ip) {
|
||||
Preconditions.checkNotNull(ip, "ip");
|
||||
URI uri = URI.create("tcp://" + ip);
|
||||
return InetSocketAddress.createUnresolved(uri.getHost(), uri.getPort());
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to parse an IP address of the form <code>127.0.0.1:25565</code>. The returned
|
||||
* {@link InetSocketAddress} is resolved.
|
||||
*
|
||||
* @param ip the IP to parse
|
||||
* @return the parsed address
|
||||
*/
|
||||
public static InetSocketAddress parseAndResolveAddress(String ip) {
|
||||
Preconditions.checkNotNull(ip, "ip");
|
||||
URI uri = URI.create("tcp://" + ip);
|
||||
return new InetSocketAddress(uri.getHost(), uri.getPort());
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren