Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
4.1.1, 4.1.2
-
None
-
None
Description
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));