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

Function ap_init_virtual_host

server/config.c:2083–2121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2081}
2082
2083AP_CORE_DECLARE(const char *) ap_init_virtual_host(apr_pool_t *p,
2084 const char *hostname,
2085 server_rec *main_server,
2086 server_rec **ps)
2087{
2088 server_rec *s = (server_rec *) apr_pcalloc(p, sizeof(server_rec));
2089
2090 /* TODO: this crap belongs in http_core */
2091 s->process = main_server->process;
2092 s->server_admin = NULL;
2093 s->server_hostname = NULL;
2094 s->server_scheme = NULL;
2095 s->error_fname = NULL;
2096 s->timeout = 0;
2097 s->keep_alive_timeout = 0;
2098 s->keep_alive = -1;
2099 s->keep_alive_max = -1;
2100 s->error_log = main_server->error_log;
2101 s->log.level = APLOG_UNSET;
2102 s->log.module_levels = NULL;
2103 /* useful default, otherwise we get a port of 0 on redirects */
2104 s->port = main_server->port;
2105 s->next = NULL;
2106
2107 s->is_virtual = 1;
2108 s->names = apr_array_make(p, 4, sizeof(char **));
2109 s->wild_names = apr_array_make(p, 4, sizeof(char **));
2110
2111 s->module_config = create_empty_config(p);
2112 s->lookup_defaults = ap_create_per_dir_config(p);
2113
2114 s->limit_req_line = main_server->limit_req_line;
2115 s->limit_req_fieldsize = main_server->limit_req_fieldsize;
2116 s->limit_req_fields = main_server->limit_req_fields;
2117
2118 *ps = s;
2119
2120 return ap_parse_vhost_addrs(p, hostname, s);
2121}
2122
2123AP_DECLARE(struct ap_logconf *) ap_new_log_config(apr_pool_t *p,
2124 const struct ap_logconf *old)

Callers 1

virtualhost_sectionFunction · 0.85

Calls 3

create_empty_configFunction · 0.85
ap_create_per_dir_configFunction · 0.85
ap_parse_vhost_addrsFunction · 0.85

Tested by

no test coverage detected