changeset 8608:4a05f0f3dfce quic

QUIC: added "rx" and "tx" prefixes to packet debug.
author Vladimir Homutov <vl@nginx.com>
date Mon, 26 Oct 2020 23:47:16 +0300
parents 21b7dac9de3b
children f32740ddd484
files src/event/ngx_event_quic.c src/event/ngx_event_quic_protection.c src/event/ngx_event_quic_transport.c
diffstat 3 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -1921,7 +1921,7 @@ ngx_quic_input(ngx_connection_t *c, ngx_
 #if (NGX_DEBUG)
         if (pkt.parsed) {
             ngx_log_debug5(NGX_LOG_DEBUG_EVENT, c->log, 0,
-                           "quic %s pkt done decr:%d pn:%L perr:%ui rc:%i",
+                           "quic pkt %s done decr:%d pn:%L perr:%ui rc:%i",
                            ngx_quic_level_name(pkt.level), pkt.decrypted,
                            pkt.pn, pkt.error, rc);
         } else {
@@ -1999,10 +1999,10 @@ ngx_quic_process_packet(ngx_connection_t
     qc = c->quic;
 
 #if (NGX_DEBUG)
-    ngx_quic_hexdump(c->log, "quic pkt dcid", pkt->dcid.data, pkt->dcid.len);
+    ngx_quic_hexdump(c->log, "quic pkt rx dcid", pkt->dcid.data, pkt->dcid.len);
 
     if (pkt->level != ssl_encryption_application) {
-        ngx_quic_hexdump(c->log, "quic pkt scid", pkt->scid.data,
+        ngx_quic_hexdump(c->log, "quic pkt rx scid", pkt->scid.data,
                          pkt->scid.len);
     }
 #endif
@@ -4551,10 +4551,10 @@ ngx_quic_send_frames(ngx_connection_t *c
     res.data = dst;
 
     ngx_log_debug6(NGX_LOG_DEBUG_EVENT, c->log, 0,
-                   "quic packet ready bytes:%ui level:%d"
+                   "quic pkt tx %s bytes:%ui"
                    " need_ack:%d number:%L encoded nl:%d trunc:0x%xD",
-                   out.len, start->level, pkt.need_ack, pkt.number,
-                   pkt.num_len, pkt.trunc);
+                   ngx_quic_level_name(start->level), out.len, pkt.need_ack,
+                   pkt.number, pkt.num_len, pkt.trunc);
 
     if (ngx_quic_encrypt(&pkt, ssl_conn, &res) != NGX_OK) {
         ngx_quic_free_frames(c, frames);
--- a/src/event/ngx_event_quic_protection.c
+++ b/src/event/ngx_event_quic_protection.c
@@ -1113,9 +1113,9 @@ ngx_quic_decrypt(ngx_quic_header_t *pkt,
     pkt->flags = clearflags;
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic clearflags:%xd", clearflags);
+                   "quic pkt rx clearflags:%xd", clearflags);
     ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic packet number:%uL len:%xi", pn, pnl);
+                   "quic pkt rx number:%uL len:%xi", pn, pnl);
 
     /* packet protection */
 
--- a/src/event/ngx_event_quic_transport.c
+++ b/src/event/ngx_event_quic_transport.c
@@ -326,7 +326,7 @@ ngx_quic_parse_long_header(ngx_quic_head
     }
 
     ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic long packet flags:%xd version:%xD",
+                   "quic pkt rx long flags:%xd version:%xD",
                    pkt->flags, pkt->version);
 
     if (!(pkt->flags & NGX_QUIC_PKT_FIXED_BIT)) {
@@ -540,7 +540,7 @@ ngx_quic_parse_short_header(ngx_quic_hea
     end = pkt->data + pkt->len;
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic short packet flags:%xd", pkt->flags);
+                   "quic pkt rx short flags:%xd", pkt->flags);
 
     if (!(pkt->flags & NGX_QUIC_PKT_FIXED_BIT)) {
         ngx_log_error(NGX_LOG_INFO, pkt->log, 0, "quic fixed bit is not set");
@@ -597,7 +597,7 @@ ngx_quic_parse_initial_header(ngx_quic_h
     }
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic initial packet len:%uL", varint);
+                   "quic pkt rx initial len:%uL", varint);
 
     if (varint > (uint64_t) ((pkt->data + pkt->len) - p)) {
         ngx_log_error(NGX_LOG_INFO, pkt->log, 0,
@@ -636,7 +636,7 @@ ngx_quic_parse_handshake_header(ngx_quic
     }
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic handshake packet len:%uL", plen);
+                   "quic pkt rx handshake len:%uL", plen);
 
     if (plen > (uint64_t)((pkt->data + pkt->len) - p)) {
         ngx_log_error(NGX_LOG_INFO, pkt->log, 0,