Apache HTTPD
Typedefs | Functions | Variables
Virtual Host Package

Typedefs

typedef int(* ap_vhost_iterate_conn_cb) (void *baton, conn_rec *conn, server_rec *s)
 

Functions

 AP_DECLARE (void) ap_init_vhost_config(apr_pool_t *p)
 
const charap_parse_vhost_addrs (apr_pool_t *p, const char *hostname, server_rec *s)
 
 AP_DECLARE_NONSTD (const char *) ap_set_name_virtual_host(cmd_parms *cmd
 
 AP_DECLARE (int) ap_vhost_iterate_given_conn(conn_rec *conn
 

Variables

server_recmain_server
 
void * dummy
 
void const chararg
 
ap_vhost_iterate_conn_cb func_cb
 
ap_vhost_iterate_conn_cb void * baton
 
int require_match
 
const charhost
 
const char apr_port_t port
 

Detailed Description

Typedef Documentation

◆ ap_vhost_iterate_conn_cb

typedef int(* ap_vhost_iterate_conn_cb) (void *baton, conn_rec *conn, server_rec *s)

Callback function for every Name Based Virtual Host.

Parameters
batonOpaque user object
connThe current Connection
sThe current Server
See also
ap_vhost_iterate_given_conn
Returns
0 on success, any non-zero return will stop the iteration.

Definition at line 73 of file http_vhost.h.

Function Documentation

◆ AP_DECLARE() [1/2]

AP_DECLARE ( int  )

For every virtual host on this connection, call func_cb.

Parameters
connThe current connection
func_cbFunction called for every Name Based Virtual Host for this connection.
batonOpaque object passed to func_cb.
Returns
The return value from func_cb.
Note
If func_cb returns non-zero, the function will return at this point, and not continue iterating the virtual hosts.

Updates r->server with the best name-based virtual host match, within the chain of matching virtual hosts selected by ap_update_vhost_given_ip.

Parameters
rThe current request
require_match1 to return an HTTP error if the requested hostname is not explicitly matched to a VirtualHost.
Returns
return HTTP_OK unless require_match was specified and the requested hostname did not match any ServerName, ServerAlias, or VirtualHost address-spec.

Match the host in the header with the hostname of the server for this request.

Parameters
rThe current request
hostThe hostname in the headers
portThe port from the headers
Returns
return 1 if the host:port matches any of the aliases of r->server, return 0 otherwise

◆ AP_DECLARE() [2/2]

AP_DECLARE ( void  )

called before any config is read

Parameters
pPool to allocate out of

called after the config has been read to compile the tables needed to do the run-time vhost lookups

Parameters
pThe pool to allocate out of
main_serverThe start of the virtual host list

given an ip address only, give our best guess as to what vhost it is

Parameters
connThe current connection

ap_update_vhost_given_ip is never enough, and this is always called after the headers have been read. It may change r->server.

Parameters
rThe current request

◆ AP_DECLARE_NONSTD()

AP_DECLARE_NONSTD ( const char )

handle NameVirtualHost directive

Parameters
cmdCommand Parameters structure
dummyNOT USED
arga host of the form "<address>[:port]"

◆ ap_parse_vhost_addrs()

const char * ap_parse_vhost_addrs ( apr_pool_t p,
const char hostname,
server_rec s 
)

handle addresses in "<VirtualHost>" statement

Parameters
pThe pool to allocate out of
hostnameThe hostname in the VirtualHost statement
sThe list of Virtual Hosts.

Definition at line 242 of file vhost.c.

Variable Documentation

◆ arg

void const char* arg

Definition at line 63 of file http_vhost.h.

◆ baton

Definition at line 87 of file http_vhost.h.

◆ dummy

void* dummy

Definition at line 62 of file http_vhost.h.

◆ func_cb

Definition at line 86 of file http_vhost.h.

◆ host

const char* host

Definition at line 124 of file http_vhost.h.

◆ main_server

server_rec* main_server

Definition at line 45 of file http_vhost.h.

◆ port

Definition at line 125 of file http_vhost.h.

◆ require_match

int require_match

Definition at line 112 of file http_vhost.h.