Code clean up
This commit is contained in:
parent
46e9fe364a
commit
58086a865f
@ -91,10 +91,9 @@ public abstract class HttpMessageEncoder extends OneToOneEncoder {
|
||||
if (msg instanceof HttpChunk) {
|
||||
HttpChunk chunk = (HttpChunk) msg;
|
||||
if (chunked) {
|
||||
if (chunk == HttpChunk.LAST_CHUNK) {
|
||||
if (chunk.isLast()) {
|
||||
chunked = false;
|
||||
return LAST_CHUNK.duplicate();
|
||||
} else if (chunk instanceof HttpChunkTrailer) {
|
||||
if (chunk instanceof HttpChunkTrailer) {
|
||||
ChannelBuffer trailer = ChannelBuffers.dynamicBuffer(
|
||||
channel.getConfig().getBufferFactory());
|
||||
trailer.writeByte((byte) '0');
|
||||
@ -102,6 +101,9 @@ public abstract class HttpMessageEncoder extends OneToOneEncoder {
|
||||
encodeTrailingHeaders(trailer, (HttpChunkTrailer) chunk);
|
||||
trailer.writeBytes(CRLF);
|
||||
return trailer;
|
||||
} else {
|
||||
return LAST_CHUNK.duplicate();
|
||||
}
|
||||
} else {
|
||||
ChannelBuffer content = chunk.getContent();
|
||||
int contentLength = content.readableBytes();
|
||||
@ -115,7 +117,7 @@ public abstract class HttpMessageEncoder extends OneToOneEncoder {
|
||||
wrappedBuffer(CRLF));
|
||||
}
|
||||
} else {
|
||||
if (chunk == HttpChunk.LAST_CHUNK) {
|
||||
if (chunk.isLast()) {
|
||||
return null;
|
||||
} else {
|
||||
return chunk.getContent();
|
||||
|
Loading…
Reference in New Issue
Block a user