Github user imoldovan-intacct commented on a diff in the pull request:

    https://github.com/apache/httpcomponents-core/pull/59#discussion_r168498931
  
    --- Diff: 
httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/ExpandableBuffer.java 
---
    @@ -123,6 +123,10 @@ protected void expand() {
                 // WARNING: This code assumes you are providing enough heap 
room with -Xmx.
                 // source of inspiration: 
https://bugs.openjdk.java.net/browse/JDK-8059914
                 newcapacity = Integer.MAX_VALUE - headRoom;
    +            if (newcapacity == this.buffer.capacity()) {
    --- End diff --
    
    There is no way for this.buffer.capacity() to exceed Integer.MAX_VALUE - 
headRoom.
    When we get to the point that they are equal => we already have touched 
maximum buffer capacity allowed once (MAX_VALUE - 8 in our case) and we are 
going inside an endless loop.


---

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

Reply via email to