Browse Source

Merge pull request #1243 from violetagg/write-issue

* SPR-14941:
  Fix NPE in ServletServerHttpResponse.ResponseBodyProcessor.write
pull/1242/merge
Arjen Poutsma 8 years ago
parent
commit
34c6c9ffc2
  1. 4
      spring-web/src/main/java/org/springframework/http/server/reactive/AbstractResponseBodyProcessor.java

4
spring-web/src/main/java/org/springframework/http/server/reactive/AbstractResponseBodyProcessor.java

@ -221,11 +221,13 @@ abstract class AbstractResponseBodyProcessor implements Processor<DataBuffer, Vo
if (dataBuffer.readableByteCount() == 0) { if (dataBuffer.readableByteCount() == 0) {
processor.subscription.request(1); processor.subscription.request(1);
} }
else if (processor.changeState(this, RECEIVED)) { else {
processor.receiveBuffer(dataBuffer); processor.receiveBuffer(dataBuffer);
if (processor.changeState(this, RECEIVED)) {
processor.writeIfPossible(); processor.writeIfPossible();
} }
} }
}
@Override @Override
public void onComplete(AbstractResponseBodyProcessor processor) { public void onComplete(AbstractResponseBodyProcessor processor) {

Loading…
Cancel
Save