summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_status_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-08-21 18:47:23 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-08-21 18:47:23 +0000
commit6a75019ad6847a5bf8c0dcd1f0ad87ed715add7e (patch)
treef7feb9bb2be60866bf079e19c0736dc0d3f160f3 /src/http/modules/ngx_http_status_module.c
parentbbe42c41e8f883185745706f92426aa9e73b3eab (diff)
downloadnginx-6a75019ad6847a5bf8c0dcd1f0ad87ed715add7e.tar.gz
nginx-6a75019ad6847a5bf8c0dcd1f0ad87ed715add7e.tar.bz2
*) remove zero termination in ngx_inet_ntop() and ngx_sock_ntop()
*) use ngx_snprintf() in ngx_inet_ntop() and ngx_sock_ntop() as they are called just once per connection *) NGX_INET_ADDRSTRLEN
Diffstat (limited to 'src/http/modules/ngx_http_status_module.c')
-rw-r--r--src/http/modules/ngx_http_status_module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_status_module.c b/src/http/modules/ngx_http_status_module.c
index a2e2dbc07..000d9a8e4 100644
--- a/src/http/modules/ngx_http_status_module.c
+++ b/src/http/modules/ngx_http_status_module.c
@@ -155,7 +155,7 @@ static ngx_int_t ngx_http_status(ngx_http_status_ctx_t *ctx)
len = NGX_INT64_LEN /* pid */
+ 1 + NGX_INT32_LEN /* connection */
+ 1 + 1 /* state */
- + 1 + INET_ADDRSTRLEN
+ + 1 + NGX_INET_ADDRSTRLEN
+ 1 + (r->server_name ? cmcf->max_server_name_len : 1)
+ 2; /* "\r\n" */
@@ -204,7 +204,7 @@ static ngx_int_t ngx_http_status(ngx_http_status_ctx_t *ctx)
*(b->last++) = ' ';
b->last = ngx_cpymem(b->last, c[i].addr_text.data,
c[i].addr_text.len);
- for (n = c[i].addr_text.len; n < INET_ADDRSTRLEN; n++) {
+ for (n = c[i].addr_text.len; n < NGX_INET_ADDRSTRLEN; n++) {
*(b->last++) = ' ';
}