Skip to content

Commit

Permalink
Use remaining() instead of limit(). Remove unnecessary call to releas…
Browse files Browse the repository at this point in the history
…e(). (#795)

Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
  • Loading branch information
spericas committed Jun 18, 2019
1 parent 463636f commit 3cffe08
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -224,7 +224,7 @@ private void writeLastContent(final Throwable throwable, final ChannelFutureList
if (lengthOptimization) {
if (firstChunk != null) {
HttpUtil.setTransferEncodingChunked(response, false);
HttpUtil.setContentLength(response, firstChunk.data().limit());
HttpUtil.setContentLength(response, firstChunk.data().remaining());
}
initWriteResponse();
}
Expand Down Expand Up @@ -295,7 +295,6 @@ private ChannelFuture initWriteResponse() {
response = null;
if (firstChunk != null) {
cf = sendData(firstChunk);
firstChunk.release();
firstChunk = null;
}
lengthOptimization = false;
Expand Down

0 comments on commit 3cffe08

Please sign in to comment.