Mercurial > hg > nginx-quic
comparison src/event/ngx_event_quic.h @ 8129:6dac06dfe779 quic
QUIC: inline function instead of macro for hexdump.
This prevents name clashes with local variables.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Mon, 05 Oct 2020 10:03:01 +0300 |
parents | bed310672f39 |
children | a0631204d88a |
comparison
equal
deleted
inserted
replaced
8128:a6784cf32c13 | 8129:6dac06dfe779 |
---|---|
128 /* #define NGX_QUIC_DEBUG_FRAMES_ALLOC */ /* log frames alloc/reuse/free */ | 128 /* #define NGX_QUIC_DEBUG_FRAMES_ALLOC */ /* log frames alloc/reuse/free */ |
129 /* #define NGX_QUIC_DEBUG_CRYPTO */ | 129 /* #define NGX_QUIC_DEBUG_CRYPTO */ |
130 | 130 |
131 #if (NGX_DEBUG) | 131 #if (NGX_DEBUG) |
132 | 132 |
133 #define ngx_quic_hexdump(log, label, data, len) \ | 133 static ngx_inline |
134 do { \ | 134 void ngx_quic_hexdump(ngx_log_t *log, const char *label, u_char *data, |
135 ngx_int_t m; \ | 135 size_t len) |
136 u_char buf[2048]; \ | 136 { |
137 \ | 137 ngx_int_t m; |
138 if (log->log_level & NGX_LOG_DEBUG_EVENT) { \ | 138 u_char buf[2048]; |
139 m = ngx_hex_dump(buf, (u_char *) data, ngx_min(len, 1024)) - buf; \ | 139 |
140 ngx_log_debug4(NGX_LOG_DEBUG_EVENT, log, 0, \ | 140 if (log->log_level & NGX_LOG_DEBUG_EVENT) { |
141 label " len:%uz data:%*s%s", \ | 141 m = ngx_hex_dump(buf, data, (len > 1024) ? 1024 : len) - buf; |
142 len, m, buf, len < 2048 ? "" : "..."); \ | 142 ngx_log_debug5(NGX_LOG_DEBUG_EVENT, log, 0, |
143 } \ | 143 "%s len:%uz data:%*s%s", |
144 } while (0) | 144 label, len, m, buf, len < 2048 ? "" : "..."); |
145 } | |
146 } | |
145 | 147 |
146 #else | 148 #else |
147 | 149 |
148 #define ngx_quic_hexdump(log, fmt, data, len) | 150 #define ngx_quic_hexdump(log, fmt, data, len) |
149 | 151 |