summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_core_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/ngx_http_core_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/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 8a5e9d261..30b2c0c50 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1626,7 +1626,7 @@ ngx_http_server_addr(ngx_http_request_t *r, ngx_str_t *s)
}
s->len = ngx_inet_ntop(c->listening->family, &r->in_addr,
- s->data, INET_ADDRSTRLEN);
+ s->data, NGX_INET_ADDRSTRLEN);
return NGX_OK;
}
@@ -2971,7 +2971,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ls->conf.rcvbuf = -1;
ls->conf.sndbuf = -1;
- n = ngx_inet_ntop(AF_INET, &ls->addr, ls->conf.addr, INET_ADDRSTRLEN + 6);
+ n = ngx_inet_ntop(AF_INET, &ls->addr, ls->conf.addr, NGX_INET_ADDRSTRLEN);
ngx_sprintf(&ls->conf.addr[n], ":%ui", ls->port);
if (cf->args->nelts == 2) {