From b9f575352b54c449de9c918f6103bcf998082c2d Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 21 Nov 2014 11:43:32 +0900 Subject: [PATCH] Do not write LastHttpContent twice in HttpStaticFileServer example Related: #3122 Motivation: The HttpStaticFileServer example writes the LastHttpContent twice at the end of the transfer. HttpChunkedInput already produces a LastHttpContent at the end of the stream, so there's no reason to write another. Modifications: Do not write LastHttpContent in HttpStaticFileServerHandler when HttpChunkedInput is used to transfer a file. Result: HttpStaticFileServer does not violates the protocol anymore. --- .../example/http/file/HttpStaticFileServerHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java b/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java index 98f498069f..f47b43d630 100644 --- a/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java +++ b/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java @@ -186,13 +186,18 @@ public class HttpStaticFileServerHandler extends SimpleChannelInboundHandler