cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [4/7] git commit: [CXF-5873] Fix a problem of a ton of logs if the client pre-maturely closes a connection.
Date Fri, 11 Jul 2014 19:11:47 GMT
[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/489ac889
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/489ac889
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/489ac889

Branch: refs/heads/2.6.x-fixes
Commit: 489ac889947c265565eeaa116c04fd31b8c80b65
Parents: 2ede9f9
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Jul 11 12:47:45 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Jul 11 14:50:49 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/489ac889/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 8aca085..fb0635b 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;
@@ -285,6 +286,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();
@@ -293,9 +295,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());
+                }
             }
         }
     }


Mime
View raw message