jira-importer opened a new issue, #1461:
URL: https://github.com/apache/httpcomponents-core/issues/1461

   **[Yongxing 
Wang](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=yongxing.wang)**
 opened 
**[HTTPCORE-231](https://issues.apache.org/jira/browse/HTTPCORE-231?redirect=false)**
 and commented
   
   We are using HTTP NIO in our production env and we recently found out that we
   can not download any file with size greater than Integer.MAX_VALUE. The 
amount
   of data we can download is always "actual_file_size - Integer.MAX_VALUE" in 
that
   case.
   
   Further looking into the code, I have found that the implementation of
   LengthDelimitedDecoder there is a line of code:
   
   int lenRemaining = (int) (this.contentLength - this.len);
   
   I believe the cast to int is causing the problem when contentLength is over 
4G.
   Once I changed lenRemaining to long and make other necessary changes to let 
it
   compile, it works great.
   
   
   
   ---
   
   **Affects:** 4.1-beta2
   
   **Attachments:**
   - 
[HTTPCORE-231.patch](https://issues.apache.org/jira/secure/attachment/12454007/HTTPCORE-231.patch)
 (_2.04 kB_)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to