[PATCH 3 of 4] HTTP/2: improved debugging of sending control frames

Valentin V. Bartenev vbart at nginx.com
Fri Feb 26 15:45:58 UTC 2016


 src/http/v2/ngx_http_v2.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)


# HG changeset patch
# User Valentin Bartenev <vbart at nginx.com>
# Date 1456500146 -10800
#      Fri Feb 26 18:22:26 2016 +0300
# Node ID 8933cfd2fb603a65f5ed8b49922abc9b03840375
# Parent  edacc9766e8e7f610921f71739e6797f771cf2b6
HTTP/2: improved debugging of sending control frames.

diff -r edacc9766e8e -r 8933cfd2fb60 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c	Fri Feb 26 18:02:02 2016 +0300
+++ b/src/http/v2/ngx_http_v2.c	Fri Feb 26 18:22:26 2016 +0300
@@ -2385,8 +2385,8 @@ ngx_http_v2_send_settings(ngx_http_v2_co
     ngx_http_v2_srv_conf_t   *h2scf;
     ngx_http_v2_out_frame_t  *frame;
 
-    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
-                   "http2 send SETTINGS frame");
+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
+                   "http2 send SETTINGS frame ack:%ui", ack);
 
     frame = ngx_palloc(h2c->pool, sizeof(ngx_http_v2_out_frame_t));
     if (frame == NULL) {
@@ -2477,6 +2477,10 @@ ngx_http_v2_send_window_update(ngx_http_
     ngx_buf_t                *buf;
     ngx_http_v2_out_frame_t  *frame;
 
+    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
+                   "http2 send WINDOW_UPDATE frame sid:%ui, window:%uz",
+                   sid, window);
+
     frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_WINDOW_UPDATE_SIZE,
                                   NGX_HTTP_V2_WINDOW_UPDATE_FRAME,
                                   NGX_HTTP_V2_NO_FLAG, sid);
@@ -2501,6 +2505,10 @@ ngx_http_v2_send_rst_stream(ngx_http_v2_
     ngx_buf_t                *buf;
     ngx_http_v2_out_frame_t  *frame;
 
+    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
+                   "http2 send RST_STREAM frame sid:%ui, status:%uz",
+                   sid, status);
+
     frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_RST_STREAM_SIZE,
                                   NGX_HTTP_V2_RST_STREAM_FRAME,
                                   NGX_HTTP_V2_NO_FLAG, sid);
@@ -2524,6 +2532,9 @@ ngx_http_v2_send_goaway(ngx_http_v2_conn
     ngx_buf_t                *buf;
     ngx_http_v2_out_frame_t  *frame;
 
+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
+                   "http2 send GOAWAY frame, status:%uz", status);
+
     frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_GOAWAY_SIZE,
                                   NGX_HTTP_V2_GOAWAY_FRAME,
                                   NGX_HTTP_V2_NO_FLAG, 0);



More information about the nginx-devel mailing list