Merge branch 'dev/1.1.0' into decode-multiple

This commit is contained in:
Andrew Steinborn
2019-12-06 03:10:25 -05:00
3 changed files with 26 additions and 10 deletions

View File

@@ -23,6 +23,12 @@ public class Velocity {
if (System.getProperty("io.netty.allocator.maxOrder") == null) {
System.setProperty("io.netty.allocator.maxOrder", "9");
}
// If Velocity's natives are being extracted to a different temporary directory, make sure the
// Netty natives are extracted there as well
if (System.getProperty("velocity.natives-tmpdir") != null) {
System.setProperty("io.netty.native.workdir", System.getProperty("velocity.natives-tmpdir"));
}
}
/**

View File

@@ -7,6 +7,7 @@ import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.FutureListener;
import io.netty.util.concurrent.ImmediateEventExecutor;
import io.netty.util.concurrent.Promise;
import io.netty.util.internal.ThreadExecutorMap;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.ArrayList;
@@ -61,13 +62,7 @@ public class DnsAddressResolverGroupNameResolverAdapter extends InetNameResolver
}
private EventExecutor findExecutor() {
for (EventExecutor executor : group) {
if (executor.inEventLoop()) {
return executor;
}
}
// otherwise, pick one
return group.next();
EventExecutor current = ThreadExecutorMap.currentExecutor();
return current == null ? group.next() : current;
}
}