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

rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 425f81bdc4 Allow code reuse
425f81bdc4 is described below

commit 425f81bdc4d00e44f00d71cdce202594192c8df5
Author: remm <[email protected]>
AuthorDate: Sun Nov 15 10:13:49 2026 +0100

    Allow code reuse
    
    Also add getters for the buffer sizes.
---
 java/org/apache/coyote/http2/HpackException.java   |  2 +-
 .../tomcat/util/net/SocketBufferHandler.java       | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/HpackException.java 
b/java/org/apache/coyote/http2/HpackException.java
index 33c3273ed4..b6278fa60a 100644
--- a/java/org/apache/coyote/http2/HpackException.java
+++ b/java/org/apache/coyote/http2/HpackException.java
@@ -21,7 +21,7 @@ import java.io.Serial;
 /**
  * Exception that is thrown when the HPACK compress context is broken. In this 
case the connection must be closed.
  */
-class HpackException extends Exception {
+public class HpackException extends Exception {
 
     @Serial
     private static final long serialVersionUID = 1L;
diff --git a/java/org/apache/tomcat/util/net/SocketBufferHandler.java 
b/java/org/apache/tomcat/util/net/SocketBufferHandler.java
index 2d701fd22b..bd9093df39 100644
--- a/java/org/apache/tomcat/util/net/SocketBufferHandler.java
+++ b/java/org/apache/tomcat/util/net/SocketBufferHandler.java
@@ -153,6 +153,17 @@ public class SocketBufferHandler {
     }
 
 
+    /**
+     * Returns the configured size of the read buffer without forcing the
+     * lazily allocated buffer to be created.
+     *
+     * @return the configured read buffer size
+     */
+    public int getReadBufferSize() {
+        return readBufferSize;
+    }
+
+
     /**
      * Checks whether the read buffer contains any data.
      * @return {@code true} if the read buffer is empty
@@ -300,6 +311,17 @@ public class SocketBufferHandler {
     }
 
 
+    /**
+     * Returns the configured size of the write buffer without forcing the
+     * lazily allocated buffer to be created.
+     *
+     * @return the configured write buffer size
+     */
+    public int getWriteBufferSize() {
+        return writeBufferSize;
+    }
+
+
     /**
      * Checks whether the write buffer contains any data.
      * @return {@code true} if the write buffer is empty


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to