comparison src/event/ngx_event_accept.c @ 214:0ad9eeb6ac7f NGINX_0_3_54

nginx 0.3.54 *) Feature: nginx now logs the subrequest information to the error log. *) Feature: the "proxy_next_upstream", "fastcgi_next_upstream", and "memcached_next_upstream" directives support the "off" parameter. *) Feature: the "debug_connection" directive supports the CIDR address form. *) Bugfix: if a response of proxied server or FastCGI server was converted from UTF-8 or back, then it may be transferred incomplete. *) Bugfix: the $upstream_response_time variable had the time of the first request to a backend only. *) Bugfix: nginx could not be built on amd64 platform; bug appeared in 0.3.53.
author Igor Sysoev <http://sysoev.ru>
date Tue, 11 Jul 2006 00:00:00 +0400
parents 3689cd4e3228
children c982febb7588
comparison
equal deleted inserted replaced
213:405beeeadf7f 214:0ad9eeb6ac7f
196 wev->lock = &c->lock; 196 wev->lock = &c->lock;
197 rev->own_lock = &c->lock; 197 rev->own_lock = &c->lock;
198 wev->own_lock = &c->lock; 198 wev->own_lock = &c->lock;
199 #endif 199 #endif
200 200
201 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0,
202 "accept: fd:%d c:%d", s, c->number);
203
204 if (ls->addr_ntop) { 201 if (ls->addr_ntop) {
205 c->addr_text.data = ngx_palloc(c->pool, ls->addr_text_max_len); 202 c->addr_text.data = ngx_palloc(c->pool, ls->addr_text_max_len);
206 if (c->addr_text.data == NULL) { 203 if (c->addr_text.data == NULL) {
207 ngx_close_accepted_connection(c); 204 ngx_close_accepted_connection(c);
208 return; 205 return;
218 } 215 }
219 216
220 #if (NGX_DEBUG) 217 #if (NGX_DEBUG)
221 { 218 {
222 219
223 uint32_t *addr;
224 in_addr_t i; 220 in_addr_t i;
221 ngx_event_debug_t *dc;
225 struct sockaddr_in *sin; 222 struct sockaddr_in *sin;
226 223
227 sin = (struct sockaddr_in *) sa; 224 sin = (struct sockaddr_in *) sa;
228 addr = ecf->debug_connection.elts; 225 dc = ecf->debug_connection.elts;
229 for (i = 0; i < ecf->debug_connection.nelts; i++) { 226 for (i = 0; i < ecf->debug_connection.nelts; i++) {
230 if (addr[i] == sin->sin_addr.s_addr) { 227 if ((sin->sin_addr.s_addr & dc[i].mask) == dc[i].addr) {
231 log->log_level = NGX_LOG_DEBUG_CONNECTION|NGX_LOG_DEBUG_ALL; 228 log->log_level = NGX_LOG_DEBUG_CONNECTION|NGX_LOG_DEBUG_ALL;
232 break; 229 break;
233 } 230 }
234 } 231 }
235 232
236 } 233 }
237 #endif 234 #endif
235
236 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
237 "*%d accept: %V fd:%d", c->number, &c->addr_text, s);
238 238
239 if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) { 239 if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
240 if (ngx_add_conn(c) == NGX_ERROR) { 240 if (ngx_add_conn(c) == NGX_ERROR) {
241 ngx_close_accepted_connection(c); 241 ngx_close_accepted_connection(c);
242 return; 242 return;