Welcome! Log In Create A New Profile

Advanced

[PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Piotr Sikora via nginx-devel
June 01, 2017 05:54PM
# HG changeset patch
# User Piotr Sikora <piotrsikora@google.com>
# Date 1493067124 25200
# Mon Apr 24 13:52:04 2017 -0700
# Node ID 1738ed9658e2a9a12370f4c828761a9fd058935d
# Parent ab6ef3037840393752d82fac01ea1eb4f972301c
HTTP/2: emit new frames only after applying all SETTINGS params.

Previously, new frames could be emitted in the middle of applying
new (and already acknowledged) SETTINGS params, which is illegal.

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

diff -r ab6ef3037840 -r 1738ed9658e2 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -1969,8 +1969,11 @@ static u_char *
ngx_http_v2_state_settings_params(ngx_http_v2_connection_t *h2c, u_char *pos,
u_char *end)
{
+ ssize_t window_delta;
ngx_uint_t id, value;

+ window_delta = 0;
+
while (h2c->state.length) {
if (end - pos < NGX_HTTP_V2_SETTINGS_PARAM_SIZE) {
return ngx_http_v2_state_save(h2c, pos, end,
@@ -1995,12 +1998,7 @@ ngx_http_v2_state_settings_params(ngx_ht
NGX_HTTP_V2_FLOW_CTRL_ERROR);
}

- if (ngx_http_v2_adjust_windows(h2c, value - h2c->init_window)
- != NGX_OK)
- {
- return ngx_http_v2_connection_error(h2c,
- NGX_HTTP_V2_INTERNAL_ERROR);
- }
+ window_delta = value - h2c->init_window;

h2c->init_window = value;
break;
@@ -2028,6 +2026,13 @@ ngx_http_v2_state_settings_params(ngx_ht
pos += NGX_HTTP_V2_SETTINGS_PARAM_SIZE;
}

+ if (window_delta) {
+ if (ngx_http_v2_adjust_windows(h2c, window_delta) != NGX_OK) {
+ return ngx_http_v2_connection_error(h2c,
+ NGX_HTTP_V2_INTERNAL_ERROR);
+ }
+ }
+
return ngx_http_v2_state_complete(h2c, pos, end);
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Piotr Sikora via nginx-devel 498 April 24, 2017 06:50PM

[PATCH 3 of 4] HTTP/2: make SETTINGS ACK frame reusable

Piotr Sikora via nginx-devel 232 April 24, 2017 06:50PM

Re: [PATCH 3 of 4] HTTP/2: make SETTINGS ACK frame reusable

Valentin V. Bartenev 168 June 01, 2017 01:54PM

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

Piotr Sikora via nginx-devel 261 April 24, 2017 06:50PM

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

Valentin V. Bartenev 193 June 01, 2017 01:24PM

[PATCH 4 of 4] HTTP/2: don't send SETTINGS ACK before already queued DATA frames

Piotr Sikora via nginx-devel 233 April 24, 2017 06:50PM

Re: [PATCH 4 of 4] HTTP/2: don't send SETTINGS ACK before already queued DATA frames

Valentin V. Bartenev 233 June 01, 2017 01:54PM

Re: [PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Piotr Sikora via nginx-devel 237 May 30, 2017 05:24PM

Re: [PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Valentin V. Bartenev 190 June 01, 2017 10:50AM

Re: [PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Valentin V. Bartenev 190 June 01, 2017 01:56PM

Re: [PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Piotr Sikora via nginx-devel 189 June 01, 2017 05:56PM

Re: [PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Valentin V. Bartenev 350 June 02, 2017 08:12AM

[PATCH 1 of 4] HTTP/2: emit new frames only after applying all SETTINGS params

Piotr Sikora via nginx-devel 208 June 01, 2017 05:54PM

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

Piotr Sikora via nginx-devel 214 June 01, 2017 05:54PM

[PATCH 3 of 4] HTTP/2: make SETTINGS ACK frame reusable

Piotr Sikora via nginx-devel 244 June 01, 2017 05:54PM

[PATCH 4 of 4] HTTP/2: don't send SETTINGS ACK before already queued DATA frames

Piotr Sikora via nginx-devel 198 June 01, 2017 05:54PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 204
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready