]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: send SETTINGS ACK after applying all SETTINGS params.
authorPiotr Sikora <piotrsikora@google.com>
Fri, 2 Jun 2017 12:05:24 +0000 (15:05 +0300)
committerPiotr Sikora <piotrsikora@google.com>
Fri, 2 Jun 2017 12:05:24 +0000 (15:05 +0300)
This avoids sending unnecessary SETTINGS ACK in case of PROTOCOL_ERROR.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
src/http/v2/ngx_http_v2.c

index 0a0dcd72bfc4c4584495dce8c974af4921695046..be78509400c987e50918d293e180e47861e83a2d 100644 (file)
@@ -1959,8 +1959,6 @@ ngx_http_v2_state_settings(ngx_http_v2_connection_t *h2c, u_char *pos,
         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_http_v2_connection_t *h2c, u_char *pos,
         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,