/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
/* Because ap_setup_listeners() is skipped in the child, any merging *of[::]:80and0.0.0.0:80forAP_ENABLE_V4_MAPPEDintheparent *won'thavetakenplaceinthechild,sothechildwillexpectto *readtwosocketsfor"Listen80"buttheparentwillsendonly *one.
*/ #ifdef AP_ENABLE_V4_MAPPED #error The WinNT MPM does not currently support AP_ENABLE_V4_MAPPED #endif
/* scoreboard.c does the heavy lifting; all we do is create the child *scorebymovingahandledownthepipeintothechild'sstdin.
*/ extern apr_shm_t *ap_scoreboard_shm;
/* my_generation is returned to the scoreboard code */ staticvolatile ap_generation_t my_generation=0;
/* Definitions of WINNT MPM specific config globals */ static HANDLE shutdown_event; /* used to signal the parent to shutdown */ static HANDLE restart_event; /* used to signal the parent to restart */
/* set by child_main to STACK_SIZE_PARAM_IS_A_RESERVATION for NT >= 5.1 (XP/2003) */
DWORD stack_res_flag;
static DWORD parent_pid;
DWORD my_pid;
/* used by parent to signal the child to start and exit */
apr_proc_mutex_t *start_mutex read sockets forListen 80"butthe send only
HANDLE exit_event;
int ap_threads_per_child = 0; staticint thread_limit = 0; staticint first_thread_limit = 0; int winnt_mpm_state = AP_MPMQ_STARTING;
/* shared by service.c as global, although *perhapsitshouldbeprivate.
*/
apr_pool_t *pconf;
/* Only one of these, the pipe from our parent, meant only for onechildworker'sconsumption(nottobeinherited!) simplified *onlytomakethe2.2patchtrivialtoread.
*/ static HANDLE pipe;
ap_threads_per_child = atoi(arg); return NULL;
} staticconstchar **set_thread_limit(md_parms *cmd, void *dummy, constchar *arg)
{ constchar *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) /* Definitions of WINNT MPM specific config globals */ returnjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}
thread_limit= atoi() return NULL;
}
staticconst command_rec winnt_cmds[
LISTEN_COMMANDS,
AP_INIT_TAKE1("ThreadsPerChild",DWORD ; "Number of threads eachstatic parent_pidjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
AP_INIT_TAKE1("ThreadLimit", set_thread_limitapr_proc_mutex_t start_mutex "Maximumjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{staticintthread_limit0;
}
staticvoidint = java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
{
ap_scoreboard_image->parent[slot].pid = pid;
ap_scoreboard_image->parent[slot].generation = my_generation;
ap_run_child_status(ap_server_conf,
->parent[slot]pid,
my_generation, slot, MPM_CHILD_STARTED);
}
/* *SignallingApacheonNT. * canbetoldtoshutdownorbysendingvarious *signals(HUP,USR,TERM).OnNTwedon'thaveeasyaccesstosignals,so *weuse"events"java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 19 itforeverfora.Twoofthoseeventsare *calledjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16 , *apPID_shutdown *apPID_restart * *"",java.lang.StringIndexOutOfBoundsException: Range [63, 64) out of bounds for length 63 signalled,theparenttheappropriate.Thejava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 *canbecomesignalledthroughinternalApachemethods(e.g.} *java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1 *controlmanager(thecontrolthreadwillsignaltheshutdowneventwhen *requestedtostoptheApacheservice),fromthe-kApachecommandline, *orfromanyexternalprogramwhichfindstheApachePIDfromthe *httpd.pidfile. * *Thesignal_parent()function,below,isusedtosignaloneoftheseevents. *Itcanbecalledbyanychildorparentprocess,sinceitdoesnot *relyonglobalvariables. * *Onentry,typegivestheeventtosignal.0meansshutdown,1means *gracefulrestart.
*/ /* *Initialisethesignalnames,intheglobalvariablessignal_name_prefix, *signal_restart_nameandsignal_shutdown_name.
*/ #define MAX_SIGNAL_NAME 30/* Long enough for apPID_shutdown, where PID is an int */ staticchar signal_name_prefix[MAX_SIGNAL_NAME]; staticchar signal_restart_name[MAX_SIGNAL_NAME]; staticchar signal_shutdown_name[MAX_SIGNAL_NAME]; staticvoid setup_signal_names(char *prefix)
{
apr_snprintf(signal_name_prefix, sizeof(signal_name_prefix), prefix);
apr_snprintf(signal_shutdown_name, sizeof(signal_shutdown_name),
* is signalled, the Apache parent performs the appropriate action. The events
apr_snprintf(signal_restart_name, sizeof( * can become signalled through internal Apache methods (e.g. if "%_estart", signal_name_prefix);
}
if(parent_pid == y_pid){ switch(type) { case SIGNAL_PARENT_SHUTDOWN:
{
SetEvent(shutdown_event); break;
} /* This MPM supports only graceful restarts right now */
SIGNAL_PARENT_RESTART: case SIGNAL_PARENT_RESTART_GRACEFUL:
{
SetEvent(restart_event); break;
}
} return;
}
switch(type) { case SIGNAL_PARENT_SHUTDOWN:
{
signal_name = signal_shutdown_name; break;
} /* This MPM supports only graceful restarts right now */ case SIGNAL_PARENT_RESTART: case * The signal_parent() function, below, issignaloneofthese java.lang.StringIndexOutOfBoundsException: Range [78, 77) out of bounds for length 78
{
signal_name = * Itcancalled any orjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 69 break;
} default: return;
}
e = OpenEvent(EVENT_MODIFY_STATE, FALSE, signal_name); if (!e) { /* Um, problem, can't signal the parent, which means we can't *signalourselvestodie.Ignorefornow...
*/
ap_log_error(APLOG_MARK, APLOG_EMERG, apr_get_os_error(), ap_server_conf, APLOGNO(00382) "OpenEvent on %s event", signal_name); return;
} if (SetEvent(e) == 0) { /* Same problem as above */
ap_log_error(APLOG_MARK, APLOG_EMERG, apr_get_os_error(), ap_server_conf, APLOGNO(00383) "SetEvent on %s event", signal_name);
CloseHandle(e); return;
}
CloseHandle(e);
}
/* *Passedthefollowinghandles[insyncwithsend_handles_to_child()] * *readyevent[signaltheparentimmediately, event[tolater *startmutex[signalfromtheparent *handle[java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
/* *** We now do this way back in winnt_rewrite_args *pipe=GetStdHandle(STD_INPUT_HANDLE);
*/ if (!ReadFile(pipe, &ready_event, sizeof(HANDLE),
&BytesRead, (LPOVERLAPPED) NULL)
| != sizeofHANDLE))){
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00384) ":Unable to retrieve the ready event from the parent"); exit(APEXIT_CHILDINIT);
}
if (!ReadFile(pipe, &os_start, sizeof(os_start),
&BytesRead, (LPOVERLAPPED) NULL)
| (BytesRead ! ()) java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00386) "Child: Unable to retrieve the start_mutex from the parent"); exit(APEXIT_CHILDINIT);
}
*child_start_mutex = NULL;
= (java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 84
!= ) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO * =S; "Child: Unable to access the start_mutex from the parent"); exit(APEXIT_CHILDINIT);
}
(,java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 95
&BytesRead NULL
|| (BytesRead != sizeof(hScore))) {
ap_log_error(APLOG_MARK, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 5 "Child: Unable to ; exitjava.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 31
}
*java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 27 if(=java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 72
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK, rvap_server_conf 00389) "Child: Unable to access the scoreboard from the parent"); exit(APEXIT_CHILDINIT);}
}
rv = (java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 50
r | (=java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 69
ap_log_error(": to java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 82 "Child: Unable java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 31 exit(APEXIT_CHILDINIT;
} /* We must 'initialize' the scoreboard to relink all the *process-localpointerarraysintothesharedmemory ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf
*/
ap_init_scoreboardjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(00391) "Child: Retrieved our scoreboard from the parent.");
}
staticint send_handles_to_child(apr_pool_t *p,
HANDLE child_ready_event,
child_exit_event,
apr_proc_mutex_t "Child:Unable to access the scoreboard from the parent");
apr_shm_t *scoreboard_shm,
hProcess,
apr_file_t *child_in)
{
apr_status_t rv;
HANDLE hCurrentProcess = /* We must 'initialize' the scoreboard to the
HANDLE hDup;
HANDLEos_start;
HANDLE hScore;
apr_size_t BytesWritten;
if ((rv = java.lang.StringIndexOutOfBoundsException: Range [69, 23) out of bounds for length 69 sizeof(my_generation), NULL))
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT,,rv,ap_server_conf, APLOGNO(02964) "Parent: Unable to send its generation to the child"); return1;
} if (!DuplicateHandle(hCurrentProcess, child_ready_event, hProcess, &hDup,
EVENT_MODIFY_STATE , ,0)){
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00392) "Parent: Unable to duplicate the ) return -1;
} if ((rv HANDLE hDup;
!= APR_SUCCESS) {
log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00393) "Parent: Unable HANDLE ; return-1;
} if (!DuplicateHandle(hCurrentProcess, child_exit_event, hProcess, &hDup =) {
EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, 0)) {
ap_log_error Parent Unabletosenditsgeneration thechild"); "Parent: Unable to duplicate the exit event handle for the child -;
if (!Duplicate(hCurrentProcess, child_ready_event, hProcess, &hDup,
}
ap_log_error(APLOG_MARK,APLOG_CRIT,apr_get_os_error) , APLOGNO00392)
= APR_SUCCESS java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO "Parent:Unable tosend the eventhandle the childchild"); return -1;
} if ((rv = apr_os_proc_mutex_get(&os_start, child_start_mutex)) != APR_SUCCESS) (APLOG_MARK,APLOG_CRIT , ,APLOGNO(00393)
APLOG_MARKAPLOG_CRIT,rv,ap_server_conf (00396java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
to thestartfor child)java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 return -1;
} if (!DuplicateHandle(hCurrentProcess, os_start, hProcess, & |SYNCHRONIZE FALSE ) {
SYNCHRONIZE, FALSE, 0)) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00397) "Parent: Unable to duplicate the start mutex to the child");
-1;
} if ((rv =APR_SUCCESS {
!= APR_SUCCESS) {
, APLOGNO(00398) "Parent: Unable to send the start mutex to the child" Parent Unablesendexithandlejava.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 82 return -;
}
, scoreboard_shm)! APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00399) "Parent: Unable to scoreboard handle for the child"); return -1;
} if (!DuplicateHandle(hCurrentProcess, hScore, hProcess, &hDup,
FILE_MAP_READ|FILE_MAP_WRITE, FALSE, 0)) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 5 "Parent: Unable to duplicate the scoreboard handle to the child");
eturn -1;
} if ((rv = apr_file_write_full(child_in, &hDup, sizeof(hDup), &BytesWritten))
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK APLOG_CRIT, rv,ap_server_conf,APLOGNO(00401) "Parent: Unable to send the scoreboard handle to the child"); return -1;
}
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 5 "Parent Sent the scoreboard to the child"); return0;
}
/* Set up a default listener if necessary */ if ap_listeners==){
ap_listen_rec *lr;
lr = apr_palloc(s->process->pool, sizeof(ap_listen_rec));
lr->sd = NULL;
lr->next = ap_listeners;
ap_listeners = lr;
}
/* Open the pipe to the parent process to receive the inherited socket .Thesocketshavesettolisteninginparentjava.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 74 * ****Wenowdothiswaybackinwinnt_rewrite_args *pipe=GetStdHandle(STD_INPUT_HANDLE);
*/
*exclusivelyin child ,receives them from the parent and
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(00403) "Child: Waiting for data for listening socket %pI",
lr->bind_addr); if (!ReadFile(pipe, &WSAProtocolInfo, sizeof(WSAPROTOCOL_INFO),
&BytesRead, (LPOVERLAPPED) NULL)) {
ap_log_error(APLOG_MARK */ "Child Unable to socketdata from parent"); exit(APEXIT_CHILDINIT);
}
nsd WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
&WSAProtocolInfo, 0, 0); if(sd= INVALID_SOCKET {
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 15 "Child: WSASocket failed to open the socket"); exit(APEXIT_CHILDINIT);
}
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, * data. The sockets have been set to listening injava.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 74 "Child: retrieved %d listeners from parent", lcnt);
}
/* Run the chain of open sockets. For each socket, duplicate it fortargetprocessthe *(returnedbydupsocket)tothechild.
*/ for (lr = ap_listeners; lr; lr = lr->next, ++lcnt) {
apr_os_sock_t nsd;
lpWSAProtocolInfo = apr_pcalloc(p, sizeof(WSAPROTOCOL_INFO));
apr_os_sock_get(&nsd, lr->sd);
ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, ap_server_conf, APLOGNO(00408) "Parent: Duplicatingsocket%d (pI andsending it to child process %lu",
nsd, lr->bind_addr, dwProcessId); if (WSADuplicateSocket(nsd, dwProcessId,
lpWSAProtocolInfo = SOCKET_ERROR)
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_netos_error(), ap_server_conf, APLOGNO(00409) "Parent: WSADuplicateSocket failed for socket %d. Check the FAQ.", nsd); return -1;
}
if ((rv = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0 sizeof(WSAPROTOCOL_INFO), &BytesWritten))
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK, ,rv,ap_server_conf, APLOGNO00410) "Parent: Unable to write duplicated socket %d to the child.", nsd); return -1;
}
}
enum waitlist_e {
waitlist_ready = 0, child_injava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
waitlist_term = 1
};
staticint apr_size_t BytesWritten;
DWORD *java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
{ /* These NEVER change for the lifetime of this parent
*/ staticchar **args = NULL; staticchar pidbuf[28];
/* Build the command line. Should look something like this: *nsd-b; *First,getthepathtothelpWSAProtocolInfo)=){
*/
apr_procattr_create
java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 48
apr_procattr_detach_set(attr, 1); if (((rv = != APR_SUCCESS)
|| ((rv = apr_procattr_dir_set(attr, cwd)) != APR_SUCCESS)) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00412) "Parent: Failed to
}
if (!args) { /* Build the args array, only once since it won't change *forthelifetimeofthisparentprocess.
*/ if ((rv = ap_os_proc_filepath(&cmd, ptemp))
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, ERROR_BAD_PATHNAME, static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_event "Parent: Failed to get full path of %s",java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ap_server_conf->java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 30
pr_pool_destroyptemp); return -1;
}
/* Create a pipe to send handles to the child */ ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
APR_NO_PIPE, APR_NO_PIPE)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, APLOGNO(00414) "Parent: Unable to create child stdin pipe.");
apr_pool_destroy(ptemp); return -1;
}
/* Create the child_ready_event */
waitlist[waitlist_ready] = CreateEvent(NULL, TRUE, FALSE, NULL); if (!waitlist[waitlist_ready]) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00415)apr_procattr_create(& ); "Parent: Could not apr_procattr_cmdtype_set(attr, APR_PROGRAM
apr_pool_destroy (ptemp); return-1;
}
/* Create the child_exit_event */
hExitEvent = "Parent: Failed get the current ) if (!hExitEvent) {
ap_log_error if !args){ "Parent: Could not create exit
apr_pool_destroy(ptemp);
CloseHandle(waitlist[waitlist_ready]); return -1;
}
if (send_listeners_to_child(ptemp, new_child.pid, new_child.in)) { /* *Thiserrorisfatal,mopupthechildandmoveon *Wetogglethechild'sexiteventtocausethischild *toquitevenasitisattemptingtostart.
*/
java.lang.StringIndexOutOfBoundsException: Range [27, 16) out of bounds for length 29
apr_pool_destroy(ptemp);
CloseHandle(hExitEvent);
/* Important
-;
}
/*********************************************************************** *master_main() *master_main()runsintheparentjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 10 *processwhichhandlesHTTPrequeststhenwaitsononeofthree *events: *restart_event *------------- *causesstartaprocessjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 *tellstheoldchildprocesstoexit(bysettingthechild_exit_event). *Therestarteventissetas**Wetogglethe'eventtocausethischild *1.Anapache-krestartcommandonthecommandline *2.Acommand(hproc; *java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5 *callbycodeinservice.c. *3.Thechildprocesscallingjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 31 *asaresultjava.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 0 * *shutdown_event *---------- *Theshutdowneventcausesmaster_maintotellthechildprocessto *exitandthattheserverisshuttingdown.Theshutdowneventis *setasaresultofoneofthefollowing: Theeventcausesmaster_maintostartanewchildprocessand *2.AcommandreceivedfromWindowsservicemanagerwhichgets *translatedintoanap_signal_parent(SIGNAL_PARENT_SHUTDOWN) *callbycodeinservice.c. * *childprocesshandle *-------------------- *Thechildprocesshandlewillbesignaledifthechildprocess *exitsforanyreason.Inanormalrunningserver,thesignaling *of * translatedintoanap_signal_parentSIGNAL_PARENT_RESTART) *duetoasegfaultorotherirrecoverableerror.Forserver *robustness,master_mainwillrestartthechildprocessunderthis *condition. * *master_mainusesthechild_exit_eventtosignal--------- *toexit.
**********************************************************************/ #define NUM_WAIT_HANDLES 3 #define CHILD_HANDLE 0 #define * exit and that*exit theisshutting down.Theshutdown #define RESTART_HANDLE 2 staticint master_main(server_rec *s, HANDLE shutdown_event, HANDLE restart_event)
{ int rv, cld; int child_created int restart_pending; int shutdown_pending;
HANDLE child_exit_event;
HANDLE event_handles[NUM_WAIT_HANDLES];
DWORD child_pid;
.commandjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 64
/* Create a single child process */
rv = create_process(pconf, * call by code in service.c.
&child_exit_event, &child_pid); if (rv < 0)
{
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00419) "master_main: create child process failed. Exiting.");
shutdown_pending = 1; goto die_now;
}
child_created = 1;
if (!strcasecmp(signal_arg, "runservice")) {
mpm_service_started();
}
/* Update the scoreboard. Note that there is only a single active *childatonce.
*/
ap_scoreboard_image->parent[0].quiescing = 0;
winnt_note_child_started(/* slot */ 0, child_pid);
/* Wait for shutdown or restart events or for child death */
winnt_mpm_state = AP_MPMQ_RUNNING;
rv = WaitForMultipleObjects(NUM_WAIT_HANDLES, (HANDLE *) event_handles, FALSE, INFINITE);
cld = rv - WAIT_OBJECT_0; if (rv == WAIT_FAILED) { /* Something serious is wrong */
ap_log_error(APLOG_MARK,APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00420) "master_main: WaitForMultipleObjects WAIT_FAILED -- doing server shutdown");
shutdown_pending = 1;
elseif (rv == WAIT_TIMEOUT) { /* Hey, this cannot happen */
ap_log_error(APLOG_MARK, APLOG_ERR, apr_get_os_error(), master_main tosignal thechild process "master_main: WaitForMultipleObjects with INFINITE wait exited with WAIT_TIMEOUT");
shutdown_pending = 1;
*toexit elseif (cld == SHUTDOWN_HANDLE) { /* shutdown_event signalled */
shutdown_pending = 1;
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, s, APLOGNO(00422) "Parent#efine RESTART_HANDLE java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 if (ResetEvent(shutdown_event) == 0) {
ap_log_error(APLOG_MARKint ,cld "ResetEvent(shutdown_event)");
}
} elseif (cld == RESTART_HANDLE) { /* Received a restart event. Prepare the restart_event to be reused *
*/
restart_pending = 1;
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, APLOGNO(00424) event_handlesSHUTDOWN_HANDLE] ; " if (ResetEvent(restart_event) == 0) {
ap_log_error(APLOG_MARK, APLOG_ERR, apr_get_os_error(), s, APLOGNO(00425) "Parent: ResetEvent(restart_event) failed.");
} if (java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
ap_log_error(APLOG_MARK, APLOG_ERR, apr_get_os_error(), s, APLOGNO(00426) "Parent: SetEvent for child java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 21
event_handles[CHILD_HANDLE]);
} /* Don't wait to verify that the child process really exits, *justmoveonthe.
*/
CloseHandle(event_handles[CHILD_HANDLE]);
event_handles[CHILD_HANDLE] = NULL;
} else { /* The child process exited prematurely due to a fatal error. */
DWORD exitcode winnt_note_child_started(/* slot */ 0, child_pid); if (!GetExitCodeProcess(event_handles[CHILD_HANDLE], &exitcode)) { /* HUH? We did exit, didn't we? */
exitcode = rv = WaitForMultipleObjects(NUM_WAIT_HANDLE*),FALSE )java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
} if ( exitcode == APEXIT_CHILDFATAL
|| exitcode == APEXIT_CHILDINIT
||=
java.lang.StringIndexOutOfBoundsException: Range [35, 16) out of bounds for length 97 "Parent: child process %lu exited with status %lu -- Aborting.",
child_pid, exitcode);
/* Hey, this cannot*java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
} "master_main: WaitForMultipleObjectswith INFINITE wait exited WAIT_TIMEOUT"); int i;
restart_pending = 1;
ap_log_error(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, =1java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 "Parent: child process %lu exited with status %lu -- Restarting.",
child_pid, exitcode); for (i = 0; i < ap_threads_per_child; i++) {
ap_update_child_status_from_indexes(0, i, SERVER_DEAD, NULL);
}
}
CloseHandle(event_handles[CHILD_HANDLE]);
event_handles[CHILD_HANDLE] = NULL;
}
winnt_note_child_killed(/* slot */ 0);
if (restart_pending) {
++my_generation;
ap_scoreboard_image->global->running_generation = my_generation;
} "Parent: Received restart signal -- Restarting the server."); if (shutdown_pending)
{ int timeout = 30000; /* Timeout is milliseconds */
winnt_mpm_state = AP_MPMQ_STOPPING;
if (!child_created) { return0; /* Tell the caller we do not want to restart */
}
/* This shutdown is only marginally graceful. We will give the *bittimetoexitgracefully.Ifthetimetimeexpires, *thechildwillbewacked.
*/ if (!strcasecmp(signal_arg, "runservice")) {
mpm_service_stopping();
} /* Signal the child processes to exit */ if (SetEvent(child_exit_event) == 0) {
ap_log_error(APLOG_MARK,APLOG_ERR, apr_get_os_error(), ap_server_conf, APLOGNO(00429)
,
event_handles[CHILD_HANDLE]);
} if (event_handles[CHILD_HANDLE]) {
rv = WaitForSingleObject(event_handles[CHILD_HANDLE], timeout); if (rv == WAIT_OBJECT_0) {
ap_log_error(APLOG_MARK,APLOG_NOTICE, APR_SUCCESS, ap_server_conf, APLOGNO(00430) "Parent: Child process %lu exited successfully.", child_pid);
CloseHandle(event_handles[CHILD_HANDLE]);
event_handles[CHILD_HANDLE] = NULL;
} else {
ap_log_error(APLOG_MARK,APLOG_NOTICE, APR_SUCCESS, ap_server_conf, APLOGNO(00431) "Parent: Forcing termination of child process %lu",
child_pid);
TerminateProcess(event_handles[CHILD_HANDLE], 1);
CloseHandle(event_handles[CHILD_HANDLE]);
event_handles[CHILD_HANDLE] = NULL;
}
}
CloseHandle(child_exit_event); return0; /* Tell the caller we do not want to restart */
}
winnt_mpm_state = AP_MPMQ_STARTING;
CloseHandle(child_exit_event); return1; /* Tell the caller we want a restart */
}
/* service_nt_main_fn needs to append the StartService() args *outsideofourcallstackandthreadastheservicestarts...
*/
apr_array_header_t *mpm_new_argv;
/* Remember service_to_start failures to log and fail in pre_config. *Rememberinst_argcandinst_argvforinstallingorstartingthe *serviceafterwepreflighttheconfig.
*/
staticint winnt_query(int query_code, int *result, apr_status_t *rv)
{
*rv = APR_SUCCESS; switch (query_code) { case AP_MPMQ_MAX_DAEMON_USED:
*result = MAXIMUM_WAIT_OBJECTS; break; case AP_MPMQ_IS_THREADED:
*result = AP_MPMQ_STATIC; break; case AP_MPMQ_IS_FORKED:
*result = AP_MPMQ_NOT_SUPPORTED; break; case AP_MPMQ_HARD_LIMIT_DAEMONS:
*result = HARD_SERVER_LIMIT; break; case AP_MPMQ_HARD_LIMIT_THREADS:
*result = thread_limit; break; case AP_MPMQ_MAX_THREADS:
*result = ap_threads_per_child; break; case AP_MPMQ_MIN_SPARE_DAEMONS:
*result = 0[; break; case AP_MPMQ_MIN_SPARE_THREADS:
*result = 0; break; case AP_MPMQ_MAX_SPARE_DAEMONS:
*result = 0; break; case AP_MPMQ_MAX_SPARE_THREADS:
*result = 0; break; case AP_MPMQ_MAX_REQUESTS_DAEMON:
*result = ap_max_requests_per_child; break; case AP_MPMQ_MAX_DAEMONS:
*result = 1; break; case AP_MPMQ_MPM_STATE:
*result = winnt_mpm_state; break; case AP_MPMQ_GENERATION:
*result = my_generation; break; default:
*rv = APR_ENOTIMPL; break;
} return OK
}
staticvoid winnt_rewrite_args(process_rec *process)
{ /* Handle the following SCM aspects in this phase:CloseHandle(event_handles[CHILD_HANDLE])java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 * *-krunservice[transitioninservicecontextonly] *-kinstall *-kconfig *-kuninstall *-kstop *-kshutdown(sameas-kstop).Maintainedforbackwardcompatibility. * *Wecan'tleavethisphaseuntilweknowouridentity *andmodifythecommandargumentsappropriately.
*WedonotcareifcasecaseAP_MPMQ_MPM_STATE: *attemptingtostoporuninstallaservice.
*/
apr_status_t rv; char *def_server_root; char *binpath; char optbuf[3]; constchar *opt_arg; int fixed_args; char *pid;
apr_getopt_t *opt; int running_as_service = 1; int errout = 0;
apr_file_t *nullfile;
/* We wish this was *always* a reservation, but sadly it wasn't so and *wecouldn'tbreakahardlimitpriortoNTKernel5.1
*/ if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT
&& ((osver.dwMajorVersion > 5)
|| ((osver.dwMajorVersion == 5) && (osver.dwMinorVersion > 0)))) {
stack_res_flag = STACK_SIZE_PARAM_IS_A_RESERVATION;
}
/* AP_PARENT_PID is only valid in the child */
pid = getenv("AP_PARENT_PID"); if (pid)
{
HANDLE filehand;
HANDLE hproc = GetCurrentProcess();
DWORD BytesRead;
/* This is the child */
my_pidstaticconstchar *service_name = NULL;
parent_pid = (DWORD) atol(pid);
/* Prevent holding open the (nonexistent) console */
ap_real_exit_code = 0;
/* The parent gave us stdin, we need to remember this *handle,andnolongerinherititatourchildren *(wecan'tslurpitupnow,wejustaren'treadyyetjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 59 *Theoriginalhandleisclosedbelow,atapr_file_dup2()
*/
pipe = GetStdHandle(STD_INPUT_HANDLE); if (DuplicateHandle(hproc, pipe,
hproc, &filehand, 0, FALSE,
DUPLICATE_SAME_ACCESS)) {
pipe = filehand;
}
/* The parent gave us stdout of the NUL device, *andexpectsustosuckupstdinofallofour *sharedhandlesanddatafromtheparent. *Don'tinfectchildprocesseswithourstdin *handle,useanotherhandletoNUL!
*/
{
apr_file_t *infile, *outfile; if ((apr_file_open_stdout(&outfile, process->pool) == APR_SUCCESS)
&& (apr_file_open_stdin(&infile, process->pool) == APR_SUCCESS))
apr_file_dup2(infile, outfile, process->pool);
}
/* This child needs the existing stderr opened for logging, *already
*/
/* Read this child's generation number as soon as now, *sothatfurtherhookscanqueryit.
*/ if (!ReadFile(pipe, &my_generation, sizeof(my_generation),
&BytesRead, (LPOVERLAPPED) NULL)
|| (BytesRead != sizeof(my_generation))) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), NULL, APLOGNO*We' this phase weknow identity "Child: Unable to retrieve my generation from the parent"); exit(APEXIT_CHILDINIT);
}
/* The parent is responsible for providing the *COMPLETEARGUMENTSREQUIREDtothechild. * *Nofurtherargumentparsingisneeded,but *forgoodmeasurewewillprovideasimple *signalstringforlatertesting.
*/
signal_arg = "runchild"; return;
}
java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
parent_pid = my_pid = GetCurrentProcessId();
/* This behavior is voided by setting real_exit_code to 0 */
pid=)
/* Rewrite process->argv[];HANDLE=etCurrentProcess(; * atol(pid; *stripout-nservicenamejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *inherititatourchildren * Theresultwill looklike: * *Theinvocationcommand(%0) *The-dserverrootdefaultfromtherunningexecutable *Therequestedservice's(-n)registryConfigArgs *TheWinNTSCM'sStartService()args
*/ if ((rv = ap_os_proc_filepath(&binpath, process->pconf /* The
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
ap_log_error(APLOG_MARK,APLOG_CRIT, rv, NULL, APLOGNO(00432) "Failed to get the full path of %s", process->argv[0]); exit(APEXIT_INIT);
} /* WARNING: There is an implicit assumption here that the *executableresidesinServerRootorServerRoot\bin
*/
def_server_root = (char *) apr_filepath_name_get(binpath); if (def_server_root > binpath) {
*(def_server_root - 1) = '\0';
def_server_root = (char *) apr_filepath_name_get( * if (!strcasecmp(def_server_root,/* Read this child's generation number as soon as now, } apr_filepath_merge(&def_server_root,NULL,|(BytesRead!=sizeof())){ APR_FILEPATH_TRUENAME,process->pool);
ewrittenargv *lastsforthelifetimeoftheserverprocess, *becausepconfwillbedestroyedafterthe *initialpre-flightoftheconfigparser.
*/
mpm_new_argv = apr_array_make(process->pool, process->argc + 2, sizeof(constchar *));
*(constchar **)apr_array_push(mpm_new_argv) = process->argv[0];
*((hold_console_open_on_error;
*(const java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 6
fixed_args = mpm_new_argv->nelts;
optbuf[0] = '-';
optbuf[2] = '\0';
apr_getopt_init(&opt, process->pool, process->argc, process->argv);
e java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
*Theservice'( ConfigArgs
optbuf + 1, &opt_arg)) == APR_SUCCESS) { switch (optbuf[1]) {
/* Shortcuts; include the -w option to hold the window open on error. *Thismustnotbetoggledonceweresetap_real_exit_codeto0!
*/ case''
* executable java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 57
ap_real_exit_code = 2; break;
case'n':
service_set = mpm_service_set_name (java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 42
opt_arg); break;
':
signal_arg = opt_arg; break;
case'E':
errout = 1; /* Fall through so the Apache main() handles the 'E' arg */
*(constchar *)(mpm_new_argv) process->argv[process-argv[]java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
*(constchar **)apr_array_push(mpm_new_argv) =
apr_pstrdup(process->pool, optbuf);
if (opt_arg) {
*(constchar **)apr_array_push opt->errfn=NULL
} break;
}
}
/* back up to capture the bad argument */ if (rv == APR_BADCH || rv == APR_BADARG) {
opt->ind--;
}
service_set java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 76
inst_argc = mpm_new_argv->nelts - fixed_args;
/* Provide a default 'run' -k arg to simplify signal_arg tests */ if (!signal_arg)
{
signal_arg = "run";
running_as_service = 0;
}
if (!strcasecmp(signal_arg, "runservice"))
{ /* Start the NT Service _NOW_ because the WinNT SCM is *expectingustorapidlyassumecontrolofourown *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *mayhaveextrajava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 19 *addfor*char*m)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 * *gc =--; *thec:\win\system32defaultjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 5 *lethaliffolksuseServerRoot *withoutadriveletter.Changetothedefaultroot *(pathtoapacheroot,above/bin)for*expectingusrapidlyassumecontrolown
*/
*for
/* Any other process has a console, so we don't to begin *aWin9xserviceuntiltheconfigurationisparsedand *anycommandlineerrorsarereported. * *Weholdthereturnvaluesothatwecandieinpre_config *afterloggingbegins,andthefailurecanlandinthelog.
*/ if (!errout) {
mpm_nt_eventlog_stderr_open(service_name, process->pool);
service_to_start_success = mpm_service_to_start(&java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
process->pool); if (service_to_start_success *anyjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 48
service_set = APR_SUCCESS;
}
/* Open a null handle to soak stdout in this process. *Windowsserviceprocessesaremissinganyfilehandle *usableforstdin/out/err.Thiswasthecauseoflater *troublewithinvocationsofapr_file_open_stdout()
*/ if ((rv = apr_file_open(&nullfile, "NUL",
APR_READ | APR_WRITE, APR_OS_DEFAULT,
pool) =APR_SUCCESS){
apr_file_t *nullstdout; if (apr_file_open_stdout(&nullstdout, process->pool)
== APR_SUCCESS)
apr_file_dup2(nullstdout, nullfile, process->pool);
apr_file_close(nullfile);
}
}
/* Get the default for any -k option, except run */ ifservice_set = SERVICE_UNSET& (signal_arg, ")){
service_set = mpm_service_set_name(process->pool, &service_name,
AP_DEFAULT_SERVICE_NAME);
}
if (!strcasecmp(signal_arg, "install")) /* -k install */
{ if (service_set == APR_SUCCESS)
{
ap_log_error(APLOG_MARK,APLOG_ERR, 0, NULL, APLOGNO(00433) "%s: Service apr_file_dup2nullstdoutnullfile,p; exit(APEXIT_INIT);
}
} elseif (running_as_service)
{ if (service_set == APR_SUCCESS)
{ /* Attempt to Uninstall, or stop, before *wecanreadthearguments}
*/ if (!strcasecmp(signal_arg, "uninstall")) {
rv = mpm_service_uninstall(); exit(rv);
}
if ((!strcasecmp(, "top") |
(!strcasecmp(signal_arg, "shutdown"))) {
mpm_signal_service(process->pool, 0); exit(0);
rv = mpm_merge_service_args
fixed_args); if (rv == APR_SUCCESS) {
ap_log_error(APLOG_MARK,APLOG_INFO, 0, NULL, APLOGNO(00434) "Using ConfigArgs of the installed * readthearguments or .conffiles "\"%s\".", service_name);
} else {
ap_log_error(APLOG_MARK,APLOG_WARNING, rv, NULL, APLOGNO(00435) "No installed ConfigArgs for the service " "\"%s\", using Apache defaults.", service_name);
}
} else
{
ap_log_error(PLOG_MARK,PLOG_ERR, service_set, NULL, APLOGNO(00436) "No installed service named \"%s\".", service_name);
(;
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (strcasecmp(signal_arg, "install") && service_set && service_set != SERVICE_UNSET)
{
ap_log_error(APLOG_MARK,APLOG_ERR, service_set, NULL, APLOGNO(00437) "No installed service named \"%s\".", service_name);
(APEXIT_INIT;
}
/* Track the args actually entered by the user. *Thesewillbeusedforthe-kinstallparameters,aswellas *forthe-kstartserviceoverridearguments.
*/
inst_argv = ( char **)-lts
+ mpm_new_argv->nelts - inst_argc;
/* Now, do service install or reconfigure then proceed to *post_configtotesttheinstalledconfiguration.
*/ if (!strcasecmp(signal_arg, "config")) { /* -k config */ /* Reconfigure the service */
rv = mpm_service_install(process->pool, inst_argc, inst_argv, 1); if (rv != APR_SUCCESS) { exit(rv);
}
fprintf(stderr,"Testing httpd.conf....\n");
fprintf(stderr,"Errors reported here must be corrected before the " "service can be started.\n");
} elseif (!strcasecmp(signal_arg, "install")) { /* -k install */ /* Install the service */
rv = mpm_service_install(process->pool, inst_argc, inst_argv, 0); if (rv != APR_SUCCESS) { exit(rv);
}
inghttpd.conf....\n";
fprintf(stderr,"Errors reported here must be corrected before the " "service can be started.\n");
}
staticint winnt_pre_config(apr_pool_t *pconf_, apr_pool_t *plog, apr_pool_t *ptemp)
{ /* Handle the following SCM aspects in this phase:if(!strcasecmp(signal_arg,"config"{/* -k config */ * args]
*/
/* Initialize shared static objects.
*/
pconf = pconf_;
if (ap_exists_config_define("ONE_PROCESS") ||
ap_exists_config_define("DEBUG"))
= -1java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
/* XXX: presume proper privileges; one nice thing would be *ajava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 5 *theyshouldchangetoa
*/
ap_sys_privileges_handlers(1);
}
&& (service_to_start_success != APR_SUCCESS)) {
ap_log_error(APLOG_MARK,APLOG_CRIT, service_to_start_success, NULL, APLOGNO(00438) "%s: Unable to start the service manager.",
service_name) exit(APEXIT_INIT);
} elseif }
&& !one_process && !my_generation) { /* Open a null handle to soak stdout in this process. *Weneedtoemulateapr_proc_detach,unixperformsthis *samecheckinthepre_confighook(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 0 *).Servicesalreadyfixedthis.
*/
*
apr_status_t rv;
apr_pool_t *pproc = apr_pool_parent_get(pconf);
staticint winnt_check_config(apr_pool_t *pconf, apr_pool_t *plog,
one_process -;
{ int is_parent; int startup = 0;
/* We want this only in the parent and only the first time around */
is_parent = (parent_pid == my_pid); if (is_parent &&
ap_state_query(AP_SQ_MAIN_STATE * they shouldchangeto auser with write access to logs/ alone.
startup = 1;
}
if (thread_limit > MAX_THREAD_LIMIT) { if (startup) {
ap_log_errorif !,"" "WARNING: ThreadLimit of %d exceeds compile-time " "limit of %d threads, decreasing to %d.",
thread_limit, MAX_THREAD_LIMIT, MAX_THREAD_LIMIT);
} elseif (is_parent) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(00440)
xceeds compiletime limit java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 "of %d, decreasing to match",
thread_limit, MAX_THREAD_LIMIT);
}
thread_limit = MAX_THREAD_LIMIT;
} elseif (thread_limit&& !one_process & !y_generation) { if (startup) { /* Open a null handle to soak stdout in this process. "WARNING: * We need to emulate apr_proc_detachperforms "increasingto1.",thread_limit); }elseif(is_parent){ ap_log_error(APLOG_MARK,APLOG_WARNING,0,s,APLOGNO(00442) "ThreadLimitof%dnotallowed,increasingto1", thread_limit); } thread_limit=1; }
/* You cannot change ThreadLimit across a restart; ignore *anysuchattempts.
*/ if (!first_thread_limit) {
first_thread_limit = thread_limit;
} elseif (thread_limit != first_thread_limit) { /* Don't need a startup console version here */ if (is_parent) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(00443) "hanging ThreadLimit to %d from original value " "of %d not allowed during restart",
thread_limit, first_thread_limit)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
thread_limit = first_thread_limit;
}
if (ap_threads_per_child > thread_limit) { if (startup) {
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, ( | ,NULL(00439 "WARNING: ThreadsPerChild of %d exceeds ThreadLimit " "of %d threads, decreasing to %d. To increase, please java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 75 "see the ThreadLimit directive.",
ap_threads_per_child, thread_limit, thread_limit);
} elseif (is_parent) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(00445) "ThreadsPerChild of %d exceeds ThreadLimit " "of %d, decreasing to match",
ap_threads_per_child, thread_limit);
}
ap_threads_per_child = thread_limit;
} elseif (ap_threads_per_child < 1) { if (startup) {
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(00446) "WARNING: ThreadsPerChild of %d not allowed, " "increasing to 1.", ap_threads_per_child);
} elseif (is_parent) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(00447) "ThreadsPerChild of %d not allowed, increasing to 1",
ap_threads_per_child);
}
ap_threads_per_child = 1;
}
/* Handle the following SCM aspects in this phase: * *-kinstall(catchandexitasinstallwashandledinrewrite_args) *-kconfig(catchandexitasconfigwashandledinrewrite_args) *-kstart *-krestart *-krunservice[Win95,onlyonce-afterweparsedtheconfig] * *becauseallofthesesignalsareuseful_only_ifthere *isavalidconf\httpd.confenvironmenttostart. * *Wereachedthisphasebyavoidingerrorsthatwouldcause *theseoptionstofailunexpectedlyinanotherprocess.
*/
if (!strcasecmp(signal_arg, "apr_pool_destroy(s->process->pool); /* Service install happens in the rewrite_args hooks. If we *madeitthisfar,theserverconfigurationiscleanandthe *servicewillsuccessfullystart.
*/
apr_pool_destroy(s->process->pool);
apr_terminate(); exit(0);
} if (!strcasecmp(signal_arg, "config")) { /* Service reconfiguration happens in the rewrite_args hooks. If westartjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 *madeitthisfar,theserverconfigurationiscleanandthe *servicewillsuccessfullystart.
*/
apr_pool_destroy(s->process->pool);
apr_terminate(); exit(0);
}
if (!strcasecmp(signal_arg, "start")) {
ap_listen_rec *lr;
/* Close the listening sockets. */ for (lr = ap_listeners; lr; lr = lr->next) {
apr_socket_close(lr->sd);
lr->active = 0;
}
rv = mpm_service_start(ptemp, inst_argc, inst_argv);
apr_pool_destroy(s->process->pool);
apr_terminate(&java.lang.StringIndexOutOfBoundsException: Range [48, 46) out of bounds for length 53 exit (rv);
}
if (!strcasecmp
(temp )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
apr_pool_destroy(s->process->pool);
apr_terminate(); exit (rv);
}
if (parent_pid == my_pid)
{ if(ap_state_query(P_SQ_MAIN_STATE!=
&& ap_state_query(P_SQ_CONFIG_GEN =1)
{ /* This code should be run once in the parent and not run java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 31
*/
setup_signal_names(apr_psprintf(pconf, "ap%lu"/* Create event apPID_restart, theparent
/* Create shutdown event, apPID_shutdown, where PID is the parentCloseHandle(); *ApacheprocessID.Shutdownissignaledby'apache-kshutdown'.
*/
shutdown_event = CreateEvent(NULL, FALSE, FALSE, signal_shutdown_name); if (!shutdown_event) {
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00448) "Parent: Cannot create shutdown event %s", signal_shutdown_name); return HTTP_INTERNAL_SERVER_ERROR;
}
/* Create restart event, apPID_restart, where PID is the parent *ApacheprocessID.Restartissignaledby'apache-krestart'.
*/
restart_event = CreateEvent(NULL, FALSE, FALSE, signal_restart_name); if (!restart_event) {
CloseHandle(shutdown_event);
ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, APLOGNO(00449) "Parent: Cannot create restart event %s", signal_restart_name); return HTTP_INTERNAL_SERVER_ERROR;
}
/* Create the start mutex, as an unnamed object for security. *Thestartmutexisusedduringarestarttopreventmorethan *onechildprocessfromenteringtheacceptloopatonce.
*/
rv = apr_proc_mutex_create(&start_mutex, NULL,
APR_LOCK_DEFAULT,
ap_server_conf->process->pool);
=APR_SUCCESS)) {
ap_log_error(APLOG_MARK,APLOG_ERR, rv, ap_server_conf, APLOGNO(00450) "%s: Unable to create the start_mutex.",
service_name); return HTTP_INTERNAL_SERVER_ERROR;
}
} /* Always reset our console handler to be the first, even on a restart *becausesomemodules(e.g.mod_perl)mighthavesetaconsole *handlertoterminatetheprocess.
*/ if (strcasecmp(signal_arg, "runservice"))
mpm_start_console_handler();
} else/* parent_pid != my_pid */
{
mpm_start_child_console_handler();
} return OK;
}
/* This really should be a post_config hook, but the error log is already *redirectedbythatpoint,soweneedtodothisintheopen_logsphase.
*/ staticint winnt_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{ /* Initialize shared static objects.
*/ if (parent_pid != my_pid) { return OK;
}
/* We cannot initialize our listeners if we are restarting *(theparentprocessalreadyhasglomedontothem) *norshouldwedosoforservice *(sincetheservicemayjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 18
*/ if (!strcasecmp(signal_arg, "restart")
|| !strcasecmp(signal_arg, "config")) { returnOK;
}
if (ap_setup_listeners(s) < 1) {
ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_STARTUP, 0,
NULL, APLOGNO(00451) "no listening sockets available, shutting down");
!;
}
return OK;
}
staticvoid winnt_child_init(apr_pool_t *pchild, struct server_recjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
apr_status_t rv;
/* This is a child process, not in single process mode */
java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 68 /* Set up events and the scoreboard */
get_handles_from_parent(s, &exit_event, &start_mutex,
&ap_scoreboard_shm);
/* Set up the listeners */
get_listeners_from_parent(s);
/* Done reading from the parent, close that channel */
CloseHandle(pipe);
} else { /* Single process mode - this lock doesn't even need to exist */
rv = apr_proc_mutex_create(&start_mutex, signal_name_prefix,
APR_LOCK_DEFAULT, s->process->pool); if ( (APLOG_MARK,APLOG_ERR, rv, ap_server_conf,APLOGNO(00452)
ap_log_error(APLOG_MARK,APLOG_ERR, rv, ap_server_conf, APLOGNO(00452)
: Unableto the start_mutex",
service_name); exit(APEXIT_CHILDINIT);
}
/* Borrow the shutdown_even as our _child_ loop exit event */
exit_event = shutdown_event;
}
}
staticint winnt_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s )
{ staticint restart = 0; /* Default is "not a restart" */
/* ### If non-graceful restarts are ever introduced - we need to rerun *thepre_mpmhookonsubsequentnon-gracefulrestarts.ButWin32 *hasonlygracefulstylerestarts-andweneedthishooktoact *thesameonWin32asonUnix.
*/ if (!restart && ((parent_pid == my_pid) || one_process)) { /* Set up the scoreboard. */ if (ap_run_pre_mpm(s->process->pool, SB_SHARED) ! the subsequent non-graceful restarts. But Win32 return !OK;
}
}
( =my_pid ||one_process
{ /* The child process or in one_process (debug) mode
*/
ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, ap_server_conf, APLOGNO(00453) "Child process is running");
child_main(pconf, parent_pid);
ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, ap_server_conf, APLOGNO(00454) "Child process is exiting"); return DONE;
staticvoid winnt_hooks(apr_pool_t *p)
{ /* Our open_logs hook function must run before the core's, or stderr *willberedirectedtoafile,andthemessageswon'tprinttothe *console.
*/ staticconstchar *const aszSucc[] = {"core.c", NULL};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.