Skip to content

Commit

Permalink
[CXF-9095]Connection Leak in HttpClientWrappedOutputStream due to Unr…
Browse files Browse the repository at this point in the history
…eleased Resources on IOException
  • Loading branch information
ffang committed Jan 27, 2025
1 parent d3e9380 commit e4fb9d2
Showing 1 changed file with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -821,17 +821,30 @@ class HttpClientWrappedOutputStream extends WrappedOutputStream {

@Override
public void close() throws IOException {
super.close();
if (pout != null) {
pout.close();
pout = null;
}
if (publisher != null) {
publisher.close();
publisher = null;
try {
super.close();
} finally {
if (pout != null) {
try {
pout.close();
} catch (IOException e) {
logStackTrace(e);
}
pout = null;
}
if (publisher != null) {
try {
publisher.close();
} catch (IOException e) {
logStackTrace(e);
}
publisher = null;
}
request = null;
subscribers = null;
}
request = null;
subscribers = null;


}
void addSubscriber(Flow.Subscriber<? super ByteBuffer> subscriber) {
subscribers.add(subscriber);
Expand Down

0 comments on commit e4fb9d2

Please sign in to comment.