CommonsHttpMessageSender.close() should call postMethod.releaseConnection() in 
a finally {} statement
-----------------------------------------------------------------------------------------------------

                 Key: XFIRE-1047
                 URL: http://jira.codehaus.org/browse/XFIRE-1047
             Project: XFire
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2, 1.2-RC, 
1.1.2, 1.1.1, 1.1, 1.1-RC1, 1.1-beta-1, 1.0, 1.0-RC, 1.0-M6, 1.0-M5, 1.0-M4, 
1.0-M3, 1.0-alpha-2, 1.0-alpha-1, 1.2.7
            Reporter: Lee G.
            Assignee: Dan Diephouse


In the CommonsHttpMessageSender.close() method, if the calls to
msgIs.close() or source.dispose() throw an exception, then no call to 
postMethod.releaseConnection(); will get made.
this in turn will result in a HttpConnection leak in HttpClient's connection 
pool.

Example fix :-

    public void close()
        throws XFireException
    {
        try {
        if (msgIs != null) {
            try  {
                 msgIs.close();
                  }
            catch (IOException e) {
                 throw new XFireException("Could not close connection.", e);
            }
        }
        if (source != null) {
             source.dispose();
        }
               } finally {
                if (postMethod != null)
                    postMethod.releaseConnection();
            }    
    }




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to