diff src/event/ngx_event_quic.h @ 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 eee307399229
line wrap: on
line diff
--- a/src/event/ngx_event_quic.h
+++ b/src/event/ngx_event_quic.h
@@ -87,31 +87,25 @@ ngx_connection_t *ngx_quic_create_uni_st
 //#define NGX_QUIC_DEBUG_FRAMES_ALLOC  /* log frames alloc/reuse/free */
 //#define NGX_QUIC_DEBUG_CRYPTO
 
-
 #if (NGX_DEBUG)
 
-#define ngx_quic_hexdump(log, fmt, data, len, ...)                            \
+#define ngx_quic_hexdump(log, label, data, len)                               \
 do {                                                                          \
     ngx_int_t  m;                                                             \
     u_char     buf[2048];                                                     \
                                                                               \
     if (log->log_level & NGX_LOG_DEBUG_EVENT) {                               \
         m = ngx_hex_dump(buf, (u_char *) data, ngx_min(len, 1024)) - buf;     \
-        ngx_log_debug(NGX_LOG_DEBUG_EVENT, log, 0,                            \
-                   "%s: " fmt " %*s%s, len: %uz",                             \
-                   __FUNCTION__,  __VA_ARGS__, m, buf,                        \
-                   len < 2048 ? "" : "...", len);                             \
+        ngx_log_debug4(NGX_LOG_DEBUG_EVENT, log, 0,                           \
+                      label " len:%uz data:%*s%s",                            \
+                      len, m, buf, len < 2048 ? "" : "...");                  \
     }                                                                         \
 } while (0)
 
 #else
 
-#define ngx_quic_hexdump(log, fmt, data, len, ...)
+#define ngx_quic_hexdump(log, fmt, data, len)
 
 #endif
 
-#define ngx_quic_hexdump0(log, fmt, data, len)                                \
-    ngx_quic_hexdump(log, fmt "%s", data, len, "")                            \
-
-
 #endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */