tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From violet...@apache.org
Subject svn commit: r1791137 - in /tomcat/trunk: java/org/apache/catalina/connector/InputBuffer.java webapps/docs/changelog.xml
Date Wed, 12 Apr 2017 15:52:06 GMT
Author: violetagg
Date: Wed Apr 12 15:52:06 2017
New Revision: 1791137

URL: http://svn.apache.org/viewvc?rev=1791137&view=rev
Log:
When there is no javax.servlet.ReadListener registered then a call to javax.servlet.ServletInputStream#isReady
will return 'false' instead of throwing IllegalStateException.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=1791137&r1=1791136&r2=1791137&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Wed Apr 12 15:52:06 2017
@@ -34,6 +34,8 @@ import org.apache.catalina.security.Secu
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.ContainerThreadMarker;
 import org.apache.coyote.Request;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.collections.SynchronizedStack;
@@ -56,6 +58,8 @@ public class InputBuffer extends Reader
      */
     protected static final StringManager sm = StringManager.getManager(InputBuffer.class);
 
+    private static final Log log = LogFactory.getLog(InputBuffer.class);
+
     public static final int DEFAULT_BUFFER_SIZE = 8 * 1024;
 
     // The buffer can be used for byte[] and char[] reading
@@ -271,7 +275,10 @@ public class InputBuffer extends Reader
 
     public boolean isReady() {
         if (coyoteRequest.getReadListener() == null) {
-            throw new IllegalStateException(sm.getString("inputBuffer.requiresNonBlocking"));
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("inputBuffer.requiresNonBlocking"));
+            }
+            return false;
         }
         if (isFinished()) {
             // If this is a non-container thread, need to trigger a read

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1791137&r1=1791136&r2=1791137&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Apr 12 15:52:06 2017
@@ -96,6 +96,12 @@
         will return <code>false</code> instead of throwing
         <code>IllegalStateException</code>. (violetagg)
       </fix>
+      <fix>
+        When there is no <code>javax.servlet.ReadListener</code> registered
+        then a call to <code>javax.servlet.ServletInputStream#isReady</code>
+        will return <code>false</code> instead of throwing
+        <code>IllegalStateException</code>. (violetagg)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message