Author: veithen Date: Sat Sep 25 17:26:06 2010 New Revision: 1001279 URL: http://svn.apache.org/viewvc?rev=1001279&view=rev Log: Make sure that the HTTP connection is always released properly when receiving a 202 response. This was already the case for two-way asynchronous exchanges (useSeparateListener=true), but not for one-way invocations.
This change should solve the issue seen in Sandesha trunk. Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java?rev=1001279&r1=1001278&r2=1001279&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java (original) +++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java Sat Sep 25 17:26:06 2010 @@ -196,11 +196,6 @@ public class HTTPSender extends Abstract log.info("Unable to sendViaPost to url[" + url + "]", e); throw AxisFault.makeFault(e); } finally { - // If we're a dual-channel request, just auto-release the connection so it gets - // cleaned up and avoids starvation problems. - // TODO: Confirm this is OK with WS-RM, fix if not! - if (msgContext.getOptions().isUseSeparateListener()) - msgContext.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, true); cleanup(msgContext, postMethod); } } @@ -277,6 +272,8 @@ public class HTTPSender extends Abstract * of an in-only operation. In such a scenario, the HTTP response headers should be returned, * i.e. session cookies. */ obtainHTTPHeaderInformation(method, msgContext); + // Since we don't expect any content with a 202 response, we must release the connection + method.releaseConnection(); } else if (statusCode == HttpStatus.SC_INTERNAL_SERVER_ERROR || statusCode == HttpStatus.SC_BAD_REQUEST) { Header contenttypeHeader =