ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/coyote/http2/RecycledStream.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/coyote/http2/RecycledStream.java
Status
scanned
Type
file
Name
RecycledStream.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2398 (2.3 KB)
MD5
0a3f64c59e4a6d21c289cde3520f60a3
SHA1
0b681c72448fa1b61886a9d929981aad21407fd5
SHA256
e1f5e443beab2f42415ab98ae449f6aab9d3fe35cd13d305aad75df355550996
SHA512

      
    
SHA1_git
29f691cdc58dcabf0d208bb0741b8d6c01a769e6
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
RecycledStream.java | 2.3 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.coyote.http2; import java.nio.ByteBuffer; /** * Represents a closed stream and is used to correctly respond to (or ignore) frames for the stream that are processed * after the stream has been closed. Used in preference to the full {@link Stream} as has much lower memory usage. */ class RecycledStream extends AbstractNonZeroStream { private final String connectionId; private int remainingFlowControlWindow; RecycledStream(String connectionId, Integer identifier, StreamStateMachine state, int remainingFlowControlWindow) { super(identifier, state); this.connectionId = connectionId; this.remainingFlowControlWindow = remainingFlowControlWindow; } @Override String getConnectionId() { return connectionId; } @Override void incrementWindowSize(int increment) throws Http2Exception { // NO-OP } @Override void receivedData(int dataLength) throws ConnectionException { remainingFlowControlWindow -= dataLength; } /** * {@inheritDoc} * <p> * This implementation will return a zero length ByteBuffer to trigger a flow control error if more DATA frame * payload than the remaining flow control window is received for this recycled stream. */ @Override ByteBuffer getInputByteBuffer(boolean create) { if (remainingFlowControlWindow < 0) { return ZERO_LENGTH_BYTEBUFFER; } else { return null; } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
45.25
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9