This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 5fc9bc6f6e Clean-up - formatting. No functional change. 5fc9bc6f6e is described below commit 5fc9bc6f6e13ee835fdbe9c9473f2023e19d9d20 Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Jul 23 10:50:26 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 3a87692e2d..f0a245a48c 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -979,7 +979,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); } @@ -1571,7 +1571,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); } } @@ -1632,10 +1632,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. @@ -1691,10 +1692,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 3e621e82a8..bb983bf875 100644 --- a/java/org/apache/coyote/http2/Stream.java +++ b/java/org/apache/coyote/http2/Stream.java @@ -1017,9 +1017,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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org