[#845] Enable PUT of files above 2GB

This commit is contained in:
Piotr Bartosiewicz 2012-12-24 11:03:05 +01:00 committed by Norman Maurer
parent 7269dff87f
commit 6274abd134

View File

@ -271,8 +271,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
return readFixedLengthContent(buffer);
}
case READ_FIXED_LENGTH_CONTENT_AS_CHUNKS: {
assert chunkSize <= Integer.MAX_VALUE;
int chunkSize = (int) this.chunkSize;
long chunkSize = this.chunkSize;
int readLimit = actualReadableBytes();
// Check if the buffer is readable first as we use the readable byte count
@ -285,12 +284,12 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
return null;
}
int toRead = chunkSize;
int toRead = readLimit;
if (toRead > maxChunkSize) {
toRead = maxChunkSize;
}
if (toRead > readLimit) {
toRead = readLimit;
if (toRead > chunkSize) {
toRead = (int) chunkSize;
}
HttpChunk chunk = new DefaultHttpChunk(buffer.readBytes(toRead));
if (chunkSize > toRead) {