Changes with Apache 2.0.27-dev
+ *) Win32: Track and display "Parent Server Generation:" in
+ mod_status output. The generation will be bumped at
+ server graceful restart, when the child process exits
+ by hitting MaxRequestsPerChild or if the child
+ process exits abnormally. [Bill Stoddard]
+
+ *) Win32: Fix problem where MaxRequestsPerChild directive was
+ not being picked up in favor of the default. Enable
+ the parent to start up a new child process immediately upon
+ the old child starting shutdown.
+ [Bill Stoddard]
*) Fix some bungling of the remote port in rfc1413.c so that
IdentityCheck retrieves the proper user id instead of failing
pCommand = apr_pstrcat(p, pCommand, " \"", ap_server_conf->process->argv[i], "\"", NULL);
}
- /* Build the environment, since Win9x disrespects the active env */
- pEnvVar = apr_psprintf(p, "AP_PARENT_PID=%i", parent_pid);
/*
+ * Build the environment
* Win32's CreateProcess call requires that the environment
* be passed in an environment block, a null terminated block of
* null terminated strings.
*/
+ _putenv(apr_psprintf(p,"AP_PARENT_PID=%i", parent_pid));
+ _putenv(apr_psprintf(p,"AP_MY_GENERATION=%i", ap_my_generation));
+
i = 0;
iEnvBlockLen = 1;
while (_environ[i]) {
iEnvBlockLen += strlen(_environ[i]) + 1;
i++;
}
-
- pEnvBlock = (char *)apr_pcalloc(p, iEnvBlockLen + strlen(pEnvVar) + 1);
- strcpy(pEnvBlock, pEnvVar);
- pEnvVar = strchr(pEnvBlock, '\0') + 1;
-
+ pEnvBlock = (char *)apr_pcalloc(p, iEnvBlockLen);
+ pEnvVar = pEnvBlock;
i = 0;
while (_environ[i]) {
strcpy(pEnvVar, _environ[i]);
* just move on with the restart.
*/
event_handles[CHILD_HANDLE] = NULL;
- }
+ ++ap_my_generation;
+ }
else {
/* The child process exited prematurely due to a fatal error. */
restart_pending = 1;
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, APR_SUCCESS, ap_server_conf,
"Parent: CHILD PROCESS FAILED -- Restarting the child process.");
-
event_handles[CHILD_HANDLE] = NULL;
+ ++ap_my_generation;
}
die_now:
}
}
else {
+ ap_my_generation = atoi(getenv("AP_MY_GENERATION"));
get_listeners_from_parent(ap_server_conf);
}
if (!set_listeners_noninheritable(pconf)) {