This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit ffe42125b38ff95f0f65cdc784a19bc1772a9ae1 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 841b3e3..c2a3d86 100644 --- a/java/org/apache/tomcat/util/buf/ByteChunk.java +++ b/java/org/apache/tomcat/util/buf/ByteChunk.java @@ -465,7 +465,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); @@ -830,4 +830,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