Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-612

NumberFormatException in DefaultConnectionReuseStrategy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.4.10
    • 4.4.13, 5.0-beta11
    • HttpCore
    • None

    Description

      DefaultConnectionReuseStrategy uses Integer.parseInt to parse Content-Length header. For size > 2 GB, parsing fails with NumberFormatException.

      Stack trace

      parseInt:658, Integer (java.lang)
      parseInt:776, Integer (java.lang)
      keepAlive:136, DefaultConnectionReuseStrategy (org.apache.http.impl)
      keepAlive:62, DefaultClientConnectionReuseStrategy (org.apache.http.impl.client)
      execute:275, MainClientExec (org.apache.http.impl.execchain)
      execute:186, ProtocolExec (org.apache.http.impl.execchain)
      execute:89, RetryExec (org.apache.http.impl.execchain)
      doExecute:185, InternalHttpClient (org.apache.http.impl.client)
      execute:83, CloseableHttpClient (org.apache.http.impl.client) 

      Line 90 & 136:

      final int contentLen = Integer.parseInt(clh.getValue());

      Should use Long.parseLong instead.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kiransg Kiran G
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: