Welcome! Log In Create A New Profile

Advanced

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

Piotr Sikora via nginx-devel
June 22, 2017 04:36PM
# HG changeset patch
# User Piotr Sikora <piotrsikora@google.com>
# Date 1489114845 28800
# Thu Mar 09 19:00:45 2017 -0800
# Node ID 00bfd879eaf03f32373ab27110dd8f77c2b722a0
# Parent 64d12a65309eca3859055a04eb02cc14f3b3168d
HTTP/2: introduce ngx_http_v2_handle_event().

No functional changes.

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

diff -r 64d12a65309e -r 00bfd879eaf0 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -57,6 +57,8 @@
static void ngx_http_v2_read_handler(ngx_event_t *rev);
static void ngx_http_v2_write_handler(ngx_event_t *wev);
static void ngx_http_v2_handle_connection(ngx_http_v2_connection_t *h2c);
+static ngx_inline void ngx_http_v2_handle_event(ngx_http_v2_connection_t *h2c,
+ ngx_event_t *ev);

static u_char *ngx_http_v2_state_proxy_protocol(ngx_http_v2_connection_t *h2c,
u_char *pos, u_char *end);
@@ -655,6 +657,13 @@ ngx_http_v2_handle_connection(ngx_http_v
}


+static ngx_inline void
+ngx_http_v2_handle_event(ngx_http_v2_connection_t *h2c, ngx_event_t *ev)
+{
+ ev->handler(ev);
+}
+
+
static u_char *
ngx_http_v2_state_proxy_protocol(ngx_http_v2_connection_t *h2c, u_char *pos,
u_char *end)
@@ -1853,7 +1862,6 @@ ngx_http_v2_state_rst_stream(ngx_http_v2
u_char *end)
{
ngx_uint_t status;
- ngx_event_t *ev;
ngx_connection_t *fc;
ngx_http_v2_node_t *node;
ngx_http_v2_stream_t *stream;
@@ -1923,8 +1931,7 @@ ngx_http_v2_state_rst_stream(ngx_http_v2
break;
}

- ev = fc->read;
- ev->handler(ev);
+ ngx_http_v2_handle_event(h2c, fc->read);

return ngx_http_v2_state_complete(h2c, pos, end);
}
@@ -2299,7 +2306,7 @@ ngx_http_v2_state_window_update(ngx_http
wev->ready = 1;

if (!wev->delayed) {
- wev->handler(wev);
+ ngx_http_v2_handle_event(h2c, wev);
}
}

@@ -2334,7 +2341,7 @@ ngx_http_v2_state_window_update(ngx_http
wev->ready = 1;

if (!wev->delayed) {
- wev->handler(wev);
+ ngx_http_v2_handle_event(h2c, wev);

if (h2c->send_window == 0) {
break;
@@ -4028,7 +4035,6 @@ static ngx_int_t
ngx_http_v2_terminate_stream(ngx_http_v2_connection_t *h2c,
ngx_http_v2_stream_t *stream, ngx_uint_t status)
{
- ngx_event_t *rev;
ngx_connection_t *fc;

if (stream->rst_sent) {
@@ -4047,8 +4053,7 @@ ngx_http_v2_terminate_stream(ngx_http_v2
fc = stream->fake_connection;
fc->error = 1;

- rev = fc->read;
- rev->handler(rev);
+ ngx_http_v2_handle_event(h2c, fc->read);

return NGX_OK;
}
@@ -4360,7 +4365,7 @@ ngx_http_v2_finalize_connection(ngx_http
}

ev->eof = 1;
- ev->handler(ev);
+ ngx_http_v2_handle_event(h2c, ev);
}
}

@@ -4425,7 +4430,7 @@ ngx_http_v2_adjust_windows(ngx_http_v2_c
wev->ready = 1;

if (!wev->delayed) {
- wev->handler(wev);
+ ngx_http_v2_handle_event(h2c, wev);
}
}
}
_______________________________________________
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 908 June 22, 2017 04:36PM

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Maxim Dounin 374 July 13, 2017 12:30PM

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

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

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

Maxim Dounin 437 July 04, 2017 12:50PM

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

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

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

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

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

Maxim Dounin 414 July 03, 2017 10:20AM

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

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

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

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

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

Maxim Dounin 495 July 19, 2017 10:36AM

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

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

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

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

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

Maxim Dounin 585 August 08, 2017 02:06PM

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

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



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

Online Users

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