You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2014/07/11 20:35:58 UTC

[3/6] git commit: [CXF-5873] Fix a problem of a ton of logs if the client pre-maturely closes a connection.

[CXF-5873] Fix a problem of a ton of logs if the client pre-maturely closes a connection.


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

Branch: refs/heads/2.7.x-fixes
Commit: 77a6a3c0692a8218fffcf2d9142f228226d85274
Parents: ed9f249
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Jul 11 12:47:45 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Jul 11 14:31:33 2014 -0400

----------------------------------------------------------------------
 .../binding/soap/interceptor/SoapOutInterceptor.java   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/77a6a3c0/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
index 95a6859..374f43b 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.binding.soap.interceptor;
 
 
+import java.io.EOFException;
 import java.io.OutputStream;
 import java.util.List;
 import java.util.Map;
@@ -296,6 +297,7 @@ public class SoapOutInterceptor extends AbstractSoapInterceptor {
             try {
                 XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
                 if (xtw != null) {
+                    // Write body end
                     xtw.writeEndElement();            
                     // Write Envelope end element
                     xtw.writeEndElement();
@@ -304,9 +306,14 @@ public class SoapOutInterceptor extends AbstractSoapInterceptor {
                     xtw.flush();
                 }
             } catch (XMLStreamException e) {
-                SoapVersion soapVersion = message.getVersion();
-                throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), e,
-                                    soapVersion.getSender());
+                if (e.getCause() instanceof EOFException) {
+                    //Nothing we can do about this, some clients will close the connection early if 
+                    //they fully parse everything they need
+                } else {
+                    SoapVersion soapVersion = message.getVersion();
+                    throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), e,
+                                        soapVersion.getSender());
+                }
             }
         }
     }