You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/04/25 21:06:08 UTC
svn commit: r1740877 -
/tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java
Author: markt
Date: Mon Apr 25 19:06:07 2016
New Revision: 1740877
URL: http://svn.apache.org/viewvc?rev=1740877&view=rev
Log:
Better fix for failing unit test
Modified:
tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java
Modified: tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java?rev=1740877&r1=1740876&r2=1740877&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java Mon Apr 25 19:06:07 2016
@@ -42,6 +42,7 @@ public class Nio2ServletInputStream exte
private boolean flipped = false;
private volatile boolean readPending = false;
private volatile boolean interest = true;
+ private volatile boolean closed = true;
public Nio2ServletInputStream(SocketWrapper<Nio2Channel> wrapper, AbstractEndpoint<Nio2Channel> endpoint0) {
this.endpoint = endpoint0;
@@ -53,7 +54,11 @@ public class Nio2ServletInputStream exte
boolean notify = false;
synchronized (completionHandler) {
if (nBytes.intValue() < 0) {
- failed(new EOFException(), attachment);
+ if (closed) {
+ readPending = false;
+ } else {
+ failed(new EOFException(), attachment);
+ }
} else {
readPending = false;
if (interest && !Nio2Endpoint.isInline()) {
@@ -180,6 +185,7 @@ public class Nio2ServletInputStream exte
@Override
protected void doClose() throws IOException {
+ closed = true;
channel.close();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org