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. 6
      spring-web/src/main/java/org/springframework/http/server/reactive/AbstractResponseBodyProcessor.java

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

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

Loading…
Cancel
Save