cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [cxf] branch master updated: [CXF-7541] Blocking ISE
Date Wed, 25 Oct 2017 11:47:43 GMT
This is an automated email from the ASF dual-hosted git repository.

sergeyb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 0dc1c54  [CXF-7541] Blocking ISE
0dc1c54 is described below

commit 0dc1c54fde6bed3a8c465b018c4e562cfed57cfa
Author: Sergey Beryozkin <sberyozkin@gmail.com>
AuthorDate: Wed Oct 25 12:47:29 2017 +0100

    [CXF-7541] Blocking ISE
---
 .../apache/cxf/transport/http/AbstractHTTPDestination.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
index d958e33..eb7a1b9 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
@@ -648,9 +648,9 @@ public abstract class AbstractHTTPDestination
         if (hasNoResponseContent(outMessage)) {
             response.setContentLength(0);
             response.flushBuffer();
-            response.getOutputStream().close();
+            closeResponseOutputStream(response);
         } else if (!getStream) {
-            response.getOutputStream().close();
+            closeResponseOutputStream(response);
         } else {
             responseStream = response.getOutputStream();
         }
@@ -661,6 +661,14 @@ public abstract class AbstractHTTPDestination
         return responseStream;
     }
 
+    private void closeResponseOutputStream(HttpServletResponse response) throws IOException
{
+        try {
+            response.getOutputStream().close();
+        } catch (IllegalStateException ex) {
+            // response.getWriter() has already been called
+        }
+    }
+
     private int getReponseCodeFromMessage(Message message) {
         Integer i = (Integer)message.get(Message.RESPONSE_CODE);
         if (i != null) {

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <commits@cxf.apache.org>'].

Mime
View raw message