Mercurial > hg > nginx
comparison src/event/ngx_event_quic_transport.c @ 8360:f175006124d0 quic
Cleaned up hexdumps in debug output.
- the ngx_quic_hexdump0() macro is renamed to ngx_quic_hexdump();
the original ngx_quic_hexdump() macro with variable argument is
removed, extra information is logged normally, with ngx_log_debug()
- all labels in hex dumps are prefixed with "quic"
- the hexdump format is simplified, length is moved forward to avoid
situations when the dump is truncated, and length is not shown
- ngx_quic_flush_flight() function contents is debug-only, placed under
NGX_DEBUG macro to avoid "unused variable" warnings from compiler
- frame names in labels are capitalized, similar to other places
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Fri, 24 Apr 2020 11:33:00 +0300 |
parents | 2f900ae486bc |
children | 336d527ca031 |
comparison
equal
deleted
inserted
replaced
8359:2f900ae486bc | 8360:f175006124d0 |
---|---|
233 | 233 |
234 p = pkt->data; | 234 p = pkt->data; |
235 end = pkt->data + pkt->len; | 235 end = pkt->data + pkt->len; |
236 | 236 |
237 #ifdef NGX_QUIC_DEBUG_PACKETS | 237 #ifdef NGX_QUIC_DEBUG_PACKETS |
238 ngx_quic_hexdump0(pkt->log, "long input", pkt->data, pkt->len); | 238 ngx_quic_hexdump(pkt->log, "quic long packet in", pkt->data, pkt->len); |
239 #endif | 239 #endif |
240 | 240 |
241 p = ngx_quic_read_uint8(p, end, &pkt->flags); | 241 p = ngx_quic_read_uint8(p, end, &pkt->flags); |
242 if (p == NULL) { | 242 if (p == NULL) { |
243 ngx_log_error(NGX_LOG_INFO, pkt->log, 0, | 243 ngx_log_error(NGX_LOG_INFO, pkt->log, 0, |
390 | 390 |
391 p = pkt->data; | 391 p = pkt->data; |
392 end = pkt->data + pkt->len; | 392 end = pkt->data + pkt->len; |
393 | 393 |
394 #ifdef NGX_QUIC_DEBUG_PACKETS | 394 #ifdef NGX_QUIC_DEBUG_PACKETS |
395 ngx_quic_hexdump0(pkt->log, "short input", pkt->data, pkt->len); | 395 ngx_quic_hexdump(pkt->log, "quic short packet in", pkt->data, pkt->len); |
396 #endif | 396 #endif |
397 | 397 |
398 p = ngx_quic_read_uint8(p, end, &pkt->flags); | 398 p = ngx_quic_read_uint8(p, end, &pkt->flags); |
399 if (p == NULL) { | 399 if (p == NULL) { |
400 ngx_log_error(NGX_LOG_INFO, pkt->log, 0, | 400 ngx_log_error(NGX_LOG_INFO, pkt->log, 0, |
474 | 474 |
475 pkt->raw->pos = p; | 475 pkt->raw->pos = p; |
476 pkt->len = varint; | 476 pkt->len = varint; |
477 | 477 |
478 #ifdef NGX_QUIC_DEBUG_PACKETS | 478 #ifdef NGX_QUIC_DEBUG_PACKETS |
479 ngx_quic_hexdump0(pkt->log, "DCID", pkt->dcid.data, pkt->dcid.len); | 479 ngx_quic_hexdump(pkt->log, "quic DCID", pkt->dcid.data, pkt->dcid.len); |
480 ngx_quic_hexdump0(pkt->log, "SCID", pkt->scid.data, pkt->scid.len); | 480 ngx_quic_hexdump(pkt->log, "quic SCID", pkt->scid.data, pkt->scid.len); |
481 ngx_quic_hexdump0(pkt->log, "token", pkt->token.data, pkt->token.len); | 481 ngx_quic_hexdump(pkt->log, "quic token", pkt->token.data, pkt->token.len); |
482 #endif | 482 #endif |
483 | 483 |
484 return NGX_OK; | 484 return NGX_OK; |
485 } | 485 } |
486 | 486 |
575 "quic frame in: CRYPTO length: %uL off:%uL pp:%p", | 575 "quic frame in: CRYPTO length: %uL off:%uL pp:%p", |
576 f->u.crypto.length, f->u.crypto.offset, | 576 f->u.crypto.length, f->u.crypto.offset, |
577 f->u.crypto.data); | 577 f->u.crypto.data); |
578 | 578 |
579 #ifdef NGX_QUIC_DEBUG_FRAMES | 579 #ifdef NGX_QUIC_DEBUG_FRAMES |
580 ngx_quic_hexdump0(pkt->log, "CRYPTO frame contents", | 580 ngx_quic_hexdump(pkt->log, "quic CRYPTO frame", |
581 f->u.crypto.data, f->u.crypto.length); | 581 f->u.crypto.data, f->u.crypto.length); |
582 #endif | 582 #endif |
583 break; | 583 break; |
584 | 584 |
585 case NGX_QUIC_FT_PADDING: | 585 case NGX_QUIC_FT_PADDING: |
586 | 586 |
835 f->type, f->u.stream.stream_id, f->u.stream.offset, | 835 f->type, f->u.stream.stream_id, f->u.stream.offset, |
836 f->u.stream.length, f->u.stream.off, f->u.stream.len, | 836 f->u.stream.length, f->u.stream.off, f->u.stream.len, |
837 f->u.stream.fin); | 837 f->u.stream.fin); |
838 | 838 |
839 #ifdef NGX_QUIC_DEBUG_FRAMES | 839 #ifdef NGX_QUIC_DEBUG_FRAMES |
840 ngx_quic_hexdump0(pkt->log, "STREAM frame contents", | 840 ngx_quic_hexdump(pkt->log, "quic STREAM frame", |
841 f->u.stream.data, f->u.stream.length); | 841 f->u.stream.data, f->u.stream.length); |
842 #endif | 842 #endif |
843 break; | 843 break; |
844 | 844 |
845 case NGX_QUIC_FT_MAX_DATA: | 845 case NGX_QUIC_FT_MAX_DATA: |
846 | 846 |
1078 | 1078 |
1079 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pkt->log, 0, | 1079 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pkt->log, 0, |
1080 "quic frame in: PATH_CHALLENGE"); | 1080 "quic frame in: PATH_CHALLENGE"); |
1081 | 1081 |
1082 #ifdef NGX_QUIC_DEBUG_FRAMES | 1082 #ifdef NGX_QUIC_DEBUG_FRAMES |
1083 ngx_quic_hexdump0(pkt->log, "path challenge data", | 1083 ngx_quic_hexdump(pkt->log, "quic PATH_CHALLENGE frame data", |
1084 f->u.path_challenge.data, 8); | 1084 f->u.path_challenge.data, 8); |
1085 #endif | 1085 #endif |
1086 break; | 1086 break; |
1087 | 1087 |
1088 case NGX_QUIC_FT_PATH_RESPONSE: | 1088 case NGX_QUIC_FT_PATH_RESPONSE: |
1089 | 1089 |
1100 | 1100 |
1101 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pkt->log, 0, | 1101 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pkt->log, 0, |
1102 "quic frame in: PATH_RESPONSE"); | 1102 "quic frame in: PATH_RESPONSE"); |
1103 | 1103 |
1104 #ifdef NGX_QUIC_DEBUG_FRAMES | 1104 #ifdef NGX_QUIC_DEBUG_FRAMES |
1105 ngx_quic_hexdump0(pkt->log, "path response data", | 1105 ngx_quic_hexdump(pkt->log, "quic PATH_RESPONSE frame data", |
1106 f->u.path_response.data, 8); | 1106 f->u.path_response.data, 8); |
1107 #endif | 1107 #endif |
1108 break; | 1108 break; |
1109 | 1109 |
1110 default: | 1110 default: |
1111 ngx_log_error(NGX_LOG_INFO, pkt->log, 0, | 1111 ngx_log_error(NGX_LOG_INFO, pkt->log, 0, |