summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2020-10-05 10:03:01 +0300
committerVladimir Homutov <vl@nginx.com>2020-10-05 10:03:01 +0300
commitb99a4a0b82e49bd73db430d21a9d3fa6cf18377e (patch)
tree1f050f5b414974e1b7aafafaea83b4bb49ab1f1d
parenta06a3f6aba43525e32cb033e0472d25a15f202a5 (diff)
downloadnginx-b99a4a0b82e49bd73db430d21a9d3fa6cf18377e.tar.gz
nginx-b99a4a0b82e49bd73db430d21a9d3fa6cf18377e.tar.bz2
QUIC: inline function instead of macro for hexdump.
This prevents name clashes with local variables.
-rw-r--r--src/event/ngx_event_quic.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/event/ngx_event_quic.h b/src/event/ngx_event_quic.h
index 2dac905e7..ece86bda7 100644
--- a/src/event/ngx_event_quic.h
+++ b/src/event/ngx_event_quic.h
@@ -130,18 +130,20 @@ void ngx_quic_finalize_connection(ngx_connection_t *c, ngx_uint_t err,
#if (NGX_DEBUG)
-#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_debug4(NGX_LOG_DEBUG_EVENT, log, 0, \
- label " len:%uz data:%*s%s", \
- len, m, buf, len < 2048 ? "" : "..."); \
- } \
-} while (0)
+static ngx_inline
+void ngx_quic_hexdump(ngx_log_t *log, const char *label, u_char *data,
+ size_t len)
+{
+ ngx_int_t m;
+ u_char buf[2048];
+
+ if (log->log_level & NGX_LOG_DEBUG_EVENT) {
+ m = ngx_hex_dump(buf, data, (len > 1024) ? 1024 : len) - buf;
+ ngx_log_debug5(NGX_LOG_DEBUG_EVENT, log, 0,
+ "%s len:%uz data:%*s%s",
+ label, len, m, buf, len < 2048 ? "" : "...");
+ }
+}
#else