Mercurial > hg > nginx
comparison src/http/modules/ngx_http_status_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 | 63a820b0bc6c |
children |
comparison
equal
deleted
inserted
replaced
2196:fab3fa7339ff | 2197:74477ea8074f |
---|---|
153 | 153 |
154 /* STUB: should be NGX_PID_T_LEN */ | 154 /* STUB: should be NGX_PID_T_LEN */ |
155 len = NGX_INT64_LEN /* pid */ | 155 len = NGX_INT64_LEN /* pid */ |
156 + 1 + NGX_INT32_LEN /* connection */ | 156 + 1 + NGX_INT32_LEN /* connection */ |
157 + 1 + 1 /* state */ | 157 + 1 + 1 /* state */ |
158 + 1 + INET_ADDRSTRLEN | 158 + 1 + NGX_INET_ADDRSTRLEN |
159 + 1 + (r->server_name ? cmcf->max_server_name_len : 1) | 159 + 1 + (r->server_name ? cmcf->max_server_name_len : 1) |
160 + 2; /* "\r\n" */ | 160 + 2; /* "\r\n" */ |
161 | 161 |
162 /* BUG: cmcf->max_server_name_len and "*.domain.tld" */ | 162 /* BUG: cmcf->max_server_name_len and "*.domain.tld" */ |
163 | 163 |
202 *(b->last++) = ch; | 202 *(b->last++) = ch; |
203 | 203 |
204 *(b->last++) = ' '; | 204 *(b->last++) = ' '; |
205 b->last = ngx_cpymem(b->last, c[i].addr_text.data, | 205 b->last = ngx_cpymem(b->last, c[i].addr_text.data, |
206 c[i].addr_text.len); | 206 c[i].addr_text.len); |
207 for (n = c[i].addr_text.len; n < INET_ADDRSTRLEN; n++) { | 207 for (n = c[i].addr_text.len; n < NGX_INET_ADDRSTRLEN; n++) { |
208 *(b->last++) = ' '; | 208 *(b->last++) = ' '; |
209 } | 209 } |
210 | 210 |
211 *(b->last++) = ' '; | 211 *(b->last++) = ' '; |
212 if (r->server_name) { | 212 if (r->server_name) { |