From 3ca6e4bd54e19f57771b5420e4fee970d2029614 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Sat, 7 Feb 2015 21:29:46 +0100 Subject: [PATCH] Correctly set EPOLLRDHUP for all stream channels. Motivation: Fix regression introduced by 585ce1593fdccc5a8d868a96c7643e0d63b1e21b, which missed to set EPOLLRDHUP for all stream channels. Modifications: Correctly set EPOLLRDHUP for all stream channels in the AbstractEpollStreamChannel constructor. Result: No more test failures in EpollDomain*Channel tests. --- .../io/netty/channel/epoll/AbstractEpollStreamChannel.java | 4 ++++ .../main/java/io/netty/channel/epoll/EpollSocketChannel.java | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java index 15a9cfb38f..49dc5acefc 100644 --- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java +++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java @@ -51,10 +51,14 @@ public abstract class AbstractEpollStreamChannel extends AbstractEpollChannel { protected AbstractEpollStreamChannel(Channel parent, int fd) { super(parent, fd, Native.EPOLLIN, true); + // Add EPOLLRDHUP so we are notified once the remote peer close the connection. + flags |= Native.EPOLLRDHUP; } protected AbstractEpollStreamChannel(int fd) { super(fd, Native.EPOLLIN); + // Add EPOLLRDHUP so we are notified once the remote peer close the connection. + flags |= Native.EPOLLRDHUP; } @Override diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java index f1b0407eeb..36d1e37e4e 100644 --- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java +++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java @@ -37,8 +37,6 @@ public final class EpollSocketChannel extends AbstractEpollStreamChannel impleme EpollSocketChannel(Channel parent, int fd) { super(parent, fd); - // Add EPOLLRDHUP so we are notified once the remote peer close the connection. - flags |= Native.EPOLLRDHUP; config = new EpollSocketChannelConfig(this); // Directly cache the remote and local addresses // See https://github.com/netty/netty/issues/2359 @@ -48,8 +46,6 @@ public final class EpollSocketChannel extends AbstractEpollStreamChannel impleme public EpollSocketChannel() { super(Native.socketStreamFd()); - // Add EPOLLRDHUP so we are notified once the remote peer close the connection. - flags |= Native.EPOLLRDHUP; config = new EpollSocketChannelConfig(this); }