Skip to content

Commit 48152ef

Browse files
committed
8287134: HttpURLConnection chunked streaming mode doesn't enforce specified size
Reviewed-by: dfuchs, michaelm
1 parent 4b0e656 commit 48152ef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/java.base/share/classes/java/net/HttpURLConnection.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,11 @@ public void setFixedLengthStreamingMode(long contentLength) {
277277
* <p>
278278
* This method must be called before the URLConnection is connected.
279279
*
280-
* @param chunklen The number of bytes to write in each chunk.
281-
* If chunklen is less than or equal to zero, a default
282-
* value will be used.
280+
* @param chunklen The number of bytes to be written in each chunk,
281+
* including a chunk size header as a hexadecimal string
282+
* (minimum of 1 byte), two CRLF's (4 bytes) and a minimum
283+
* payload length of 1 byte. If chunklen is less than or equal
284+
* to 5, a higher default value will be used.
283285
*
284286
* @throws IllegalStateException if URLConnection is already connected
285287
* or if a different streaming mode is already enabled.

0 commit comments

Comments
 (0)