cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1509765 - in /cxf/branches/2.6.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
Date Fri, 02 Aug 2013 16:29:48 GMT
Author: sergeyb
Date: Fri Aug  2 16:29:48 2013
New Revision: 1509765

URL: http://svn.apache.org/r1509765
Log:
Merged revisions 1509762 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1509762 | sergeyb | 2013-08-02 17:22:45 +0100 (Fri, 02 Aug 2013) | 9 lines
  
  Merged revisions 1509756 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1509756 | sergeyb | 2013-08-02 17:10:36 +0100 (Fri, 02 Aug 2013) | 1 line
    
    [CXF-5144] Closing response stream only if 'response.stream.auto.close' property is enabled
  ........
................

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1509762
  Merged /cxf/trunk:r1509756

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=1509765&r1=1509764&r2=1509765&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
Fri Aug  2 16:29:48 2013
@@ -449,7 +449,7 @@ public abstract class AbstractClient imp
             } catch (Exception ex) {
                 reportMessageHandlerProblem("MSG_READER_PROBLEM", cls, contentType, ex, r);
             } finally {
-                if (cls != InputStream.class && inputStream != null) {
+                if (inputStream != null && responseStreamCanBeClosed(outMessage,
cls)) {
                     try {
                         inputStream.close();
                     } catch (IOException ex) { 
@@ -465,6 +465,10 @@ public abstract class AbstractClient imp
         return null;                                                
     }
     
+    private boolean responseStreamCanBeClosed(Message outMessage, Class<?> cls) {
+        return MessageUtils.isTrue(outMessage.getContextualProperty("response.stream.auto.close"));
+    }    
+
     protected void completeExchange(Object response, Exchange exchange, boolean proxy) {
         // higher level conduits such as FailoverTargetSelector need to
         // clear the request state but a fair number of response objects 



Mime
View raw message