[PATCH 2 of 4] HTTP/2: send SETTINGS ACK after applying all SETTINGS params

Piotr Sikora piotrsikora at google.com
Thu Jun 1 21:51:59 UTC 2017


# HG changeset patch
# User Piotr Sikora <piotrsikora at google.com>
# Date 1493067147 25200
#      Mon Apr 24 13:52:27 2017 -0700
# Node ID d61e944f55e70a5a25c8a79bfc5c167b7f22d62e
# Parent  1738ed9658e2a9a12370f4c828761a9fd058935d
HTTP/2: send SETTINGS ACK after applying all SETTINGS params.

This avoids sending unnecessary SETTINGS ACK in case of PROTOCOL_ERROR.

Signed-off-by: Piotr Sikora <piotrsikora at google.com>

diff -r 1738ed9658e2 -r d61e944f55e7 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -1959,8 +1959,6 @@ ngx_http_v2_state_settings(ngx_http_v2_c
         return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
     }
 
-    ngx_http_v2_send_settings(h2c, 1);
-
     return ngx_http_v2_state_settings_params(h2c, pos, end);
 }
 
@@ -2026,6 +2024,8 @@ ngx_http_v2_state_settings_params(ngx_ht
         pos += NGX_HTTP_V2_SETTINGS_PARAM_SIZE;
     }
 
+    ngx_http_v2_send_settings(h2c, 1);
+
     if (window_delta) {
         if (ngx_http_v2_adjust_windows(h2c, window_delta) != NGX_OK) {
             return ngx_http_v2_connection_error(h2c,


More information about the nginx-devel mailing list