Skip to content

Commit

Permalink
Merge #2411 into 2.0.0-M2
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Jul 29, 2022
2 parents f7c1b19 + cab1071 commit 05ad78f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Expand Up @@ -99,7 +99,7 @@ public EventLoopGroup newEventLoopGroup(int threads, ThreadFactory factory) {

static final Logger log = Loggers.getLogger(DefaultLoopEpoll.class);

static final boolean epoll;
static final boolean isEpollAvailable;

static {
boolean epollCheck = false;
Expand All @@ -110,9 +110,9 @@ public EventLoopGroup newEventLoopGroup(int threads, ThreadFactory factory) {
catch (ClassNotFoundException cnfe) {
// noop
}
epoll = epollCheck;
isEpollAvailable = epollCheck;
if (log.isDebugEnabled()) {
log.debug("Default Epoll support : " + epoll);
log.debug("Default Epoll support : " + isEpollAvailable);
}
}
}
Expand Up @@ -98,7 +98,7 @@ public EventLoopGroup newEventLoopGroup(int threads, ThreadFactory factory) {

static final Logger log = Loggers.getLogger(DefaultLoopKQueue.class);

static final boolean kqueue;
static final boolean isKqueueAvailable;

static {
boolean kqueueCheck = false;
Expand All @@ -109,9 +109,9 @@ public EventLoopGroup newEventLoopGroup(int threads, ThreadFactory factory) {
catch (ClassNotFoundException cnfe) {
// noop
}
kqueue = kqueueCheck;
isKqueueAvailable = kqueueCheck;
if (log.isDebugEnabled()) {
log.debug("Default KQueue support : " + kqueue);
log.debug("Default KQueue support : " + isKqueueAvailable);
}
}
}
Expand Up @@ -29,10 +29,10 @@ final class DefaultLoopNativeDetector {
static {
NIO = new DefaultLoopNIO();

if (DefaultLoopEpoll.epoll) {
if (DefaultLoopEpoll.isEpollAvailable) {
INSTANCE = new DefaultLoopEpoll();
}
else if (DefaultLoopKQueue.kqueue) {
else if (DefaultLoopKQueue.isKqueueAvailable) {
INSTANCE = new DefaultLoopKQueue();
}
else {
Expand Down
Expand Up @@ -37,7 +37,7 @@ final class HAProxyMessageReader extends ChannelHandlerAdapter {
private static final AttributeKey<InetSocketAddress> REMOTE_ADDRESS_FROM_PROXY_PROTOCOL =
AttributeKey.valueOf("remoteAddressFromProxyProtocol");

private static final boolean hasProxyProtocol;
private static final boolean isProxyProtocolAvailable;

static {
boolean proxyProtocolCheck = true;
Expand All @@ -47,16 +47,16 @@ final class HAProxyMessageReader extends ChannelHandlerAdapter {
catch (ClassNotFoundException cnfe) {
proxyProtocolCheck = false;
}
hasProxyProtocol = proxyProtocolCheck;
isProxyProtocolAvailable = proxyProtocolCheck;
}

static boolean hasProxyProtocol() {
return hasProxyProtocol;
static boolean isProxyProtocolAvailable() {
return isProxyProtocolAvailable;
}

@Nullable
static SocketAddress resolveRemoteAddressFromProxyProtocol(Channel channel) {
if (HAProxyMessageReader.hasProxyProtocol()) {
if (HAProxyMessageReader.isProxyProtocolAvailable()) {
return channel.attr(REMOTE_ADDRESS_FROM_PROXY_PROTOCOL).getAndSet(null);
}

Expand Down
Expand Up @@ -582,7 +582,7 @@ public final HttpServer proxyProtocol(ProxyProtocolSupportType proxyProtocolSupp
}
if (proxyProtocolSupportType == ProxyProtocolSupportType.ON ||
proxyProtocolSupportType == ProxyProtocolSupportType.AUTO) {
if (!HAProxyMessageReader.hasProxyProtocol()) {
if (!HAProxyMessageReader.isProxyProtocolAvailable()) {
throw new UnsupportedOperationException(
"To enable proxyProtocol, you must add the dependency `io.netty:netty-codec-haproxy`" +
" to the class path first");
Expand Down

0 comments on commit 05ad78f

Please sign in to comment.