mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 06:46:16 +08:00
QUIC: inline function instead of macro for hexdump.
This prevents name clashes with local variables.
This commit is contained in:
parent
a06a3f6aba
commit
b99a4a0b82
@ -130,18 +130,20 @@ void ngx_quic_finalize_connection(ngx_connection_t *c, ngx_uint_t err,
|
|||||||
|
|
||||||
#if (NGX_DEBUG)
|
#if (NGX_DEBUG)
|
||||||
|
|
||||||
#define ngx_quic_hexdump(log, label, data, len) \
|
static ngx_inline
|
||||||
do { \
|
void ngx_quic_hexdump(ngx_log_t *log, const char *label, u_char *data,
|
||||||
ngx_int_t m; \
|
size_t len)
|
||||||
u_char buf[2048]; \
|
{
|
||||||
\
|
ngx_int_t m;
|
||||||
if (log->log_level & NGX_LOG_DEBUG_EVENT) { \
|
u_char buf[2048];
|
||||||
m = ngx_hex_dump(buf, (u_char *) data, ngx_min(len, 1024)) - buf; \
|
|
||||||
ngx_log_debug4(NGX_LOG_DEBUG_EVENT, log, 0, \
|
if (log->log_level & NGX_LOG_DEBUG_EVENT) {
|
||||||
label " len:%uz data:%*s%s", \
|
m = ngx_hex_dump(buf, data, (len > 1024) ? 1024 : len) - buf;
|
||||||
len, m, buf, len < 2048 ? "" : "..."); \
|
ngx_log_debug5(NGX_LOG_DEBUG_EVENT, log, 0,
|
||||||
} \
|
"%s len:%uz data:%*s%s",
|
||||||
} while (0)
|
label, len, m, buf, len < 2048 ? "" : "...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user