serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1788146 - /serf/trunk/protocols/http2_protocol.c
Date Wed, 22 Mar 2017 18:07:52 GMT
Author: kotkov
Date: Wed Mar 22 18:07:51 2017
New Revision: 1788146

URL: http://svn.apache.org/viewvc?rev=1788146&view=rev
Log:
HTTP/2: Fix improper handling of SETTINGS_INITIAL_WINDOW_SIZE that
could result in the "HTTP2 flow control limits exceeded" error when
talking to nginx servers:

    > serf_get --http2 https://www.cloudflare.com
    Error running context: (120153) HTTP2 flow control limits exceeded

Serf used the incoming value to update the size of the connection
flow-control window.  Doing so violates RFC 7540, 6.9.2 [1], which
states that the SETTINGS_INITIAL_WINDOW_SIZE value in the SETTINGS
frame *cannot* alter the connection flow-control window size, and
that it only affects the initial window size for new streams.

[1] https://tools.ietf.org/html/rfc7540#section-6.9.2

* protocols/http2_protocol.c
  (http2_handle_settings): Don't change the connection flow-control
   window size.  Include the relevant part of RFC 7540 in the comment.

Approved by: rhuijben

Modified:
    serf/trunk/protocols/http2_protocol.c

Modified: serf/trunk/protocols/http2_protocol.c
URL: http://svn.apache.org/viewvc/serf/trunk/protocols/http2_protocol.c?rev=1788146&r1=1788145&r2=1788146&view=diff
==============================================================================
--- serf/trunk/protocols/http2_protocol.c (original)
+++ serf/trunk/protocols/http2_protocol.c Wed Mar 22 18:07:51 2017
@@ -824,7 +824,14 @@ http2_handle_settings(void *baton,
               /* Sanitize? */
                 serf__log(LOGLVL_INFO, SERF_LOGHTTP2, h2->config,
                           "Setting Initial Window Size %u\n", value);
-                h2->lr_window += (value - h2->lr_default_window);
+                /* This only affects the default window size for new streams
+                   (the connection window size is left unchanged):
+
+                   Both endpoints can adjust the initial window size for new
+                   streams by including a value for SETTINGS_INITIAL_WINDOW_SIZE
+                   in the SETTINGS frame that forms part of the connection
+                   preface.  The connection flow-control window can only be
+                   changed using WINDOW_UPDATE frames. */
                 h2->lr_default_window = value;
                 break;
             case HTTP2_SETTING_MAX_FRAME_SIZE:



Mime
View raw message