[#3592] Flush when writing HttpChunkedInput
Motivation: We missed to flush the channel when using HttpChunkedInput (this is done when using SSL). This will result in a stale. Modifications: Replace ctx.write(...) with ctx.writeAndFlush(...) Result: Correctly working example.
This commit is contained in:
parent
3e42292d8b
commit
1e8a2e69db
@ -195,7 +195,7 @@ public class HttpStaticFileServerHandler extends SimpleChannelInboundHandler<Ful
|
|||||||
lastContentFuture = ctx.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT);
|
lastContentFuture = ctx.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT);
|
||||||
} else {
|
} else {
|
||||||
sendFileFuture =
|
sendFileFuture =
|
||||||
ctx.write(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)),
|
ctx.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)),
|
||||||
ctx.newProgressivePromise());
|
ctx.newProgressivePromise());
|
||||||
// HttpChunkedInput will write the end marker (LastHttpContent) for us.
|
// HttpChunkedInput will write the end marker (LastHttpContent) for us.
|
||||||
lastContentFuture = sendFileFuture;
|
lastContentFuture = sendFileFuture;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user