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
The following commit(s) were added to refs/heads/9.0.x by this push:
new 30dc8a1f61 Clean-up - formatting. No functional change.
30dc8a1f61 is described below
commit 30dc8a1f61cceb0ee1f3ffc597639fb6a100be0c
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jul 23 10:50:45 2024 +0100
Clean-up - formatting. No functional change.
---
.../apache/coyote/http2/AbstractNonZeroStream.java | 4 ++++
java/org/apache/coyote/http2/AbstractStream.java | 3 +++
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 19 ++++++++++---------
java/org/apache/coyote/http2/Stream.java | 6 +++---
java/org/apache/coyote/http2/StreamStateMachine.java | 3 +--
5 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index 333e33e5e3..406a112caa 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -51,7 +51,9 @@ abstract class AbstractNonZeroStream extends AbstractStream {
/**
* Check the frame type against the state
+ *
* @param frameType the type
+ *
* @throws Http2Exception if an error is detected
*/
final void checkState(FrameType frameType) throws Http2Exception {
@@ -69,7 +71,9 @@ abstract class AbstractNonZeroStream extends AbstractStream {
/**
* Notify that some data has been received.
+ *
* @param payloadSize the byte count
+ *
* @throws Http2Exception if an error is detected
*/
abstract void receivedData(int payloadSize) throws Http2Exception;
diff --git a/java/org/apache/coyote/http2/AbstractStream.java
b/java/org/apache/coyote/http2/AbstractStream.java
index 35aa402730..9aaa6cd653 100644
--- a/java/org/apache/coyote/http2/AbstractStream.java
+++ b/java/org/apache/coyote/http2/AbstractStream.java
@@ -76,6 +76,7 @@ abstract class AbstractStream {
/**
* Set the window size for this stream.
+ *
* @param windowSize the value
*/
final void setWindowSize(long windowSize) {
@@ -168,6 +169,7 @@ abstract class AbstractStream {
/**
* Set the amount of requested resources.
+ *
* @param connectionAllocationRequested the value
*/
final void setConnectionAllocationRequested(int
connectionAllocationRequested) {
@@ -187,6 +189,7 @@ abstract class AbstractStream {
/**
* Set the allocation made at the connection level.
+ *
* @param connectionAllocationMade the value
*/
final void setConnectionAllocationMade(int connectionAllocationMade) {
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 2ac1b969b3..81c4908047 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -973,7 +973,7 @@ class Http2UpgradeHandler extends AbstractStream implements
InternalHttpUpgradeH
backLogStreams.add(stream);
} else {
- // The connection window has sufficient capacity for this
reservation. Allocate the full amount.
+ // The connection window has sufficient capacity for this
reservation. Allocate the full amount.
allocation = reservation;
decrementWindowSize(allocation);
}
@@ -1565,7 +1565,7 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
// the call to this method. This means the bytes read will have
been
// written to the original stream and, effectively, swallowed.
// Therefore, need to notify that those bytes were swallowed here.
- if (dataLength>0) {
+ if (dataLength > 0) {
onSwallowedDataFramePayload(streamId, dataLength);
}
}
@@ -1626,10 +1626,11 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
/**
* Unused - NO-OP.
*
- * @param streamId Unused
+ * @param streamId Unused
* @param parentStreamId Unused
- * @param exclusive Unused
- * @param weight Unused
+ * @param exclusive Unused
+ * @param weight Unused
+ *
* @throws Http2Exception Never thrown
*
* @deprecated Unused. Will be removed in Tomcat 11 onwards.
@@ -1685,10 +1686,10 @@ class Http2UpgradeHandler extends AbstractStream
implements InternalHttpUpgradeH
}
}
/*
- * Need to process end of stream before calling
processStreamOnContainerThread to avoid a race condition
- * where the container thread finishes before end of stream is
processed, thinks the request hasn't been
- * fully read so issues a RST with error code 0 (NO_ERROR) to
tell the client not to send the request body,
- * if any. This breaks tests and generates unnecessary RST
messages for standard clients.
+ * Need to process end of stream before calling
processStreamOnContainerThread to avoid a race condition
+ * where the container thread finishes before end of stream is
processed, thinks the request hasn't been
+ * fully read so issues a RST with error code 0 (NO_ERROR) to tell
the client not to send the request body,
+ * if any. This breaks tests and generates unnecessary RST
messages for standard clients.
*/
if (endOfStream) {
receivedEndOfStream(stream);
diff --git a/java/org/apache/coyote/http2/Stream.java
b/java/org/apache/coyote/http2/Stream.java
index 08c22bbcda..7441aacb8c 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -1015,9 +1015,9 @@ class Stream extends AbstractNonZeroStream implements
HeaderEmitter {
writeLock.lock();
try {
/*
- * Need to ensure that there is exactly one call to flush even
when there is no data to write. Too few calls
- * (i.e. zero) and the end of stream message is not sent for a
completed asynchronous write. Too many calls
- * and the end of stream message is sent too soon and trailer
headers are not sent.
+ * Need to ensure that there is exactly one call to flush even
when there is no data to write. Too few
+ * calls (i.e. zero) and the end of stream message is not sent
for a completed asynchronous write. Too
+ * many calls and the end of stream message is sent too soon
and trailer headers are not sent.
*/
boolean dataInBuffer = buffer.position() > 0;
boolean flushed = false;
diff --git a/java/org/apache/coyote/http2/StreamStateMachine.java
b/java/org/apache/coyote/http2/StreamStateMachine.java
index 8b60a30c33..2ff7f8e3ed 100644
--- a/java/org/apache/coyote/http2/StreamStateMachine.java
+++ b/java/org/apache/coyote/http2/StreamStateMachine.java
@@ -89,8 +89,7 @@ class StreamStateMachine {
*/
public synchronized void sendReset() {
if (state == State.IDLE) {
- throw new IllegalStateException(
- sm.getString("streamStateMachine.invalidReset",
connectionId, streamId));
+ throw new
IllegalStateException(sm.getString("streamStateMachine.invalidReset",
connectionId, streamId));
}
if (state.canReset()) {
stateChange(state, State.CLOSED_RST_TX);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]