Mercurial > hg > nginx
comparison src/event/ngx_event_quic.h @ 8651:dbad2d6d1898 quic
QUIC: removed ngx_quic_hexdump() macro.
Instead, appropriate format specifier for hexadecimal is used
in ngx_log_debug().
The STREAM frame "data" debug is moved into ngx_quic_log_frame(), similar
to all other frame fields debug.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Fri, 27 Nov 2020 18:43:36 +0300 |
parents | 831d1960826f |
children | 2dfc5ef29973 |
comparison
equal
deleted
inserted
replaced
8650:9dce2978e4fd | 8651:dbad2d6d1898 |
---|---|
136 /* #define NGX_QUIC_DEBUG_PACKETS */ /* dump packet contents */ | 136 /* #define NGX_QUIC_DEBUG_PACKETS */ /* dump packet contents */ |
137 /* #define NGX_QUIC_DEBUG_FRAMES */ /* dump frames contents */ | 137 /* #define NGX_QUIC_DEBUG_FRAMES */ /* dump frames contents */ |
138 /* #define NGX_QUIC_DEBUG_FRAMES_ALLOC */ /* log frames alloc/reuse/free */ | 138 /* #define NGX_QUIC_DEBUG_FRAMES_ALLOC */ /* log frames alloc/reuse/free */ |
139 /* #define NGX_QUIC_DEBUG_CRYPTO */ | 139 /* #define NGX_QUIC_DEBUG_CRYPTO */ |
140 | 140 |
141 #if (NGX_DEBUG) | |
142 | |
143 #define ngx_quic_hexdump(log, fmt, data, len) \ | |
144 ngx_quic_hexdump_real(log, fmt, (u_char *) data, (size_t) len) | |
145 | |
146 static ngx_inline | |
147 void ngx_quic_hexdump_real(ngx_log_t *log, const char *label, u_char *data, | |
148 size_t len) | |
149 { | |
150 ngx_int_t m; | |
151 u_char buf[2048]; | |
152 | |
153 if (log->log_level & NGX_LOG_DEBUG_EVENT) { | |
154 m = ngx_hex_dump(buf, data, (len > 1024) ? 1024 : len) - buf; | |
155 ngx_log_debug5(NGX_LOG_DEBUG_EVENT, log, 0, | |
156 "%s len:%uz data:%*s%s", | |
157 label, len, m, buf, len < 2048 ? "" : "..."); | |
158 } | |
159 } | |
160 | |
161 #else | |
162 | |
163 #define ngx_quic_hexdump(log, fmt, data, len) | |
164 | |
165 #endif | |
166 | |
167 #endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */ | 141 #endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */ |