MCPcopy Create free account
hub / github.com/apache/httpd / main

Function main

server/main.c:488–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488int main(int argc, const char * const argv[])
489{
490 char c;
491 int showcompile = 0, showdirectives = 0;
492 const char *confname = SERVER_CONFIG_FILE;
493 const char *def_server_root = HTTPD_ROOT;
494 const char *temp_error_log = NULL;
495 const char *error;
496 process_rec *process;
497 apr_pool_t *pconf;
498 apr_pool_t *plog; /* Pool of log streams, reset _after_ each read of conf */
499 apr_pool_t *ptemp; /* Pool for temporary config stuff, reset often */
500 apr_pool_t *pcommands; /* Pool for -D, -C and -c switches */
501 apr_getopt_t *opt;
502 apr_status_t rv;
503 module **mod;
504 const char *opt_arg;
505 APR_OPTIONAL_FN_TYPE(ap_signal_server) *signal_server;
506 int rc = OK;
507
508 AP_MONCONTROL(0); /* turn off profiling of startup */
509
510 process = init_process(&argc, &argv);
511 ap_pglobal = process->pool;
512 pconf = process->pconf;
513 ap_server_argv0 = process->short_name;
514 ap_init_rng(ap_pglobal);
515
516 /* Set up the OOM callback in the global pool, so all pools should
517 * by default inherit it. */
518 apr_pool_abort_set(abort_on_oom, apr_pool_parent_get(process->pool));
519
520#if APR_CHARSET_EBCDIC
521 if (ap_init_ebcdic(ap_pglobal) != APR_SUCCESS) {
522 destroy_and_exit_process(process, 1);
523 }
524#endif
525
526 apr_pool_create(&pcommands, ap_pglobal);
527 apr_pool_tag(pcommands, "pcommands");
528 ap_server_pre_read_config = apr_array_make(pcommands, 1,
529 sizeof(const char *));
530 ap_server_post_read_config = apr_array_make(pcommands, 1,
531 sizeof(const char *));
532 ap_server_config_defines = apr_array_make(pcommands, 1,
533 sizeof(const char *));
534
535 error = ap_setup_prelinked_modules(process);
536 if (error) {
537 ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_EMERG, 0, NULL, APLOGNO(00012)
538 "%s: %s", ap_server_argv0, error);
539 destroy_and_exit_process(process, 1);
540 }
541
542 ap_run_rewrite_args(process);
543
544 /* Maintain AP_SERVER_BASEARGS list in http_main.h to allow the MPM
545 * to safely pass on our args from its rewrite_args() handler.

Callers

nothing calls this directly

Calls 15

init_processFunction · 0.85
ap_init_rngFunction · 0.85
ap_init_ebcdicFunction · 0.85
destroy_and_exit_processFunction · 0.85
ap_run_rewrite_argsFunction · 0.85
ap_parse_log_levelFunction · 0.85
ap_get_server_builtFunction · 0.85
ap_show_modulesFunction · 0.85
ap_show_mpmFunction · 0.85
show_compile_settingsFunction · 0.85

Tested by

no test coverage detected