Do not write an empty buffer unnecessarily when nextChunk() returned
null
This commit is contained in:
parent
a5e9f633ef
commit
98b2b6d8dc
@ -226,6 +226,12 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns
|
||||
break;
|
||||
}
|
||||
|
||||
if (suspend) {
|
||||
// ChunkedInput.nextChunk() returned null and it has
|
||||
// not reached at the end of input. Let's wait until
|
||||
// more chunks arrive. Nothing to write or notify.
|
||||
break;
|
||||
} else {
|
||||
ChannelFuture writeFuture;
|
||||
if (endOfInput) {
|
||||
this.currentEvent = null;
|
||||
@ -248,12 +254,6 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns
|
||||
Channels.write(
|
||||
ctx, writeFuture, chunk,
|
||||
currentEvent.getRemoteAddress());
|
||||
|
||||
if (suspend) {
|
||||
// ChunkedInput.nextChunk() returned null and it has
|
||||
// not reached at the end of input. Let's wait until
|
||||
// more chunks arrive.
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this.currentEvent = null;
|
||||
|
Loading…
Reference in New Issue
Block a user