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

   **[Kaven 
Stone](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=stonecity)** 
opened 
**[HTTPCORE-701](https://issues.apache.org/jira/browse/HTTPCORE-701?redirect=false)**
 and commented
   
   I just read the update window logic for http2, and the function is a little 
confuse for me.
   1. for the two TODO:  The first TODO, it revert the min value as to the the 
max value, this if for what situation?
   2. The seconde TODO:  needs to be removed ,  and that will remove what?
   
    
   
   The soure code in 
httpcore5-h2\src\main\java\org\apache\hc\core5\http2\impl\nio\AbstractH2StreamMultiplexer.java
 is as below:
   
   private int updateWindow(final AtomicInteger window, final int delta) throws 
ArithmeticException {
   for (;;) {
   final int current = window.get();
   long newValue = (long) current + delta;
   
   //TODO: work-around for what looks like a bug in Ngnix (1.11)
   // Tolerate if the update window exceeded by one
   if (newValue == 0x80000000L)
   
   { newValue = Integer.MAX_VALUE; }
   
   //TODO: needs to be removed
   
   if (Math.abs(newValue) > 0x7fffffffL)
   
   { throw new ArithmeticException("Update causes flow control window to exceed 
" + Integer.MAX_VALUE); }
   
   if (window.compareAndSet(current, (int) newValue))
   
   { return (int) newValue; }
   
   }
   }
   
    
   
   
   ---
   
   **Affects:** 5.1
   


-- 
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