[tomcat] 01/02: Use specialised exception for the case of ByteChunk overflow

2021-12-07 Thread markt
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 
AuthorDate: Mon Dec 6 22:44:11 2021 +

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



[tomcat] 01/02: Use specialised exception for the case of ByteChunk overflow

2021-12-07 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 6cf9b082d6b24253027921096ef905037f3f10ca
Author: Mark Thomas 
AuthorDate: Mon Dec 6 22:44:11 2021 +

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



[tomcat] 01/02: Use specialised exception for the case of ByteChunk overflow

2021-12-07 Thread markt
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 
AuthorDate: Mon Dec 6 22:44:11 2021 +

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