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

GetMethod.java checks the "used" flag which cannot be set at this time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0 Beta 1
    • HttpClient (classic)
    • None
    • Operating System: All
      Platform: All
    • 19424

    Description

      GetMethod.getResponseBodyAsStream calls HttpMethodBase.checkUsed, which asserts
      the flag "used" is "true". But at this time, "used" cannot be true, as "used" is
      set to true in HttpMethodBase.processRequest, two lines after readResponse is
      called (which in turn calls readResponseBody / readResponseBodyAsStream).

      Maybe "requestSent" is the flag which should be checked instead of "used"?

      My stack trace: (fragment)

      java.lang.IllegalStateException: Not Used.
      at
      org.apache.commons.httpclient.HttpMethodBase.checkUsed(HttpMethodBase.java:1642)
      at
      org.apache.commons.httpclient.methods.GetMethod.getResponseBodyAsStream(GetMethod.java:309)
      at
      org.apache.commons.httpclient.methods.GetMethod.readResponseBody(GetMethod.java:428)
      at
      org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1893)
      at
      org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2496)
      at
      org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1062)
      at
      org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:599)
      at
      org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
      at
      org.apache.webdav.lib.WebdavResource.getMethodData(WebdavResource.java:2227)
      at
      org.apache.webdav.lib.WebdavResource.getMethodData(WebdavResource.java:2206)
      [...]

      Attachments

        Activity

          People

            Unassigned Unassigned
            max@linuxtag.org Max Kellermann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: