Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed logging with variable field width.

Sergey Kandaurov
March 30, 2016 08:16PM
details: http://hg.nginx.org/nginx/rev/3ef7bb882ad4
branches:
changeset: 6478:3ef7bb882ad4
user: Sergey Kandaurov <pluknet@nginx.com>
date: Thu Mar 31 02:33:53 2016 +0300
description:
Fixed logging with variable field width.

diffstat:

src/core/ngx_resolver.c | 2 +-
src/http/modules/ngx_http_mp4_module.c | 4 ++--
src/http/modules/ngx_http_ssl_module.c | 5 +++--
src/http/ngx_http_core_module.c | 3 ++-
src/http/ngx_http_file_cache.c | 2 +-
src/http/ngx_http_variables.c | 5 ++---
6 files changed, 11 insertions(+), 10 deletions(-)

diffs (95 lines):

diff -r 47daf95d0138 -r 3ef7bb882ad4 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Thu Mar 31 02:33:50 2016 +0300
+++ b/src/core/ngx_resolver.c Thu Mar 31 02:33:53 2016 +0300
@@ -1873,7 +1873,7 @@ dns_error_name:
ngx_log_error(r->log_level, r->log, 0,
"DNS error (%ui: %s), query id:%ui, name:\"%*s\"",
code, ngx_resolver_strerror(code), ident,
- rn->nlen, rn->name);
+ (size_t) rn->nlen, rn->name);
return;

dns_error:
diff -r 47daf95d0138 -r 3ef7bb882ad4 src/http/modules/ngx_http_mp4_module.c
--- a/src/http/modules/ngx_http_mp4_module.c Thu Mar 31 02:33:50 2016 +0300
+++ b/src/http/modules/ngx_http_mp4_module.c Thu Mar 31 02:33:53 2016 +0300
@@ -913,7 +913,7 @@ ngx_http_mp4_read_atom(ngx_http_mp4_file

ngx_log_debug4(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
"mp4 atom: %*s @%O:%uL",
- 4, atom_name, mp4->offset, atom_size);
+ (size_t) 4, atom_name, mp4->offset, atom_size);

if (atom_size > (uint64_t) (NGX_MAX_OFF_T_VALUE - mp4->offset)
|| mp4->offset + (off_t) atom_size > end)
@@ -1958,7 +1958,7 @@ ngx_http_mp4_read_stsd_atom(ngx_http_mp4
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
"stsd entries:%uD, media:%*s",
ngx_mp4_get_32value(stsd_atom->entries),
- 4, stsd_atom->media_name);
+ (size_t) 4, stsd_atom->media_name);

trak = ngx_mp4_last_trak(mp4);

diff -r 47daf95d0138 -r 3ef7bb882ad4 src/http/modules/ngx_http_ssl_module.c
--- a/src/http/modules/ngx_http_ssl_module.c Thu Mar 31 02:33:50 2016 +0300
+++ b/src/http/modules/ngx_http_ssl_module.c Thu Mar 31 02:33:53 2016 +0300
@@ -338,7 +338,8 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t
#if (NGX_DEBUG)
for (i = 0; i < inlen; i += in[i] + 1) {
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "SSL ALPN supported by client: %*s", in[i], &in[i + 1]);
+ "SSL ALPN supported by client: %*s",
+ (size_t) in[i], &in[i + 1]);
}
#endif

@@ -365,7 +366,7 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t
}

ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "SSL ALPN selected: %*s", *outlen, *out);
+ "SSL ALPN selected: %*s", (size_t) *outlen, *out);

return SSL_TLSEXT_ERR_OK;
}
diff -r 47daf95d0138 -r 3ef7bb882ad4 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c Thu Mar 31 02:33:50 2016 +0300
+++ b/src/http/ngx_http_core_module.c Thu Mar 31 02:33:53 2016 +0300
@@ -1597,7 +1597,8 @@ ngx_http_core_find_static_location(ngx_h
}

ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "test location: \"%*s\"", node->len, node->name);
+ "test location: \"%*s\"",
+ (size_t) node->len, node->name);

n = (len <= (size_t) node->len) ? len : node->len;

diff -r 47daf95d0138 -r 3ef7bb882ad4 src/http/ngx_http_file_cache.c
--- a/src/http/ngx_http_file_cache.c Thu Mar 31 02:33:50 2016 +0300
+++ b/src/http/ngx_http_file_cache.c Thu Mar 31 02:33:53 2016 +0300
@@ -1834,7 +1834,7 @@ ngx_http_file_cache_expire(ngx_http_file

ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
"ignore long locked inactive cache entry %*s, count:%d",
- 2 * NGX_HTTP_CACHE_KEY_LEN, key, fcn->count);
+ (size_t) 2 * NGX_HTTP_CACHE_KEY_LEN, key, fcn->count);
}

ngx_shmtx_unlock(&cache->shpool->mutex);
diff -r 47daf95d0138 -r 3ef7bb882ad4 src/http/ngx_http_variables.c
--- a/src/http/ngx_http_variables.c Thu Mar 31 02:33:50 2016 +0300
+++ b/src/http/ngx_http_variables.c Thu Mar 31 02:33:53 2016 +0300
@@ -2428,9 +2428,8 @@ ngx_http_regex_exec(ngx_http_request_t *

v = cmcf->variables.elts;

- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http regex set $%V to \"%*s\"",
- &v[index].name, vv->len, vv->data);
+ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "http regex set $%V to \"%v\"", &v[index].name, vv);
}
#endif
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed logging with variable field width.

Sergey Kandaurov 272 March 30, 2016 08:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready