Skip to content

Commit

Permalink
app fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dlepex committed Nov 6, 2017
1 parent d01bb7a commit 509430c
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public NettyChannelWritesEnqueuer(Channel chan) {
protected CompletionStage<?> pollAsync(Queue<ByteBuf> q) {
int bytesToFlush = 0;
int flushLimit = this.flushLimit;
boolean dirty = false;
CompletionStage<?> stage = CompletableFuture.completedFuture(null);
for (ByteBuf buf = q.poll(); buf != null; ) {
int bufSize = buf.readableBytes();
Expand All @@ -56,19 +55,14 @@ protected CompletionStage<?> pollAsync(Queue<ByteBuf> q) {
}
bytesToFlush += bufSize;
if (bytesToFlush <= flushLimit) {
dirty = true;
stage = doWrite(stage, buf);
} else {
dirty = false;
bytesToFlush = 0;
stage = doFlush(stage);
stage = doWrite(stage, buf);
}
}
if (dirty) {
stage = doFlush(stage);
}
return stage;
return doFlush(stage);
}

private CompletionStage<?> doFlush(CompletionStage<?> stage) {
Expand Down

0 comments on commit 509430c

Please sign in to comment.