This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2f81d33e41321d988ee6322ff244545acc464167
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Dec 6 22:44:11 2021 +0000

    Use specialised exception for the case of ByteChunk overflow
    
    This enables the option of specific handling for this case further up
    the stack
---
 java/org/apache/tomcat/util/buf/ByteChunk.java | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteChunk.java 
b/java/org/apache/tomcat/util/buf/ByteChunk.java
index d05cc8b..f2ea740 100644
--- a/java/org/apache/tomcat/util/buf/ByteChunk.java
+++ b/java/org/apache/tomcat/util/buf/ByteChunk.java
@@ -512,7 +512,7 @@ public final class ByteChunk extends AbstractChunk {
     public void flushBuffer() throws IOException {
         // assert out!=null
         if (out == null) {
-            throw new IOException(sm.getString(
+            throw new BufferOverflowException(sm.getString(
                     "chunk.overflow", Integer.valueOf(getLimit()), 
Integer.valueOf(buff.length)));
         }
         out.realWriteBytes(buff, start, end - start);
@@ -877,4 +877,14 @@ public final class ByteChunk extends AbstractChunk {
         }
         return result;
     }
+
+
+    public static class BufferOverflowException extends IOException {
+
+        private static final long serialVersionUID = 1L;
+
+        public BufferOverflowException(String message) {
+            super(message);
+        }
+    }
 }

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

Reply via email to