arturobernalg commented on PR #510:
URL: 
https://github.com/apache/httpcomponents-core/pull/510#issuecomment-2558005058

   > @arturobernalg I am sorry but this is really not a good idea. We cannot 
just disable the data window overflow check and hope for the best. HTTP/2 
endpoints can make mistakes in calculating their data windows. We need to 
detect those mistakes and report them as protocol violations
   
   @ok2c  I see your point about not bypassing the overflow check. How about 
keeping the protocol violation handling by throwing an H2ConnectionException on 
overflow? This way, we still catch misbehaving endpoints without silently 
ignoring the issue. 
   
   ```
   
       private int updateWindow(final AtomicInteger window, final int delta) 
throws H2ConnectionException {
           for (;;) {
               final int current = window.get();
               final long newValue = (long) current + delta;
   
               if (newValue > Integer.MAX_VALUE || newValue < 
Integer.MIN_VALUE) {
                   throw new H2ConnectionException(H2Error.FLOW_CONTROL_ERROR,
                           "Flow control window exceeded: " + newValue);
               }
   
               if (window.compareAndSet(current, (int) newValue)) {
                   return (int) newValue;
               }
           }
       }
   ```
   


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to