This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push: new 2604b2b Avoid duplicate read registrations for blocking I/O with NIO 2604b2b is described below commit 2604b2b7253a2fa700776afe20b406a8621d2918 Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Nov 22 10:15:14 2021 +0000 Avoid duplicate read registrations for blocking I/O with NIO --- java/org/apache/tomcat/util/net/NioEndpoint.java | 7 ++++--- webapps/docs/changelog.xml | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 4950fca..123aa49 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1275,8 +1275,10 @@ public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel> if (n == -1) { throw new EOFException(); } else if (n == 0) { - readBlocking = true; - registerReadInterest(); + if (!readBlocking) { + readBlocking = true; + registerReadInterest(); + } synchronized (readLock) { if (readBlocking) { try { @@ -1289,7 +1291,6 @@ public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel> } catch (InterruptedException e) { // Continue } - readBlocking = false; } } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index ea22b3e..13dd293 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -121,6 +121,10 @@ bug</a> that causes the acceptor to report an incoming connection more than once. (markt) </add> + <fix> + Avoid unnecessary duplicate read registrations for blocking I/O with the + NIO connector. (markt) + </fix> </changelog> </subsection> </section> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org