DefaultHttpClient does not release connection if zero-length reply received
---------------------------------------------------------------------------

                 Key: HTTPCLIENT-1151
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1151
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.1.2, 4.1.1
            Reporter: Sergey Alaev


When doing zero-length POST query using 
DefaultHttpClient/SingleClientConnManager it does not call 
SingleClientConnManager.releaseConnection

Request: org.apache.http.HttpPost
HTTP server response:
HTTP/1.1 200 OK [Server: Apache-Coyote/1.1, Content-Length: 0, Date: Sat, 10 
Dec 2011 09:17:53 GMT, Connection: close]

Exception when doing another request reusing that DefaultHttpClient:
Caused by: java.lang.IllegalStateException: Invalid use of 
SingleClientConnManager: connection still allocated.
Make sure to release the connection before allocating another one.
        at 
org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:216)
        at 
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:401)
        at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)

We are using digest auth if that matters:
request.addHeader("X-Requested-Auth", "Digest");
httpclient.getCredentialsProvider().setCredentials(
        new AuthScope(targetHost.getHostName(), targetHost.getPort(), 
AuthScope.ANY_REALM),
        new UsernamePasswordCredentials(username, password));

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to