]> granicus.if.org Git - apache/commitdiff
mpm_prefork: follow up to r1635521.
authorYann Ylavic <ylavic@apache.org>
Mon, 17 Nov 2014 16:31:06 +0000 (16:31 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 17 Nov 2014 16:31:06 +0000 (16:31 +0000)
Avoid oddity on bucket_make_child_record overflow.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640184 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/prefork/prefork.c

index ab78c49bd22a4ccd669acbb8b50c7c348dc6348d..c8c826658377d733fbd3c09068c115292a46a5cd 100644 (file)
@@ -858,10 +858,10 @@ static void startup_children(int number_to_start)
     }
 }
 
-static int bucket_make_child_record = -1;
-static int bucket_kill_child_record = -1;
 static void perform_idle_server_maintenance(apr_pool_t *p)
 {
+    static int bucket_make_child_record = -1;
+    static int bucket_kill_child_record = -1;
     int i;
     int idle_count;
     worker_score *ws;
@@ -939,8 +939,9 @@ static void perform_idle_server_maintenance(apr_pool_t *p)
             }
             for (i = 0; i < free_length; ++i) {
                 bucket_make_child_record++;
+                bucket_make_child_record %= num_buckets;
                 make_child(ap_server_conf, free_slots[i],
-                           bucket_make_child_record % num_buckets);
+                           bucket_make_child_record);
             }
             /* the next time around we want to spawn twice as many if this
              * wasn't good enough, but not if we've just done a graceful