Author: markt Date: Thu Jan 22 14:46:35 2015 New Revision: 1653887 URL: http://svn.apache.org/r1653887 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57481 Fix ISE at the end of the request when using non-blocking reads with the HTTP BIO connector.
Modified: tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1653887&r1=1653886&r2=1653887&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/tc8.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Thu Jan 22 14:46:35 2015 @@ -1677,7 +1677,11 @@ public abstract class AbstractHttp11Proc } else if (status == SocketStatus.OPEN_READ && request.getReadListener() != null) { try { - if (inputBuffer.available() > 0) { + // Check of asyncStateMachine.isAsyncStarted() is to avoid issue + // with BIO. Because it can't do a non-blocking read, BIO always + // returns available() == 1. This causes a problem here at the + // end of a non-blocking read. See BZ 57481. + if (inputBuffer.available() > 0 && asyncStateMachine.isAsyncStarted()) { asyncStateMachine.asyncOperation(); } } catch (IllegalStateException x) { Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1653887&r1=1653886&r2=1653887&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Thu Jan 22 14:46:35 2015 @@ -89,6 +89,11 @@ happens it will be handled properly. Issue is reported by Coverity Scan. (violetagg) </fix> + <fix> + <bug>57481</bug>: Fix <code>IllegalStateException</code> at the end of + the request when using non-blocking reads with the HTTP BIO connector. + (markt) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org