[#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:
Norman Maurer 2015-04-08 11:29:59 +02:00
parent 3e42292d8b
commit 1e8a2e69db

View File

@ -195,7 +195,7 @@ public class HttpStaticFileServerHandler extends SimpleChannelInboundHandler<Ful
lastContentFuture = ctx.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT);
} else {
sendFileFuture =
ctx.write(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)),
ctx.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)),
ctx.newProgressivePromise());
// HttpChunkedInput will write the end marker (LastHttpContent) for us.
lastContentFuture = sendFileFuture;