Mercurial > hg > nginx
diff src/http/ngx_http_core_module.c @ 2197:74477ea8074f
*) 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
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 21 Aug 2008 18:47:23 +0000 |
parents | a953f73273ee |
children | 5975975eedc0 |
line wrap: on
line diff
--- 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 } 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 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) {