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

Function ap_update_vhost_given_ip

server/vhost.c:1280–1311  ·  view source on GitHub ↗

Called for a new connection which has a known local_addr. Note that the * new connection is assumed to have conn->server == main server. */

Source from the content-addressed store, hash-verified

1278 * new connection is assumed to have conn->server == main server.
1279 */
1280AP_DECLARE(void) ap_update_vhost_given_ip(conn_rec *conn)
1281{
1282 ipaddr_chain *trav;
1283 apr_port_t port;
1284
1285 /* scan the hash table for an exact match first */
1286 trav = find_ipaddr(conn->local_addr);
1287
1288 if (trav) {
1289 /* save the name_chain for later in case this is a name-vhost */
1290 conn->vhost_lookup_data = trav->names;
1291 conn->base_server = trav->server;
1292 return;
1293 }
1294
1295 /* maybe there's a default server or wildcard name-based vhost
1296 * matching this port
1297 */
1298 port = conn->local_addr->port;
1299
1300 trav = find_default_server(port);
1301 if (trav) {
1302 conn->vhost_lookup_data = trav->names;
1303 conn->base_server = trav->server;
1304 return;
1305 }
1306
1307 /* otherwise we're stuck with just the main server
1308 * and no name-based vhosts
1309 */
1310 conn->vhost_lookup_data = NULL;
1311}

Callers 3

ap_process_connectionFunction · 0.85
process_socketFunction · 0.85
http_vhost.hFile · 0.85

Calls 2

find_ipaddrFunction · 0.85
find_default_serverFunction · 0.85

Tested by

no test coverage detected