[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-cvs
Subject:    svn commit: r793263 -
From:       gdaniels () apache ! org
Date:       2009-07-12 3:14:36
Message-ID: 20090712031437.09AE0238887A () eris ! apache ! org
[Download RAW message or body]

Author: gdaniels
Date: Sun Jul 12 03:14:36 2009
New Revision: 793263

URL: http://svn.apache.org/viewvc?rev=793263&view=rev
Log:
Guard against "attempted read from closed stream" error - you REALLY shouldn't be \
auto-releasing for synchronous request/response clients, so make sure \
AUTO_RELEASE_CONNECTION doesn't break things in that case.

Modified:
    webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java


Modified: webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java
                
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_5/modules/transpor \
t/http/src/org/apache/axis2/transport/http/HTTPSender.java?rev=793263&r1=793262&r2=793263&view=diff
 ==============================================================================
--- webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java \
                (original)
+++ webservices/axis2/branches/java/1_5/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java \
Sun Jul 12 03:14:36 2009 @@ -22,6 +22,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.description.OutInAxisOperation;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.i18n.Messages;
@@ -111,8 +112,13 @@
 
     private void cleanup(MessageContext msgContext, HttpMethod method) {
         if (msgContext.isPropertyTrue(HTTPConstants.AUTO_RELEASE_CONNECTION)) {
-            log.trace("AutoReleasing " + method);
-            method.releaseConnection();
+            // Protect against synchronously waiting for a response, in which case
+            // this would result in trying to read a closed stream...!
+            if (!(msgContext.getAxisOperation() instanceof OutInAxisOperation) ||
+                msgContext.getOptions().isUseSeparateListener()) {
+                log.trace("AutoReleasing " + method);
+                method.releaseConnection();
+            }
         }
     }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic