cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject 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, 27 Nov 2016 18:46:25 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 491e0031c -> 06cfab8c3


[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/06cfab8c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/06cfab8c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/06cfab8c

Branch: refs/heads/3.1.x-fixes
Commit: 06cfab8c3518c7ad795431af20553e4e75f69e3c
Parents: 491e003
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:46:08 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/06cfab8c/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