Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 30752200BCD for ; Sun, 27 Nov 2016 19:46:27 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2ED55160B12; Sun, 27 Nov 2016 18:46:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 79D47160B01 for ; Sun, 27 Nov 2016 19:46:26 +0100 (CET) Received: (qmail 18683 invoked by uid 500); 27 Nov 2016 18:46:25 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 18674 invoked by uid 99); 27 Nov 2016 18:46:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Nov 2016 18:46:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9A83FE36CA; Sun, 27 Nov 2016 18:46:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Sun, 27 Nov 2016 18:46:27 -0000 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 Authored: Sun Nov 27 18:43:26 2016 +0000 Committer: Sergey Beryozkin 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); }