Welcome! Log In Create A New Profile

Advanced

[PATCH] HTTP/2: add debug logging of pseudo-headers and control frames

Piotr Sikora via nginx-devel
March 26, 2017 04:46AM
# HG changeset patch
# User Piotr Sikora <piotrsikora@google.com>
# Date 1490516711 25200
# Sun Mar 26 01:25:11 2017 -0700
# Node ID 6990fb6463ce47705e06ff6d0fbd9ae6696aeb37
# Parent 22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
HTTP/2: add debug logging of pseudo-headers and control frames.

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

diff -r 22be63bf21ed -r 6990fb6463ce src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -1585,6 +1585,10 @@ ngx_http_v2_state_process_header(ngx_htt
rc = ngx_http_v2_pseudo_header(r, header);

if (rc == NGX_OK) {
+ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "http2 http header: \":%V: %V\"",
+ &header->name, &header->value);
+
return ngx_http_v2_state_header_complete(h2c, pos, end);
}

@@ -1955,6 +1959,9 @@ ngx_http_v2_state_settings(ngx_http_v2_c
return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
}

+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
+ "http2 SETTINGS frame ack:1");
+
h2c->settings_ack = 1;

return ngx_http_v2_state_complete(h2c, pos, end);
@@ -1968,6 +1975,9 @@ ngx_http_v2_state_settings(ngx_http_v2_c
return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
}

+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
+ "http2 SETTINGS frame ack:0");
+
ngx_http_v2_send_settings(h2c, 1);

return ngx_http_v2_state_settings_params(h2c, pos, end);
@@ -2070,12 +2080,16 @@ ngx_http_v2_state_ping(ngx_http_v2_conne
}

ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
- "http2 PING frame, flags: %ud", h2c->state.flags);
+ "http2 PING frame ack:%ud",
+ h2c->state.flags & NGX_HTTP_V2_ACK_FLAG ? 1 : 0);

if (h2c->state.flags & NGX_HTTP_V2_ACK_FLAG) {
return ngx_http_v2_state_skip(h2c, pos, end);
}

+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
+ "http2 send PING frame ack:1");
+
frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_PING_SIZE,
NGX_HTTP_V2_PING_FRAME,
NGX_HTTP_V2_ACK_FLAG, 0);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] HTTP/2: add debug logging of pseudo-headers and control frames

Piotr Sikora via nginx-devel 697 March 26, 2017 04:46AM

Re: [PATCH] HTTP/2: add debug logging of pseudo-headers and control frames

Piotr Sikora via nginx-devel 299 April 03, 2017 11:16PM



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

Online Users

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