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;
|
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;
|
ChannelFuture writeFuture;
|
||||||
if (endOfInput) {
|
if (endOfInput) {
|
||||||
this.currentEvent = null;
|
this.currentEvent = null;
|
||||||
@ -248,12 +254,6 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns
|
|||||||
Channels.write(
|
Channels.write(
|
||||||
ctx, writeFuture, chunk,
|
ctx, writeFuture, chunk,
|
||||||
currentEvent.getRemoteAddress());
|
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 {
|
} else {
|
||||||
this.currentEvent = null;
|
this.currentEvent = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user