[nginx] svn commit: r4918 - in trunk/src: core os/unix

igor at sysoev.ru igor at sysoev.ru
Tue Nov 20 13:37:56 UTC 2012


Author: is
Date: 2012-11-20 13:37:55 +0000 (Tue, 20 Nov 2012)
New Revision: 4918
URL: http://trac.nginx.org/nginx/changeset/4918/nginx

Log:
Fixed failure to start cache manager and cache loader processes
if there were more than 512 listening sockets in configuration.


Modified:
   trunk/src/core/ngx_connection.c
   trunk/src/os/unix/ngx_process_cycle.c

Modified: trunk/src/core/ngx_connection.c
===================================================================
--- trunk/src/core/ngx_connection.c	2012-11-17 00:36:44 UTC (rev 4917)
+++ trunk/src/core/ngx_connection.c	2012-11-20 13:37:55 UTC (rev 4918)
@@ -749,6 +749,8 @@
 
         ls[i].fd = (ngx_socket_t) -1;
     }
+
+    cycle->listening.nelts = 0;
 }
 
 

Modified: trunk/src/os/unix/ngx_process_cycle.c
===================================================================
--- trunk/src/os/unix/ngx_process_cycle.c	2012-11-17 00:36:44 UTC (rev 4917)
+++ trunk/src/os/unix/ngx_process_cycle.c	2012-11-20 13:37:55 UTC (rev 4918)
@@ -1296,14 +1296,19 @@
     void         *ident[4];
     ngx_event_t   ev;
 
+    /*
+     * Set correct process type since closing listening Unix domain socket
+     * in a master process also removes the Unix domain socket file.
+     */
+    ngx_process = NGX_PROCESS_HELPER;
+
+    ngx_close_listening_sockets(cycle);
+
+    /* Set a moderate number of connections for a helper process. */
     cycle->connection_n = 512;
 
-    ngx_process = NGX_PROCESS_HELPER;
-
     ngx_worker_process_init(cycle, -1);
 
-    ngx_close_listening_sockets(cycle);
-
     ngx_memzero(&ev, sizeof(ngx_event_t));
     ev.handler = ctx->handler;
     ev.data = ident;



More information about the nginx-devel mailing list