diff 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
line wrap: on
line diff
--- a/src/event/ngx_event_accept.c
+++ b/src/event/ngx_event_accept.c
@@ -198,9 +198,6 @@ ngx_event_accept(ngx_event_t *ev)
         wev->own_lock = &c->lock;
 #endif
 
-        ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0,
-                       "accept: fd:%d c:%d", s, c->number);
-
         if (ls->addr_ntop) {
             c->addr_text.data = ngx_palloc(c->pool, ls->addr_text_max_len);
             if (c->addr_text.data == NULL) {
@@ -220,14 +217,14 @@ ngx_event_accept(ngx_event_t *ev)
 #if (NGX_DEBUG)
         {
 
-        uint32_t            *addr;
         in_addr_t            i;
+        ngx_event_debug_t   *dc;
         struct sockaddr_in  *sin;
 
         sin = (struct sockaddr_in *) sa;
-        addr = ecf->debug_connection.elts;
+        dc = ecf->debug_connection.elts;
         for (i = 0; i < ecf->debug_connection.nelts; i++) {
-            if (addr[i] == sin->sin_addr.s_addr) {
+            if ((sin->sin_addr.s_addr & dc[i].mask) == dc[i].addr) {
                 log->log_level = NGX_LOG_DEBUG_CONNECTION|NGX_LOG_DEBUG_ALL;
                 break;
             }
@@ -236,6 +233,9 @@ ngx_event_accept(ngx_event_t *ev)
         }
 #endif
 
+        ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
+                       "*%d accept: %V fd:%d", c->number, &c->addr_text, s);
+
         if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
             if (ngx_add_conn(c) == NGX_ERROR) {
                 ngx_close_accepted_connection(c);