Skip to content

Commit effa557

Browse files
jansupolsenivam
authored andcommitted
Allow long content length in the JDK connector
Signed-off-by: jansupol <jan.supol@oracle.com>
1 parent b7f355e commit effa557

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/HttpParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2021 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -496,7 +496,7 @@ private void decideTransferEncoding() throws ParseException {
496496

497497
if (contentLengths != null) {
498498
try {
499-
int bodyLength = Integer.parseInt(contentLengths.get(0));
499+
long bodyLength = Long.parseLong(contentLengths.get(0));
500500
if (bodyLength == 0) {
501501
expectContent = false;
502502
return;

connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/TransferEncodingParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -31,7 +31,7 @@ abstract class TransferEncodingParser {
3131

3232
abstract boolean parse(ByteBuffer input) throws ParseException;
3333

34-
static TransferEncodingParser createFixedLengthParser(AsynchronousBodyInputStream responseBody, int expectedLength) {
34+
static TransferEncodingParser createFixedLengthParser(AsynchronousBodyInputStream responseBody, long expectedLength) {
3535
return new FixedLengthEncodingParser(responseBody, expectedLength);
3636
}
3737

@@ -42,11 +42,11 @@ static TransferEncodingParser createChunkParser(AsynchronousBodyInputStream resp
4242

4343
private static class FixedLengthEncodingParser extends TransferEncodingParser {
4444

45-
private final int expectedLength;
45+
private final long expectedLength;
4646
private final AsynchronousBodyInputStream responseBody;
47-
private volatile int consumedLength = 0;
47+
private volatile long consumedLength = 0;
4848

49-
FixedLengthEncodingParser(AsynchronousBodyInputStream responseBody, int expectedLength) {
49+
FixedLengthEncodingParser(AsynchronousBodyInputStream responseBody, long expectedLength) {
5050
this.expectedLength = expectedLength;
5151
this.responseBody = responseBody;
5252
}

0 commit comments

Comments
 (0)