3a41a97b0e
Motivation: Chunks are splitted up into even smaller chunks when the underlying buffer's readable bytes are less than the chunk size. The underlying buffer can be smaller than a chunk size if: - The chunk size is larger than the maximum plaintext chunk allowed by the TLS RFC, see: io.netty.handler.ssl.SslHandler.MAX_PLAINTEXT_LENGTH. - The chunk sizes are variable in size, which may cause Netty guess a buffer size that is smaller than a chunk size. Modification: Create a variable in HttpObjectDecoder: ByteBuf chunkedContent - Initialize chunkedContent in READ_CHUNK_SIZE with chunkSize as buffer size. - In READ_CHUNKED_CONTENT write bytes into chunkedContent - If the remaining chunk size is not 0 and toRead ==maxChunkSize, create a chunk using the chunkedContent and add it to the output messages before re-initializing chunkedContent with the remaining chunkSize as buffer size. - If the remaining chunk size is not 0 and toRead != maxChunkSize, return without adding any output messages. - If the remaining chunk size is 0, create a chunk using the chunkedContent and add it to the output messages; set chunkedContent = null and fall-through. Result: Support chunk sizes higher than the underlying buffer's readable bytes. Co-authored-by: Nitesh Kant <nitesh_kant@apple.com> Co-authored-by: Norman Maurer <norman_maurer@apple.com> |
||
---|---|---|
.. | ||
src | ||
pom.xml |