hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1774336 - /httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
Date Wed, 14 Dec 2016 20:19:33 GMT
Author: olegk
Date: Wed Dec 14 20:19:33 2016
New Revision: 1774336

URL: http://svn.apache.org/viewvc?rev=1774336&view=rev
Log:
 Work-around for what appears to be a bug in Ngnix 1.11

Modified:
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java?rev=1774336&r1=1774335&r2=1774336&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
Wed Dec 14 20:19:33 2016
@@ -171,8 +171,16 @@ abstract class AbstractHttp2StreamMultip
     private int updateWindow(final AtomicInteger window, final int delta) throws ArithmeticException
{
         for (;;) {
             final int current = window.get();
-            final long newValue = (long) current + delta;
-            if (Math.abs(newValue) > Integer.MAX_VALUE) {
+            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)) {



Mime
View raw message