cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [08/30] cxf git commit: [CXF-7155] Close CachedOutputStream when response is written to the output stream, patch from Alexander Onnikov applied, This closes #207
Date Sun, 04 Dec 2016 01:11:50 GMT
[CXF-7155] Close CachedOutputStream when response is written to the output stream, patch from
Alexander Onnikov applied, This closes #207


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2ac40942
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2ac40942
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2ac40942

Branch: refs/heads/CXF-6882.nio
Commit: 2ac40942fe097b666610e95c0a06b2d0f85e84b7
Parents: 5764964
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Sun Nov 27 18:43:26 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Sun Nov 27 18:44:56 2016 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2ac40942/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
index 9506f8d..9ee4c7d 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
@@ -256,6 +256,10 @@ public class JAXRSOutInterceptor extends AbstractOutDatabindingInterceptor
{
                 checkCachedStream(message, outOriginal, enabled);
             } finally {
                 if (enabled) {
+                    OutputStream os = message.getContent(OutputStream.class);
+                    if (os != outOriginal && os instanceof CachedOutputStream) {
+                        os.close();
+                    }
                     message.setContent(OutputStream.class, outOriginal);
                     message.put(XMLStreamWriter.class.getName(), null);
                 }


Mime
View raw message