[#1346] Make sure HttpPostRequestEncoder.nextChunk() return LastHttpContent once all chunks are read

This commit is contained in:
Norman Maurer 2013-05-08 15:11:08 +02:00
parent e48bc9c086
commit c07234ed72

View File

@ -974,7 +974,7 @@ public class HttpPostRequestEncoder implements ChunkedMessageInput<HttpContent>
private HttpContent nextChunk() throws ErrorDataEncoderException {
if (isLastChunk) {
isLastChunkSent = true;
return new DefaultHttpContent(EMPTY_BUFFER);
return LastHttpContent.EMPTY_LAST_CONTENT;
}
ByteBuf buffer;
int size = HttpPostBodyUtil.chunkSize;
@ -1032,7 +1032,7 @@ public class HttpPostRequestEncoder implements ChunkedMessageInput<HttpContent>
if (currentBuffer == null) {
isLastChunkSent = true;
// LastChunk with no more data
return new DefaultHttpContent(EMPTY_BUFFER);
return LastHttpContent.EMPTY_LAST_CONTENT;
}
// Previous LastChunk with no more data
buffer = currentBuffer;