Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4522664

http.keepAlive=false not guaranteed to disable http connection caching

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.1
    • 1.4.0
    • core-libs
    • None
    • hopper
    • generic
    • generic

      When http.keepAlive is set to false to disable http connection reuse,
      the jdk makes an assumption that the http server will mimic the "Connection:close" header in the http response. The http 1.1 spec does not require this. It only states in 8.1.2.1 that "if either the client or the server sends the close token in the Connection header, that request becomes the
      last one for the connection."

      When http.keepAlive is set to false, HttpURLConnection puts a Connection:close
      entry in the http request. When an http 1.1 response is processed by
      HttpClient, it checks for the Connection:close entry. When one isn't
      found, it sets keepAliveConnections to 2. Then in the finished() method,
      it only checks the value of keepAlive instead of isKeepingAlive(). In
      this case, it still caches the connection.

            ywangsunw Yingxian Wang (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: