Skip to content

Commit

Permalink
minor clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
slandelle committed Dec 7, 2015
1 parent 944f9ab commit c422fe8
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -68,16 +68,16 @@ public BodyState transferTo(final ByteBuf target) throws IOException {
private BodyState readNextChunk(ByteBuf target) throws IOException {
BodyState res = BodyState.SUSPEND;
while (target.isWritable() && state != BodyState.STOP) {
BodyChunk nextPart = queue.peek();
if (nextPart == null) {
BodyChunk nextChunk = queue.peek();
if (nextChunk == null) {
// Nothing in the queue. suspend stream if nothing was read. (reads == 0)
return res;
} else if (!nextPart.buffer.hasRemaining() && !nextPart.isLast) {
} else if (!nextChunk.buffer.hasRemaining() && !nextChunk.isLast) {
// skip empty buffers
queue.remove();
} else {
res = BodyState.CONTINUE;
readChunk(target, nextPart);
readChunk(target, nextChunk);
}
}
return res;
Expand Down

0 comments on commit c422fe8

Please sign in to comment.