Skip to content

Commit

Permalink
Improve AbstractResponseBodyProcessor.onNext(..)
Browse files Browse the repository at this point in the history
If the provided DataBuffer is empty then request the next DataBuffer.
  • Loading branch information
violetagg authored and rstoyanchev committed Oct 14, 2016
1 parent fada5ae commit ced6559
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ public void onSubscribe(AbstractResponseBodyProcessor processor, Subscription su

@Override
public void onNext(AbstractResponseBodyProcessor processor, DataBuffer dataBuffer) {
if (processor.changeState(this, RECEIVED)) {
if (dataBuffer.readableByteCount() == 0) {
processor.subscription.request(1);
}
else if (processor.changeState(this, RECEIVED)) {
processor.receiveBuffer(dataBuffer);
processor.writeIfPossible();
}
Expand Down

0 comments on commit ced6559

Please sign in to comment.