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

Function init_server_config

server/config.c:2217–2259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2215}
2216
2217static server_rec *init_server_config(process_rec *process, apr_pool_t *p)
2218{
2219 apr_status_t rv;
2220 server_rec *s = (server_rec *) apr_pcalloc(p, sizeof(server_rec));
2221
2222 apr_file_open_stderr(&s->error_log, p);
2223 s->process = process;
2224 s->port = 0;
2225 s->server_admin = DEFAULT_ADMIN;
2226 s->server_hostname = NULL;
2227 s->server_scheme = NULL;
2228 s->error_fname = DEFAULT_ERRORLOG;
2229 s->log.level = DEFAULT_LOGLEVEL;
2230 s->log.module_levels = NULL;
2231 s->limit_req_line = DEFAULT_LIMIT_REQUEST_LINE;
2232 s->limit_req_fieldsize = DEFAULT_LIMIT_REQUEST_FIELDSIZE;
2233 s->limit_req_fields = DEFAULT_LIMIT_REQUEST_FIELDS;
2234 s->timeout = apr_time_from_sec(DEFAULT_TIMEOUT);
2235 s->keep_alive_timeout = apr_time_from_sec(DEFAULT_KEEPALIVE_TIMEOUT);
2236 s->keep_alive_max = DEFAULT_KEEPALIVE;
2237 s->keep_alive = 1;
2238 s->next = NULL;
2239 s->addrs = apr_pcalloc(p, sizeof(server_addr_rec));
2240
2241 /* NOT virtual host; don't match any real network interface */
2242 rv = apr_sockaddr_info_get(&s->addrs->host_addr,
2243 NULL, APR_UNSPEC, 0, 0, p);
2244 if (rv != APR_SUCCESS) {
2245 /* should we test here for rv being an EAIERR? */
2246 ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, rv, NULL, APLOGNO(00530)
2247 "initialisation: bug or getaddrinfo fail");
2248 return NULL;
2249 }
2250
2251 s->addrs->host_port = 0; /* matches any port */
2252 s->addrs->virthost = ""; /* must be non-NULL */
2253 s->names = s->wild_names = NULL;
2254
2255 s->module_config = create_server_config(p, s);
2256 s->lookup_defaults = create_default_per_dir_config(p);
2257
2258 return s;
2259}
2260
2261
2262static apr_status_t reset_conf_vector_length(void *dummy)

Callers 1

ap_read_configFunction · 0.85

Calls 3

create_server_configFunction · 0.70
ap_log_errorFunction · 0.50

Tested by

no test coverage detected