MaxRequestsPerChild == 0 means that a connection can stay up and serve requests
indefinitely.
Setting it to INT_MAX puts an upper bound (a very large upper bound) on the number of
requests that
can be served on a connection. I doubt this is of practical concern though. My main
concern... is
this patch portable? Is INT_MAX defined everywhere consistently?
Bill
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 1:46 PM
Subject: cvs commit: httpd-2.0/server/mpm/threaded threaded.c
> gregames 01/05/02 10:46:38
>
> Modified: server/mpm/threaded threaded.c
> Log:
> simplify the MaxRequestPerChild logic in worker_thread's hot path
>
> Revision Changes Path
> 1.29 +10 -1 httpd-2.0/server/mpm/threaded/threaded.c
>
> Index: threaded.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/threaded/threaded.c,v
> retrieving revision 1.28
> retrieving revision 1.29
> diff -u -d -b -u -r1.28 -r1.29
> --- threaded.c 2001/04/30 19:24:24 1.28
> +++ threaded.c 2001/05/02 17:46:34 1.29
> @@ -93,6 +93,7 @@
> #include "scoreboard.h"
>
> #include <signal.h>
> +#include <limits.h> /* for INT_MAX */
>
> /*
> * Actual definitions of config globals
> @@ -488,7 +489,7 @@
> /* TODO: Switch to a system where threads reuse the results from earlier
> poll calls - manoj */
> while (1) {
> - workers_may_exit |= (ap_max_requests_per_child != 0) &&
>(requests_this_child <= 0);
> + workers_may_exit |= (requests_this_child <= 0);
> if (workers_may_exit) break;
>
> (void) ap_update_child_status(process_slot, thread_slot, SERVER_READY,
> @@ -1378,6 +1379,14 @@
> }
>
> ap_max_requests_per_child = atoi(arg);
> +
> + /* a value of zero means infinity. The following removes a conditional
> + * from worker_thread's hot path
> + */
> +
> + if (!ap_max_requests_per_child) {
> + ap_max_requests_per_child = INT_MAX;
> + }
>
> return NULL;
> }
>
>
>