Welcome! Log In Create A New Profile

Advanced

[nginx] SPDY: set log action for PROXY protocol only while parsi...

Valentin Bartenev
May 15, 2014 11:26AM
details: http://hg.nginx.org/nginx/rev/ed5fb7d22d46
branches:
changeset: 5692:ed5fb7d22d46
user: Valentin Bartenev <vbart@nginx.com>
date: Thu May 15 19:22:06 2014 +0400
description:
SPDY: set log action for PROXY protocol only while parsing it.

Handling of PROXY protocol for SPDY connection is currently implemented as
a SPDY state. And while nginx waiting for PROXY protocol data it continues
to process SPDY connection: initializes zlib context, sends control frames.

diffstat:

src/http/ngx_http_spdy.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r 31349361558e -r ed5fb7d22d46 src/http/ngx_http_spdy.c
--- a/src/http/ngx_http_spdy.c Wed Apr 30 20:34:20 2014 +0400
+++ b/src/http/ngx_http_spdy.c Thu May 15 19:22:06 2014 +0400
@@ -424,12 +424,8 @@ ngx_http_spdy_init(ngx_event_t *rev)

sc->init_window = NGX_SPDY_INIT_STREAM_WINDOW;

- sc->handler = ngx_http_spdy_state_head;
-
- if (hc->proxy_protocol) {
- c->log->action = "reading PROXY protocol";
- sc->handler = ngx_http_spdy_proxy_protocol;
- }
+ sc->handler = hc->proxy_protocol ? ngx_http_spdy_proxy_protocol
+ : ngx_http_spdy_state_head;

sc->zstream_in.zalloc = ngx_http_spdy_zalloc;
sc->zstream_in.zfree = ngx_http_spdy_zfree;
@@ -823,14 +819,19 @@ static u_char *
ngx_http_spdy_proxy_protocol(ngx_http_spdy_connection_t *sc, u_char *pos,
u_char *end)
{
+ ngx_log_t *log;
+
+ log = sc->connection->log;
+ log->action = "reading PROXY protocol";
+
pos = ngx_proxy_protocol_parse(sc->connection, pos, end);

+ log->action = "processing SPDY";
+
if (pos == NULL) {
return ngx_http_spdy_state_protocol_error(sc);
}

- sc->connection->log->action = "processing SPDY";
-
return ngx_http_spdy_state_complete(sc, pos, end);
}


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

[nginx] SPDY: set log action for PROXY protocol only while parsi...

Valentin Bartenev 676 May 15, 2014 11:26AM



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

Online Users

Guests: 141
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready