Skip to content

Commit

Permalink
Fix rdhup handling
Browse files Browse the repository at this point in the history
  • Loading branch information
normanmaurer committed May 3, 2024
1 parent db8e542 commit d3a7403
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ final boolean isReceivedRdHup() {
}

boolean maybeMoreDataToRead() {
/**
* EPOLL ET requires that we read until we get an EAGAIN
* (see Q9 in <a href="https://man7.org/linux/man-pages/man7/epoll.7.html">epoll man</a>). However in order to
* respect auto read we supporting reading to stop if auto read is off. It is expected that the
* {@link #EpollSocketChannel} implementations will track if we are in edgeTriggered mode and all data was not
* read, and will force a EPOLLIN ready event.
*
* It is assumed RDHUP is handled externally by checking {@link #isReceivedRdHup()}.
*/
return lastBytesRead() == attemptedBytesRead();
}

Expand All @@ -67,7 +58,7 @@ public final ByteBuf allocate(ByteBufAllocator alloc) {

@Override
public final boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier) {
return ((ExtendedHandle) delegate()).continueReading(maybeMoreDataSupplier);
return isReceivedRdHup() || ((ExtendedHandle) delegate()).continueReading(maybeMoreDataSupplier);
}

@Override
Expand Down

0 comments on commit d3a7403

Please sign in to comment.