Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1151

DefaultHttpClient does not release connection if zero-length reply received

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 4.1.1, 4.1.2
    • None
    • HttpClient (classic)
    • 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));

      Attachments

        1. wire.log
          7 kB
          Sergey Alaev

        Activity

          People

            Unassigned Unassigned
            scf37 Sergey Alaev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: