reta commented on a change in pull request #771:
URL: https://github.com/apache/cxf/pull/771#discussion_r610253259
##########
File path: core/src/main/java/org/apache/cxf/io/CacheAndWriteOutputStream.java
##########
@@ -47,19 +47,32 @@ public void setCacheLimit(long l) {
}
public void closeFlowthroughStream() throws IOException {
- flowThroughStream.flush();
- flowThroughStream.close();
+ postClose();
}
protected void postClose() throws IOException {
- flowThroughStream.flush();
- flowThroughStream.close();
+ if (!isClosed) {
+ flowThroughStream.flush();
+ flowThroughStream.close();
+ isClosed = true;
+ }
}
public OutputStream getFlowThroughStream() {
return flowThroughStream;
}
+ @Override
+ protected void doClose() throws IOException {
+ super.doClose();
+ isClosed = true;
Review comment:
@Sevyls I had to remove `close()` and `doClose()`, the complex
relationships between these methods led to the issues that `isClosed` flag
being set **before** closing the streams. As the results, streams stayed open.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]