Welcome! Log In Create A New Profile

Advanced

[PATCH 05 of 14] HTTP/2: introduce h2c->conf_ctx

Piotr Sikora via nginx-devel
June 22, 2017 04:36PM
# HG changeset patch
# User Piotr Sikora <piotrsikora@google.com>
# Date 1489106035 25200
# Thu Mar 09 17:33:55 2017 -0700
# Node ID 24b0f9f4ebfa560edd984146548ab07925dba73f
# Parent 912d9cf36783146e61a68d554253e70956ea9125
HTTP/2: introduce h2c->conf_ctx.

No functional changes.

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

diff -r 912d9cf36783 -r 24b0f9f4ebfa src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -239,6 +239,7 @@ ngx_http_v2_init(ngx_event_t *rev)

h2c->connection = c;
h2c->http_connection = hc;
+ h2c->conf_ctx = hc->conf_ctx;

h2c->send_window = NGX_HTTP_V2_DEFAULT_WINDOW;
h2c->recv_window = NGX_HTTP_V2_MAX_WINDOW;
@@ -247,7 +248,7 @@ ngx_http_v2_init(ngx_event_t *rev)

h2c->frame_size = NGX_HTTP_V2_DEFAULT_FRAME_SIZE;

- h2scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

h2c->pool = ngx_create_pool(h2scf->pool_size, h2c->connection->log);
if (h2c->pool == NULL) {
@@ -349,8 +350,7 @@ ngx_http_v2_read_handler(ngx_event_t *re
return;
}

- h2mcf = ngx_http_get_module_main_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2mcf = ngx_http_get_module_main_conf(h2c->conf_ctx, ngx_http_v2_module);

available = h2mcf->recv_buffer_size - 2 * NGX_HTTP_V2_STATE_BUFFER_SIZE;

@@ -511,8 +511,7 @@ ngx_http_v2_send_output_queue(ngx_http_v
goto error;
}

- clcf = ngx_http_get_module_loc_conf(h2c->http_connection->conf_ctx,
- ngx_http_core_module);
+ clcf = ngx_http_get_module_loc_conf(h2c->conf_ctx, ngx_http_core_module);

if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
goto error;
@@ -624,8 +623,7 @@ ngx_http_v2_handle_connection(ngx_http_v
return;
}

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);
if (h2c->state.incomplete) {
ngx_add_timer(c->read, h2scf->recv_timeout);
return;
@@ -1086,8 +1084,7 @@ ngx_http_v2_state_headers(ngx_http_v2_co
goto rst_stream;
}

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

h2c->state.header_limit = h2scf->max_header_size;

@@ -1319,8 +1316,7 @@ ngx_http_v2_state_field_len(ngx_http_v2_
"http2 hpack %s string length: %i",
huff ? "encoded" : "raw", len);

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

if ((size_t) len > h2scf->max_field_size) {
ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0,
@@ -2590,8 +2586,7 @@ ngx_http_v2_send_settings(ngx_http_v2_co

buf->last = ngx_http_v2_write_sid(buf->last, 0);

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
"http2 send SETTINGS param MAX_CONCURRENT_STREAMS:%ui",
@@ -2953,8 +2948,7 @@ ngx_http_v2_get_node_by_id(ngx_http_v2_c
ngx_http_v2_node_t *node;
ngx_http_v2_srv_conf_t *h2scf;

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

index = ngx_http_v2_index(h2scf, sid);

@@ -2998,8 +2992,7 @@ ngx_http_v2_get_closed_node(ngx_http_v2_
ngx_http_v2_node_t *node, **next, *n, *parent, *child;
ngx_http_v2_srv_conf_t *h2scf;

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

h2c->closed_nodes--;

@@ -4287,8 +4280,7 @@ ngx_http_v2_idle_handler(ngx_event_t *re
c->destroyed = 0;
ngx_reusable_connection(c, 0);

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

h2c->pool = ngx_create_pool(h2scf->pool_size, h2c->connection->log);
if (h2c->pool == NULL) {
@@ -4337,8 +4329,7 @@ ngx_http_v2_finalize_connection(ngx_http

h2c->last_out = NULL;

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

size = ngx_http_v2_index_size(h2scf);

@@ -4393,8 +4384,7 @@ ngx_http_v2_adjust_windows(ngx_http_v2_c
ngx_http_v2_stream_t *stream;
ngx_http_v2_srv_conf_t *h2scf;

- h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
- ngx_http_v2_module);
+ h2scf = ngx_http_get_module_srv_conf(h2c->conf_ctx, ngx_http_v2_module);

size = ngx_http_v2_index_size(h2scf);

diff -r 912d9cf36783 -r 24b0f9f4ebfa src/http/v2/ngx_http_v2.h
--- a/src/http/v2/ngx_http_v2.h
+++ b/src/http/v2/ngx_http_v2.h
@@ -113,6 +113,7 @@ typedef struct {
struct ngx_http_v2_connection_s {
ngx_connection_t *connection;
ngx_http_connection_t *http_connection;
+ ngx_http_conf_ctx_t *conf_ctx;

ngx_uint_t processing;

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

[PATCH 01 of 14] Output chain: propagate last_buf flag to c->send_chain()

Piotr Sikora via nginx-devel 911 June 22, 2017 04:36PM

[PATCH 02 of 14] Upstream keepalive: preserve c->data

Piotr Sikora via nginx-devel 330 June 22, 2017 04:36PM

[PATCH 03 of 14] HTTP/2: add debug logging of control frames

Piotr Sikora via nginx-devel 403 June 22, 2017 04:36PM

Re: [PATCH 03 of 14] HTTP/2: add debug logging of control frames

Valentin V. Bartenev 446 July 03, 2017 10:00AM

Re: [PATCH 03 of 14] HTTP/2: add debug logging of control frames

Piotr Sikora via nginx-devel 413 July 05, 2017 06:04AM

Re: [PATCH 03 of 14] HTTP/2: add debug logging of control frames

Valentin V. Bartenev 523 July 10, 2017 11:28AM

[PATCH 04 of 14] HTTP/2: s/client/peer/

Piotr Sikora via nginx-devel 456 June 22, 2017 04:36PM

[PATCH 05 of 14] HTTP/2: introduce h2c->conf_ctx

Piotr Sikora via nginx-devel 412 June 22, 2017 04:36PM

[PATCH 06 of 14] HTTP/2: introduce stream->fake_connection

Piotr Sikora via nginx-devel 474 June 22, 2017 04:36PM

[PATCH 07 of 14] HTTP/2: introduce ngx_http_v2_handle_event()

Piotr Sikora via nginx-devel 418 June 22, 2017 04:36PM

[PATCH 08 of 14] HTTP/2: add HTTP/2 to upstreams

Piotr Sikora via nginx-devel 677 June 22, 2017 04:36PM

[PATCH 09 of 14] Proxy: add "proxy_ssl_alpn" directive

Piotr Sikora via nginx-devel 612 June 22, 2017 04:36PM

Re: [PATCH 09 of 14] Proxy: add "proxy_ssl_alpn" directive

Maxim Dounin 376 July 13, 2017 12:30PM

[PATCH 10 of 14] Proxy: always emit "Host" header first

Piotr Sikora via nginx-devel 342 June 22, 2017 04:36PM

Re: [PATCH 10 of 14] Proxy: always emit "Host" header first

Maxim Dounin 439 July 04, 2017 12:50PM

Re: [PATCH 10 of 14] Proxy: always emit "Host" header first

Piotr Sikora via nginx-devel 327 July 05, 2017 06:30AM

[PATCH 11 of 14] Proxy: split configured header names and values

Piotr Sikora via nginx-devel 416 June 22, 2017 04:36PM

Re: [PATCH 11 of 14] Proxy: split configured header names and values

Maxim Dounin 416 July 03, 2017 10:20AM

[PATCH 13 of 14] Proxy: add "proxy_pass_trailers" directive

Piotr Sikora via nginx-devel 485 June 22, 2017 04:36PM

[PATCH 12 of 14] Proxy: add HTTP/2 support

Piotr Sikora via nginx-devel 1301 June 22, 2017 04:36PM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Maxim Dounin 498 July 19, 2017 10:36AM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Piotr Sikora via nginx-devel 477 July 25, 2017 09:30PM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Piotr Sikora via nginx-devel 510 July 31, 2017 06:06PM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Maxim Dounin 587 August 08, 2017 02:06PM

[PATCH 14 of 14] Cache: add HTTP/2 support

Piotr Sikora via nginx-devel 475 June 22, 2017 04:36PM



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

Online Users

Guests: 237
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