Mercurial > hg > nginx
comparison src/http/v2/ngx_http_v2.c @ 6448:4d1d3c2530e0
HTTP/2: improved debugging of sending control frames.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 21 Mar 2016 17:04:21 +0300 |
parents | 4ba91a4c66a3 |
children | f01ab2dbcfdc |
comparison
equal
deleted
inserted
replaced
6447:d17f0584006f | 6448:4d1d3c2530e0 |
---|---|
2501 ngx_buf_t *buf; | 2501 ngx_buf_t *buf; |
2502 ngx_chain_t *cl; | 2502 ngx_chain_t *cl; |
2503 ngx_http_v2_srv_conf_t *h2scf; | 2503 ngx_http_v2_srv_conf_t *h2scf; |
2504 ngx_http_v2_out_frame_t *frame; | 2504 ngx_http_v2_out_frame_t *frame; |
2505 | 2505 |
2506 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, | 2506 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, |
2507 "http2 send SETTINGS frame"); | 2507 "http2 send SETTINGS frame ack:%ui", ack); |
2508 | 2508 |
2509 frame = ngx_palloc(h2c->pool, sizeof(ngx_http_v2_out_frame_t)); | 2509 frame = ngx_palloc(h2c->pool, sizeof(ngx_http_v2_out_frame_t)); |
2510 if (frame == NULL) { | 2510 if (frame == NULL) { |
2511 return NGX_ERROR; | 2511 return NGX_ERROR; |
2512 } | 2512 } |
2593 size_t window) | 2593 size_t window) |
2594 { | 2594 { |
2595 ngx_buf_t *buf; | 2595 ngx_buf_t *buf; |
2596 ngx_http_v2_out_frame_t *frame; | 2596 ngx_http_v2_out_frame_t *frame; |
2597 | 2597 |
2598 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, | |
2599 "http2 send WINDOW_UPDATE frame sid:%ui, window:%uz", | |
2600 sid, window); | |
2601 | |
2598 frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_WINDOW_UPDATE_SIZE, | 2602 frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_WINDOW_UPDATE_SIZE, |
2599 NGX_HTTP_V2_WINDOW_UPDATE_FRAME, | 2603 NGX_HTTP_V2_WINDOW_UPDATE_FRAME, |
2600 NGX_HTTP_V2_NO_FLAG, sid); | 2604 NGX_HTTP_V2_NO_FLAG, sid); |
2601 if (frame == NULL) { | 2605 if (frame == NULL) { |
2602 return NGX_ERROR; | 2606 return NGX_ERROR; |
2617 ngx_uint_t status) | 2621 ngx_uint_t status) |
2618 { | 2622 { |
2619 ngx_buf_t *buf; | 2623 ngx_buf_t *buf; |
2620 ngx_http_v2_out_frame_t *frame; | 2624 ngx_http_v2_out_frame_t *frame; |
2621 | 2625 |
2626 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, | |
2627 "http2 send RST_STREAM frame sid:%ui, status:%uz", | |
2628 sid, status); | |
2629 | |
2622 frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_RST_STREAM_SIZE, | 2630 frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_RST_STREAM_SIZE, |
2623 NGX_HTTP_V2_RST_STREAM_FRAME, | 2631 NGX_HTTP_V2_RST_STREAM_FRAME, |
2624 NGX_HTTP_V2_NO_FLAG, sid); | 2632 NGX_HTTP_V2_NO_FLAG, sid); |
2625 if (frame == NULL) { | 2633 if (frame == NULL) { |
2626 return NGX_ERROR; | 2634 return NGX_ERROR; |
2639 static ngx_int_t | 2647 static ngx_int_t |
2640 ngx_http_v2_send_goaway(ngx_http_v2_connection_t *h2c, ngx_uint_t status) | 2648 ngx_http_v2_send_goaway(ngx_http_v2_connection_t *h2c, ngx_uint_t status) |
2641 { | 2649 { |
2642 ngx_buf_t *buf; | 2650 ngx_buf_t *buf; |
2643 ngx_http_v2_out_frame_t *frame; | 2651 ngx_http_v2_out_frame_t *frame; |
2652 | |
2653 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, | |
2654 "http2 send GOAWAY frame, status:%uz", status); | |
2644 | 2655 |
2645 frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_GOAWAY_SIZE, | 2656 frame = ngx_http_v2_get_frame(h2c, NGX_HTTP_V2_GOAWAY_SIZE, |
2646 NGX_HTTP_V2_GOAWAY_FRAME, | 2657 NGX_HTTP_V2_GOAWAY_FRAME, |
2647 NGX_HTTP_V2_NO_FLAG, 0); | 2658 NGX_HTTP_V2_NO_FLAG, 0); |
2648 if (frame == NULL) { | 2659 if (frame == NULL) { |