expcov report - Generated Sat Oct 15 21:39:18 2016

 Index  Statistics  Last 
Directory./server
Filenamevhost.c
ModifiedWed Aug 11 04:11:40 2010

Pass Half Fail Excluded Total
Function
1
4.35%
22
95.65%
0
0.00%
23
100%
Expressions
4
0.81%
489
99.19%
0
0.00%
493
100%
Conditions
0
0.00%
0
0.00%
103
100.00%
0
0.00%
103
100%
MC/DC
0
0.00%
44
100.00%
0
0.00%
44
100%
Branches

if
0
0.00%
0
0.00%
77
100.00%
0
0.00%
77
100%
for
0
0.00%
0
0.00%
19
100.00%
0
0.00%
19
100%
while
0
0.00%
0
0.00%
3
100.00%
0
0.00%
3
100%
case
0
0.00%
0
0.00%
0
0.00%
0
0.00%
0
100%

1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements.  See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License.  You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * @file  vhost.c
19 * @brief functions pertaining to virtual host addresses
20 *        (configuration and run-time)
21 */
22
23#include "apr.h"
24#include "apr_strings.h"
25#include "apr_lib.h"
26
27#define APR_WANT_STRFUNC
28#include "apr_want.h"
29
30#define CORE_PRIVATE
31#include "ap_config.h"
32#include "httpd.h"
33#include "http_config.h"
34#include "http_log.h"
35#include "http_vhost.h"
36#include "http_protocol.h"
37#include "http_core.h"
38
39#if APR_HAVE_ARPA_INET_H
40#include <arpa/inet.h>
41#endif
42
43/*
44 * After all the definitions there's an explanation of how it's all put
45 * together.
46 */
47
48/* meta-list of name-vhosts.  Each server_rec can be in possibly multiple
49 * lists of name-vhosts.
50 */
51typedef struct name_chain name_chain;
52struct name_chain {
53    name_chain *next;
54    server_addr_rec *sar;       /* the record causing it to be in
55                                 * this chain (needed for port comparisons) */
56    server_rec *server;         /* the server to use on a match */
57};
58
59/* meta-list of ip addresses.  Each server_rec can be in possibly multiple
60 * hash chains since it can have multiple ips.
61 */
62typedef struct ipaddr_chain ipaddr_chain;
63struct ipaddr_chain {
64    ipaddr_chain *next;
65    server_addr_rec *sar;       /* the record causing it to be in
66                                 * this chain (need for both ip addr and port
67                                 * comparisons) */
68    server_rec *server;         /* the server to use if this matches */
69    name_chain *names;          /* if non-NULL then a list of name-vhosts
70                                 * sharing this address */
71};
72
73/* This defines the size of the hash table used for hashing ip addresses
74 * of virtual hosts.  It must be a power of two.
75 */
76#ifndef IPHASH_TABLE_SIZE
77#define IPHASH_TABLE_SIZE 256
78#endif
79
80/* A (n) bucket hash table, each entry has a pointer to a server rec and
81 * a pointer to the other entries in that bucket.  Each individual address,
82 * even for virtualhosts with multiple addresses, has an entry in this hash
83 * table.  There are extra buckets for _default_, and name-vhost entries.
84 *
85 * Note that after config time this is constant, so it is thread-safe.
86 */
87static ipaddr_chain *iphash_table[IPHASH_TABLE_SIZE];
88
89/* dump out statistics about the hash function */
90/* #define IPHASH_STATISTICS */
91
92/* list of the _default_ servers */
93static ipaddr_chain *default_list;
94
95/* list of the NameVirtualHost addresses */
96static server_addr_rec *name_vhost_list;
97static server_addr_rec **name_vhost_list_tail;
98
99/*
100 * How it's used:
101 *
102 * The ip address determines which chain in iphash_table is interesting, then
103 * a comparison is done down that chain to find the first ipaddr_chain whose
104 * sar matches the address:port pair.
105 *
106 * If that ipaddr_chain has names == NULL then you're done, it's an ip-vhost.
107 *
108 * Otherwise it's a name-vhost list, and the default is the server in the
109 * ipaddr_chain record.  We tuck away the ipaddr_chain record in the
110 * conn_rec field vhost_lookup_data.  Later on after the headers we get a
111 * second chance, and we use the name_chain to figure out what name-vhost
112 * matches the headers.
113 *
114 * If there was no ip address match in the iphash_table then do a lookup
115 * in the default_list.
116 *
117 * How it's put together ... well you should be able to figure that out
118 * from how it's used.  Or something like that.
119 */
120
121
122/* called at the beginning of the config */
123AP_DECLARE(void) ap_init_vhost_config : call=1
a
p_init_vhost_config(apr_pool_t *p)
124{
125    memset : enter=1, leave=1

memset : /usr/include/string.h line=65 column=14
m
emset(iphash_table : server/vhost.c line=87 column=22
i
phash_table, 0, sizeof(iphash_table));
126    default_list : server/vhost.c line=93 column=22
d
efault_list = : pass=1
=
 NULL;
127    name_vhost_list : server/vhost.c line=96 column=25
n
ame_vhost_list = : pass=1
=
 NULL;
128    name_vhost_list_tail : server/vhost.c line=97 column=26
n
ame_vhost_list_tail = : pass=1
=
 &name_vhost_list : server/vhost.c line=96 column=25
n
ame_vhost_list;
129}
130
131
132/*
133 * Parses a host of the form <address>[:port]
134 * paddr is used to create a list in the order of input
135 * **paddr is the ->next pointer of the last entry (or s->addrs)
136 * *paddr is the variable used to keep track of **paddr between calls
137 * port is the default port to assume
138 */
139static const char *get_addresses : call=0
g
et_addresses(apr_pool_t *p, const char *w_,
140                                 server_addr_rec ***paddr,
141                                 apr_port_t default_port)
142{
143    apr_sockaddr_t *my_addr;
144    server_addr_rec *sar;
145    char *w, *host, *scope_id;
146    int wild_port;
147    apr_size_t wlen;
148    apr_port_t port;
149    apr_status_t rv;
150
151    if : true=0, false=0
i
f (* dereference : enter=0, leave=0
*
w_ : server/vhost.c line=139 column=61
w
== : true=0, false=0
=
= '\0')
152        return : pass=0
r
eturn NULL;
153
154    w : server/vhost.c line=145 column=11
w
 = : pass=0
=
 apr_pstrdup : enter=0, leave=0

apr_pstrdup : /usr/include/apr-1/apr_strings.h line=95 column=21
a
pr_pstrdup(p : server/vhost.c line=139 column=46
p
w_ : server/vhost.c line=139 column=61
w
_);
155    /* apr_parse_addr_port() doesn't understand ":*" so handle that first. */
156    wlen : server/vhost.c line=147 column=16
w
len = : pass=0
=
 strlen : enter=0, leave=0

strlen : /usr/include/string.h line=399 column=15
s
trlen(w : server/vhost.c line=145 column=11
w
);                    /* wlen must be > 0 at this point */
157    wild_port : server/vhost.c line=146 column=9
w
ild_port = : pass=0
=
 0;
158    if : true=0, false=0
i
f (w : server/vhost.c line=145 column=11
w
[] : enter=0, leave=0
[
wlen : server/vhost.c line=147 column=16
w
len - : pass=0
-
 1] == : true=0, false=0
=
= '*') {
159        if : true=0, false=0
i
f (wlen : server/vhost.c line=147 column=16
w
len < : true=0, false=0
<
 2) {
160            wild_port : server/vhost.c line=146 column=9
w
ild_port = : pass=0
=
 1;
161        }
162        else if : true=0, false=0
i
f (w : server/vhost.c line=145 column=11
w
[] : enter=0, leave=0
[
wlen : server/vhost.c line=147 column=16
w
len - : pass=0
-
 2] == : true=0, false=0
=
= ':') {
163            w : server/vhost.c line=145 column=11
w
[wlen : server/vhost.c line=147 column=16
w
len - : pass=0
-
 2] = : enter=0, leave=0
=
 '\0';
164            wild_port : server/vhost.c line=146 column=9
w
ild_port = : pass=0
=
 1;
165        }
166    }
167    rv : server/vhost.c line=149 column=18
r
= : pass=0
=
 apr_parse_addr_port : enter=0, leave=0

apr_parse_addr_port : /usr/include/apr-1/apr_network_io.h line=420 column=27
a
pr_parse_addr_port(&host : server/vhost.c line=145 column=15
h
ost, &scope_id : server/vhost.c line=145 column=22
s
cope_id, &port : server/vhost.c line=148 column=16
p
ort, w : server/vhost.c line=145 column=11
w
p : server/vhost.c line=139 column=46
p
);
168    /* If the string is "80", apr_parse_addr_port() will be happy and set
169     * host to NULL and port to 80, so watch out for that.
170     */
171    if : true=0, false=0
i
f (rv : server/vhost.c line=149 column=18
r
!= : true=0, false=0
!
= APR_SUCCESS) {
172        return : pass=0
r
eturn "The address or port is invalid";
173    }
174    if : true=0, false=0
i
f (! : true=0, false=0
!
host : server/vhost.c line=145 column=15
h
ost) {
175        return : pass=0
r
eturn "Missing address for VirtualHost";
176    }
177    if : true=0, false=0
i
f (scope_id : server/vhost.c line=145 column=22
s
cope_id) {
178        return : pass=0
r
eturn "Scope ids are not supported";
179    }
180    if : true=0, false=0
i
f (! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
port : server/vhost.c line=148 column=16
p
ort && : true=0, false=0
&
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
wild_port : server/vhost.c line=146 column=9
w
ild_port) {
181        port : server/vhost.c line=148 column=16
p
ort = : pass=0
=
 default_port : server/vhost.c line=141 column=45
d
efault_port;
182    }
183
184    if : true=0, false=0
i
f (strcmp : enter=0, leave=0

strcmp : /usr/include/string.h line=143 column=12
s
trcmp(host : server/vhost.c line=145 column=15
h
ost, "*") == : true=0, false=0
=
= 0) {
185        rv : server/vhost.c line=149 column=18
r
= : pass=0
=
 apr_sockaddr_info_get : enter=0, leave=0

apr_sockaddr_info_get : /usr/include/apr-1/apr_network_io.h line=373 column=27
a
pr_sockaddr_info_get(&my_addr : server/vhost.c line=143 column=21
m
y_addr, "0.0.0.0", APR_INET, port : server/vhost.c line=148 column=16
p
ort, 0, p : server/vhost.c line=139 column=46
p
);
186        if : true=0, false=0
i
f (rv : server/vhost.c line=149 column=18
r
v) {
187            return : pass=0
r
eturn "Could not resolve address '0.0.0.0' -- "
188                "check resolver configuration.";
189        }
190    }
191    else if : true=0, false=0
i
f (strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(host : server/vhost.c line=145 column=15
h
ost, "_default_") == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= 0
192        || : true=0, false=0
|
strcmp : enter=0, leave=0

strcmp : /usr/include/string.h line=143 column=12
s
trcmp(host : server/vhost.c line=145 column=15
h
ost, "255.255.255.255") == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= 0) {
193        rv : server/vhost.c line=149 column=18
r
= : pass=0
=
 apr_sockaddr_info_get : enter=0, leave=0

apr_sockaddr_info_get : /usr/include/apr-1/apr_network_io.h line=373 column=27
a
pr_sockaddr_info_get(&my_addr : server/vhost.c line=143 column=21
m
y_addr, "255.255.255.255", APR_INET, port : server/vhost.c line=148 column=16
p
ort, 0, p : server/vhost.c line=139 column=46
p
);
194        if : true=0, false=0
i
f (rv : server/vhost.c line=149 column=18
r
v) {
195            return : pass=0
r
eturn "Could not resolve address '255.255.255.255' -- "
196                "check resolver configuration.";
197        }
198    }
199    else {
200        rv : server/vhost.c line=149 column=18
r
= : pass=0
=
 apr_sockaddr_info_get : enter=0, leave=0

apr_sockaddr_info_get : /usr/include/apr-1/apr_network_io.h line=373 column=27
a
pr_sockaddr_info_get(&my_addr : server/vhost.c line=143 column=21
m
y_addr, host : server/vhost.c line=145 column=15
h
ost, APR_UNSPEC, port : server/vhost.c line=148 column=16
p
ort, 0, p : server/vhost.c line=139 column=46
p
);
201        if : true=0, false=0
i
f (rv : server/vhost.c line=149 column=18
r
!= : true=0, false=0
!
= APR_SUCCESS) {
202            ap_log_error : enter=0, leave=0

ap_log_error : include/http_log.h line=171 column=18
a
p_log_error(APLOG_MARK, APLOG_ERR, rv : server/vhost.c line=149 column=18
r
v, NULL,
203                "Could not resolve host name %s -- ignoring!", host : server/vhost.c line=145 column=15
h
ost);
204            return : pass=0
r
eturn NULL;
205        }
206    }
207
208    /* Remember all addresses for the host */
209
210    do {
211        sar : server/vhost.c line=144 column=22
s
ar = : pass=0
=
 apr_pcalloc(p : server/vhost.c line=139 column=46
p
, sizeof(server_addr_rec));
212        ** dereference : enter=0, leave=0
*
paddr : server/vhost.c line=140 column=53
p
addr = : enter=0, leave=0
=
 sar : server/vhost.c line=144 column=22
s
ar;
213        *paddr : server/vhost.c line=140 column=53
p
addr = : enter=0, leave=0
=
 &sar : server/vhost.c line=144 column=22
s
ar-> : enter=0, leave=0
-
>next : include/httpd.h line=1160 column=22
n
ext;
214        sar : server/vhost.c line=144 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr = : enter=0, leave=0
=
 my_addr : server/vhost.c line=143 column=21
m
y_addr;
215        sar : server/vhost.c line=144 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port = : enter=0, leave=0
=
 port : server/vhost.c line=148 column=16
p
ort;
216        sar : server/vhost.c line=144 column=22
s
ar-> : enter=0, leave=0
-
>virthost : include/httpd.h line=1166 column=11
v
irthost = : enter=0, leave=0
=
 host : server/vhost.c line=145 column=15
h
ost;
217        my_addr : server/vhost.c line=143 column=21
m
y_addr = : pass=0
=
 my_addr : server/vhost.c line=143 column=21
m
y_addr-> : enter=0, leave=0
-
>next : /usr/include/apr-1/apr_network_io.h line=234 column=21 next;
218    } while : true=0, false=0
w
hile (my_addr : server/vhost.c line=143 column=21
m
y_addr);
219
220    return : pass=0
r
eturn NULL;
221}
222
223
224/* parse the <VirtualHost> addresses */
225const char *ap_parse_vhost_addrs : call=0
a
p_parse_vhost_addrs(apr_pool_t *p,
226                                 const char *hostname,
227                                 server_rec *s)
228{
229    server_addr_rec **addrs;
230    const char *err;
231
232    /* start the list of addreses */
233    addrs : server/vhost.c line=229 column=23
a
ddrs = : pass=0
=
 &s : server/vhost.c line=227 column=46
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs;
234    while : true=0, false=0
w
hile (hostname : server/vhost.c line=226 column=46
h
ostname[] : enter=0, leave=0
[
0]) {
235        err : server/vhost.c line=230 column=17
e
rr = : pass=0
=
 get_addresses : enter=0, leave=0

get_addresses : server/vhost.c line=139 column=20
g
et_addresses(p : server/vhost.c line=225 column=46
p
ap_getword_conf : enter=0, leave=0

ap_getword_conf : include/httpd.h line=1358 column=20
a
p_getword_conf(p : server/vhost.c line=225 column=46
p
, &hostname : server/vhost.c line=226 column=46
h
ostname), &addrs : server/vhost.c line=229 column=23
a
ddrs, s : server/vhost.c line=227 column=46
s
-> : enter=0, leave=0
-
>port : include/httpd.h line=1190 column=16
p
ort);
236        if : true=0, false=0
i
f (err : server/vhost.c line=230 column=17
e
rr) {
237            *addrs : server/vhost.c line=229 column=23
a
ddrs = : enter=0, leave=0
=
 NULL;
238            return : pass=0
r
eturn err : server/vhost.c line=230 column=17
e
rr;
239        }
240    }
241    /* terminate the list */
242    *addrs : server/vhost.c line=229 column=23
a
ddrs = : enter=0, leave=0
=
 NULL;
243    if : true=0, false=0
i
f (s : server/vhost.c line=227 column=46
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs) {
244        if : true=0, false=0
i
f (s : server/vhost.c line=227 column=46
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port) {
245            /* override the default port which is inherited from main_server */
246            s : server/vhost.c line=227 column=46
s
-> : enter=0, leave=0
-
>port : include/httpd.h line=1190 column=16
p
ort = : enter=0, leave=0
=
 s : server/vhost.c line=227 column=46
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port;
247        }
248    }
249    return : pass=0
r
eturn NULL;
250}
251
252
253const char *ap_set_name_virtual_host : call=0
a
p_set_name_virtual_host(cmd_parms *cmd, void *dummy,
254                                     const char *arg)
255{
256    /* use whatever port the main server has at this point */
257    return : pass=0
r
eturn get_addresses : enter=0, leave=0

get_addresses : server/vhost.c line=139 column=20
g
et_addresses(cmd : server/vhost.c line=253 column=49
c
md-> : enter=0, leave=0
-
>pool : include/http_config.h line=291 column=17
p
ool, arg : server/vhost.c line=254 column=50
a
rg, &name_vhost_list_tail : server/vhost.c line=97 column=26
n
ame_vhost_list_tail,
258                         cmd : server/vhost.c line=253 column=49
c
md-> : enter=0, leave=0
-
>server : include/http_config.h line=296 column=17
s
erver-> : enter=0, leave=0
-
>port : include/httpd.h line=1190 column=16
p
ort);
259}
260
261
262/* hash table statistics, keep this in here for the beta period so
263 * we can find out if the hash function is ok
264 */
265#ifdef IPHASH_STATISTICS
266static int iphash_compare(const void *a, const void *b)
267{
268    return (*(const int *) b - *(const int *) a);
269}
270
271
272static void dump_iphash_statistics(server_rec *main_s)
273{
274    unsigned count[IPHASH_TABLE_SIZE];
275    int i;
276    ipaddr_chain *src;
277    unsigned total;
278    char buf[HUGE_STRING_LEN];
279    char *p;
280
281    total = 0;
282    for (i = 0; i < IPHASH_TABLE_SIZE; ++i) {
283        count[i] = 0;
284        for (src = iphash_table[i]; src; src = src->next) {
285            ++count[i];
286            if (i < IPHASH_TABLE_SIZE) {
287                /* don't count the slop buckets in the total */
288                ++total;
289            }
290        }
291    }
292    qsort(count, IPHASH_TABLE_SIZE, sizeof(count[0]), iphash_compare);
293    p = buf + apr_snprintf(buf, sizeof(buf),
294                           "iphash: total hashed = %u, avg chain = %u, "
295                           "chain lengths (count x len):",
296                           total, total / IPHASH_TABLE_SIZE);
297    total = 1;
298    for (i = 1; i < IPHASH_TABLE_SIZE; ++i) {
299        if (count[i - 1] != count[i]) {
300            p += apr_snprintf(p, sizeof(buf) - (p - buf), " %ux%u",
301                              total, count[i - 1]);
302            total = 1;
303        }
304        else {
305            ++total;
306        }
307    }
308    p += apr_snprintf(p, sizeof(buf) - (p - buf), " %ux%u",
309                      total, count[IPHASH_TABLE_SIZE - 1]);
310    ap_log_error(APLOG_MARK, APLOG_DEBUG, main_s, buf);
311}
312#endif
313
314
315/* This hashing function is designed to get good distribution in the cases
316 * where the server is handling entire "networks" of servers.  i.e. a
317 * whack of /24s.  This is probably the most common configuration for
318 * ISPs with large virtual servers.
319 *
320 * NOTE: This function is symmetric (i.e. collapses all 4 octets
321 * into one), so machine byte order (big/little endianness) does not matter.
322 *
323 * Hash function provided by David Hankins.
324 */
325static APR_INLINE unsigned hash_inaddr : call=0
h
ash_inaddr(unsigned key)
326{
327    key : server/vhost.c line=325 column=49
k
ey ^= : pass=0
^
= (key : server/vhost.c line=325 column=49
k
ey >> : pass=0
>
> 16);
328    return : pass=0
r
eturn ((key : server/vhost.c line=325 column=49
k
ey >> : pass=0
>
> 8) ^ : pass=0
^
 key : server/vhost.c line=325 column=49
k
ey) % : pass=0
%
 IPHASH_TABLE_SIZE;
329}
330
331static APR_INLINE unsigned hash_addr : call=0
h
ash_addr(struct apr_sockaddr_t *sa)
332{
333    unsigned key;
334
335    /* The key is the last four bytes of the IP address.
336     * For IPv4, this is the entire address, as always.
337     * For IPv6, this is usually part of the MAC address.
338     */
339    key : server/vhost.c line=333 column=14
k
ey = : pass=0
=
 * dereference : enter=0, leave=0
*
(unsigned *)((char *)sa : server/vhost.c line=331 column=61
s
a-> : enter=0, leave=0
-
>ipaddr_ptr : /usr/include/apr-1/apr_network_io.h line=231 column=11 ipaddr_ptr + : pass=0
+
 sa : server/vhost.c line=331 column=61
s
a-> : enter=0, leave=0
-
>ipaddr_len : /usr/include/apr-1/apr_network_io.h line=225 column=9 ipaddr_len - : pass=0
-
 4);
340    return : pass=0
r
eturn hash_inaddr : enter=0, leave=0

hash_inaddr : server/vhost.c line=325 column=28
h
ash_inaddr(key : server/vhost.c line=333 column=14
k
ey);
341}
342
343static ipaddr_chain *new_ipaddr_chain : call=0
n
ew_ipaddr_chain(apr_pool_t *p,
344                                      server_rec *s, server_addr_rec *sar)
345{
346    ipaddr_chain *new;
347
348    new : server/vhost.c line=346 column=19
n
ew = : pass=0
=
 apr_palloc : enter=0, leave=0

apr_palloc : /usr/include/apr-1/apr_pools.h line=419 column=21
a
pr_palloc(p : server/vhost.c line=343 column=51
p
, sizeof(*new));
349    new : server/vhost.c line=346 column=19
n
ew-> : enter=0, leave=0
-
>names : server/vhost.c line=69 column=17
n
ames = : enter=0, leave=0
=
 NULL;
350    new : server/vhost.c line=346 column=19
n
ew-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver = : enter=0, leave=0
=
 s : server/vhost.c line=344 column=51
s
;
351    new : server/vhost.c line=346 column=19
n
ew-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar = : enter=0, leave=0
=
 sar : server/vhost.c line=344 column=71
s
ar;
352    new : server/vhost.c line=346 column=19
n
ew-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext = : enter=0, leave=0
=
 NULL;
353    return : pass=0
r
eturn new : server/vhost.c line=346 column=19
n
ew;
354}
355
356
357static name_chain *new_name_chain : call=0
n
ew_name_chain(apr_pool_t *p,
358                                  server_rec *s, server_addr_rec *sar)
359{
360    name_chain *new;
361
362    new : server/vhost.c line=360 column=17
n
ew = : pass=0
=
 apr_palloc : enter=0, leave=0

apr_palloc : /usr/include/apr-1/apr_pools.h line=419 column=21
a
pr_palloc(p : server/vhost.c line=357 column=47
p
, sizeof(*new));
363    new : server/vhost.c line=360 column=17
n
ew-> : enter=0, leave=0
-
>server : server/vhost.c line=56 column=17
s
erver = : enter=0, leave=0
=
 s : server/vhost.c line=358 column=47
s
;
364    new : server/vhost.c line=360 column=17
n
ew-> : enter=0, leave=0
-
>sar : server/vhost.c line=54 column=22
s
ar = : enter=0, leave=0
=
 sar : server/vhost.c line=358 column=67
s
ar;
365    new : server/vhost.c line=360 column=17
n
ew-> : enter=0, leave=0
-
>next : server/vhost.c line=53 column=17
n
ext = : enter=0, leave=0
=
 NULL;
366    return : pass=0
r
eturn new : server/vhost.c line=360 column=17
n
ew;
367}
368
369
370static APR_INLINE ipaddr_chain *find_ipaddr : call=0
f
ind_ipaddr(apr_sockaddr_t *sa)
371{
372    unsigned bucket;
373    ipaddr_chain *trav;
374
375    /* scan the hash table for an exact match first */
376    bucket : server/vhost.c line=372 column=14
b
ucket = : pass=0
=
 hash_addr : enter=0, leave=0

hash_addr : server/vhost.c line=331 column=28
h
ash_addr(sa : server/vhost.c line=370 column=61
s
a);
377    for : true=0, false=0
f
or (trav : server/vhost.c line=373 column=19
t
rav = : pass=0
=
 iphash_table : server/vhost.c line=87 column=22
i
phash_table[] : enter=0, leave=0
[
bucket : server/vhost.c line=372 column=14
b
ucket]; trav : server/vhost.c line=373 column=19
t
rav; trav : server/vhost.c line=373 column=19
t
rav = : pass=0
=
 trav : server/vhost.c line=373 column=19
t
rav-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext) {
378        server_addr_rec *sar = trav : server/vhost.c line=373 column=19
t
rav-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar;
379        apr_sockaddr_t *cur = sar : server/vhost.c line=378 column=26
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr;
380
381        if : true=0, false=0
i
f (cur : server/vhost.c line=379 column=25
c
ur-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= 0 || : true=0, false=0
|
sa : server/vhost.c line=370 column=61
s
a-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= 0 || : true=0, false=0
|
cur : server/vhost.c line=379 column=25
c
ur-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
sa : server/vhost.c line=370 column=61
s
a-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port) {
382            if : true=0, false=0
i
f (apr_sockaddr_equal : enter=0, leave=0

apr_sockaddr_equal : /usr/include/apr-1/apr_network_io.h line=696 column=18
a
pr_sockaddr_equal(cur : server/vhost.c line=379 column=25
c
ur, sa : server/vhost.c line=370 column=61
s
a)) {
383                return : pass=0
r
eturn trav : server/vhost.c line=373 column=19
t
rav;
384            }
385        }
386    }
387    return : pass=0
r
eturn NULL;
388}
389
390static ipaddr_chain *find_default_server : call=0
f
ind_default_server(apr_port_t port)
391{
392    server_addr_rec *sar;
393    ipaddr_chain *trav;
394
395    for : true=0, false=0
f
or (trav : server/vhost.c line=393 column=19
t
rav = : pass=0
=
 default_list : server/vhost.c line=93 column=22
d
efault_list; trav : server/vhost.c line=393 column=19
t
rav; trav : server/vhost.c line=393 column=19
t
rav = : pass=0
=
 trav : server/vhost.c line=393 column=19
t
rav-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext) {
396        sar : server/vhost.c line=392 column=22
s
ar = : pass=0
=
 trav : server/vhost.c line=393 column=19
t
rav-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar;
397        if : true=0, false=0
i
f (sar : server/vhost.c line=392 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= 0 || : true=0, false=0
|
sar : server/vhost.c line=392 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
port : server/vhost.c line=390 column=53
p
ort) {
398            /* match! */
399            return : pass=0
r
eturn trav : server/vhost.c line=393 column=19
t
rav;
400        }
401    }
402    return : pass=0
r
eturn NULL;
403}
404
405static void dump_a_vhost : call=0
d
ump_a_vhost(apr_file_t *f, ipaddr_chain *ic)
406{
407    name_chain *nc;
408    int len;
409    char buf[MAX_STRING_LEN];
410    apr_sockaddr_t *ha = ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr;
411
412    if : true=0, false=0
i
f (ha : server/vhost.c line=410 column=21
h
a-> : enter=0, leave=0
-
>family : /usr/include/apr-1/apr_network_io.h line=221 column=17 family == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= APR_INET && : true=0, false=0
&
&
413        ha : server/vhost.c line=410 column=21
h
a-> : enter=0, leave=0
-
>sa : /usr/include/apr-1/apr_network_io.h line=248 column=7 sa.sin : /usr/include/apr-1/apr_network_io.h line=238 column=28 sin.sin_addr : /usr/include/netinet/in.h line=243 column=20 sin_addr.s_addr : /usr/include/netinet/in.h line=35 column=15 s_addr == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= DEFAULT_VHOST_ADDR) {
414        len : server/vhost.c line=408 column=9
l
en = : pass=0
=
 apr_snprintf : enter=0, leave=0

apr_snprintf : /usr/include/apr-1/apr_strings.h line=261 column=25
a
pr_snprintf(buf : server/vhost.c line=409 column=10
b
uf, sizeof(buf), "_default_:%u",
415                           ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
416    }
417    else if : true=0, false=0
i
f (ha : server/vhost.c line=410 column=21
h
a-> : enter=0, leave=0
-
>family : /usr/include/apr-1/apr_network_io.h line=221 column=17 family == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= APR_INET && : true=0, false=0
&
&
418             ha : server/vhost.c line=410 column=21
h
a-> : enter=0, leave=0
-
>sa : /usr/include/apr-1/apr_network_io.h line=248 column=7 sa.sin : /usr/include/apr-1/apr_network_io.h line=238 column=28 sin.sin_addr : /usr/include/netinet/in.h line=243 column=20 sin_addr.s_addr : /usr/include/netinet/in.h line=35 column=15 s_addr == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= INADDR_ANY) {
419        len : server/vhost.c line=408 column=9
l
en = : pass=0
=
 apr_snprintf : enter=0, leave=0

apr_snprintf : /usr/include/apr-1/apr_strings.h line=261 column=25
a
pr_snprintf(buf : server/vhost.c line=409 column=10
b
uf, sizeof(buf), "*:%u",
420                           ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
421    }
422    else {
423        len : server/vhost.c line=408 column=9
l
en = : pass=0
=
 apr_snprintf : enter=0, leave=0

apr_snprintf : /usr/include/apr-1/apr_strings.h line=261 column=25
a
pr_snprintf(buf : server/vhost.c line=409 column=10
b
uf, sizeof(buf), "%pI", ha : server/vhost.c line=410 column=21
h
a);
424    }
425    if : true=0, false=0
i
f (ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port == : true=0, false=0
=
= 0) {
426        buf : server/vhost.c line=409 column=10
b
uf[len : server/vhost.c line=408 column=9
l
en- : pass=0
-
1] = : enter=0, leave=0
=
 '*';
427    }
428    if : true=0, false=0
i
f (ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>names : server/vhost.c line=69 column=17
n
ames == : true=0, false=0
=
= NULL) {
429        apr_file_printf : enter=0, leave=0

apr_file_printf : /usr/include/apr-1/apr_file_io.h line=759 column=25
a
pr_file_printf(f : server/vhost.c line=405 column=38
f
, "%-22s %s (%s:%u)\n", buf : server/vhost.c line=409 column=10
b
uf,
430                        ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname,
431                        ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver-> : enter=0, leave=0
-
>defn_name : include/httpd.h line=1179 column=17
d
efn_name, ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver-> : enter=0, leave=0
-
>defn_line_number : include/httpd.h line=1181 column=14
d
efn_line_number);
432        return : pass=0
r
eturn;
433    }
434    apr_file_printf : enter=0, leave=0

apr_file_printf : /usr/include/apr-1/apr_file_io.h line=759 column=25
a
pr_file_printf(f : server/vhost.c line=405 column=38
f
, "%-22s is a NameVirtualHost\n"
435                    "%8s default server %s (%s:%u)\n",
436                    buf : server/vhost.c line=409 column=10
b
uf, "", ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname,
437                    ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver-> : enter=0, leave=0
-
>defn_name : include/httpd.h line=1179 column=17
d
efn_name, ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver-> : enter=0, leave=0
-
>defn_line_number : include/httpd.h line=1181 column=14
d
efn_line_number);
438    for : true=0, false=0
f
or (nc : server/vhost.c line=407 column=17
n
= : pass=0
=
 ic : server/vhost.c line=405 column=55
i
c-> : enter=0, leave=0
-
>names : server/vhost.c line=69 column=17
n
ames; nc : server/vhost.c line=407 column=17
n
c; nc : server/vhost.c line=407 column=17
n
= : pass=0
=
 nc : server/vhost.c line=407 column=17
n
c-> : enter=0, leave=0
-
>next : server/vhost.c line=53 column=17
n
ext) {
439        if : true=0, false=0
i
f (nc : server/vhost.c line=407 column=17
n
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=54 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port) {
440            apr_file_printf : enter=0, leave=0

apr_file_printf : /usr/include/apr-1/apr_file_io.h line=759 column=25
a
pr_file_printf(f : server/vhost.c line=405 column=38
f
, "%8s port %u ", "", nc : server/vhost.c line=407 column=17
n
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=54 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
441        }
442        else {
443            apr_file_printf : enter=0, leave=0

apr_file_printf : /usr/include/apr-1/apr_file_io.h line=759 column=25
a
pr_file_printf(f : server/vhost.c line=405 column=38
f
, "%8s port * ", "");
444        }
445        apr_file_printf : enter=0, leave=0

apr_file_printf : /usr/include/apr-1/apr_file_io.h line=759 column=25
a
pr_file_printf(f : server/vhost.c line=405 column=38
f
, "namevhost %s (%s:%u)\n",
446                        nc : server/vhost.c line=407 column=17
n
c-> : enter=0, leave=0
-
>server : server/vhost.c line=56 column=17
s
erver-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname,
447                        nc : server/vhost.c line=407 column=17
n
c-> : enter=0, leave=0
-
>server : server/vhost.c line=56 column=17
s
erver-> : enter=0, leave=0
-
>defn_name : include/httpd.h line=1179 column=17
d
efn_name, nc : server/vhost.c line=407 column=17
n
c-> : enter=0, leave=0
-
>server : server/vhost.c line=56 column=17
s
erver-> : enter=0, leave=0
-
>defn_line_number : include/httpd.h line=1181 column=14
d
efn_line_number);
448    }
449}
450
451static void dump_vhost_config : call=0
d
ump_vhost_config(apr_file_t *f)
452{
453    ipaddr_chain *ic;
454    int i;
455
456    apr_file_printf : enter=0, leave=0

apr_file_printf : /usr/include/apr-1/apr_file_io.h line=759 column=25
a
pr_file_printf(f : server/vhost.c line=451 column=43
f
, "VirtualHost configuration:\n");
457    for : true=0, false=0
f
or (i : server/vhost.c line=454 column=9
i
 = : pass=0
=
 0; i : server/vhost.c line=454 column=9
i
 < : true=0, false=0
<
 IPHASH_TABLE_SIZE; ++ : pass=0
+
+i : server/vhost.c line=454 column=9
i
) {
458        for : true=0, false=0
f
or (ic : server/vhost.c line=453 column=19
i
= : pass=0
=
 iphash_table : server/vhost.c line=87 column=22
i
phash_table[] : enter=0, leave=0
[
i : server/vhost.c line=454 column=9
i
]; ic : server/vhost.c line=453 column=19
i
c; ic : server/vhost.c line=453 column=19
i
= : pass=0
=
 ic : server/vhost.c line=453 column=19
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext) {
459            dump_a_vhost : enter=0, leave=0

dump_a_vhost : server/vhost.c line=405 column=13
d
ump_a_vhost(f : server/vhost.c line=451 column=43
f
ic : server/vhost.c line=453 column=19
i
c);
460        }
461    }
462    if : true=0, false=0
i
f (default_list : server/vhost.c line=93 column=22
d
efault_list) {
463        apr_file_printf : enter=0, leave=0

apr_file_printf : /usr/include/apr-1/apr_file_io.h line=759 column=25
a
pr_file_printf(f : server/vhost.c line=451 column=43
f
, "wildcard NameVirtualHosts and _default_ servers:\n");
464        for : true=0, false=0
f
or (ic : server/vhost.c line=453 column=19
i
= : pass=0
=
 default_list : server/vhost.c line=93 column=22
d
efault_list; ic : server/vhost.c line=453 column=19
i
c; ic : server/vhost.c line=453 column=19
i
= : pass=0
=
 ic : server/vhost.c line=453 column=19
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext) {
465            dump_a_vhost : enter=0, leave=0

dump_a_vhost : server/vhost.c line=405 column=13
d
ump_a_vhost(f : server/vhost.c line=451 column=43
f
ic : server/vhost.c line=453 column=19
i
c);
466        }
467    }
468}
469
470/*
471 * Two helper functions for ap_fini_vhost_config()
472 */
473static int add_name_vhost_config : call=0
a
dd_name_vhost_config(apr_pool_t *p, server_rec *main_s,
474                                 server_rec *s, server_addr_rec *sar,
475                                 ipaddr_chain *ic)
476{
477    /* the first time we encounter a NameVirtualHost address
478     * ic->server will be NULL, on subsequent encounters
479     * ic->names will be non-NULL.
480     */
481    if : true=0, false=0
i
f (ic : server/vhost.c line=475 column=48
i
cMC/DC independently affect : true=0, false=0
-> : enter=0, leave=0
-TF
>names : server/vhost.c line=69 column=17
n
ames || : true=0, false=0
|
ic : server/vhost.c line=475 column=48
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= NULL) {
482        name_chain *nc = new_name_chain : enter=0, leave=0

new_name_chain : server/vhost.c line=357 column=20
n
ew_name_chain(p : server/vhost.c line=473 column=46
p
s : server/vhost.c line=474 column=46
s
sar : server/vhost.c line=474 column=66
s
ar);
483        nc : server/vhost.c line=482 column=21
n
c-> : enter=0, leave=0
-
>next : server/vhost.c line=53 column=17
n
ext = : enter=0, leave=0
=
 ic : server/vhost.c line=475 column=48
i
c-> : enter=0, leave=0
-
>names : server/vhost.c line=69 column=17
n
ames;
484        ic : server/vhost.c line=475 column=48
i
c-> : enter=0, leave=0
-
>names : server/vhost.c line=69 column=17
n
ames = : enter=0, leave=0
=
 nc : server/vhost.c line=482 column=21
n
c;
485        ic : server/vhost.c line=475 column=48
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver = : enter=0, leave=0
=
 s : server/vhost.c line=474 column=46
s
;
486        if : true=0, false=0
i
f (sar : server/vhost.c line=474 column=66
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port != : true=0, false=0
!
ic : server/vhost.c line=475 column=48
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port) {
487            /* one of the two is a * port, the other isn't */
488            ap_log_error : enter=0, leave=0

ap_log_error : include/http_log.h line=171 column=18
a
p_log_error(APLOG_MARK, APLOG_ERR, 0, main_s : server/vhost.c line=473 column=61
m
ain_s,
489                         "VirtualHost %s:%u -- mixing * "
490                         "ports and non-* ports with "
491                         "a NameVirtualHost address is not supported,"
492                         " proceeding with undefined results",
493                         sar : server/vhost.c line=474 column=66
s
ar-> : enter=0, leave=0
-
>virthost : include/httpd.h line=1166 column=11
v
irthost, sar : server/vhost.c line=474 column=66
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
494        }
495        return : pass=0
r
eturn 1;
496    }
497    else {
498        /* IP-based vhosts are handled by the caller */
499        return : pass=0
r
eturn 0;
500    }
501}
502
503static void remove_unused_name_vhosts : call=0
r
emove_unused_name_vhosts(server_rec *main_s, ipaddr_chain **pic)
504{
505    while : true=0, false=0
w
hile (* dereference : enter=0, leave=0
*
pic : server/vhost.c line=503 column=74
p
ic) {
506        ipaddr_chain *ic = * dereference : enter=0, leave=0
*
pic : server/vhost.c line=503 column=74
p
ic;
507
508        if : true=0, false=0
i
f (ic : server/vhost.c line=506 column=23
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver == : true=0, false=0
=
= NULL) {
509            ap_log_error : enter=0, leave=0

ap_log_error : include/http_log.h line=171 column=18
a
p_log_error(APLOG_MARK, APLOG_WARNING, 0, main_s : server/vhost.c line=503 column=51
m
ain_s,
510                         "NameVirtualHost %s:%u has no VirtualHosts",
511                         ic : server/vhost.c line=506 column=23
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>virthost : include/httpd.h line=1166 column=11
v
irthost, ic : server/vhost.c line=506 column=23
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
512            *pic : server/vhost.c line=503 column=74
p
ic = : enter=0, leave=0
=
 ic : server/vhost.c line=506 column=23
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext;
513        }
514        else {
515            pic : server/vhost.c line=503 column=74
p
ic = : pass=0
=
 &ic : server/vhost.c line=506 column=23
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext;
516        }
517    }
518}
519
520/* compile the tables and such we need to do the run-time vhost lookups */
521AP_DECLARE(void) ap_fini_vhost_config : call=0
a
p_fini_vhost_config(apr_pool_t *p, server_rec *main_s)
522{
523    server_addr_rec *sar;
524    int has_default_vhost_addr;
525    server_rec *s;
526    int i;
527    ipaddr_chain **iphash_table_tail[IPHASH_TABLE_SIZE];
528
529    /* terminate the name_vhost list */
530    *name_vhost_list_tail : server/vhost.c line=97 column=26
n
ame_vhost_list_tail = : enter=0, leave=0
=
 NULL;
531
532    /* Main host first */
533    s : server/vhost.c line=525 column=17
s
 = : pass=0
=
 main_s : server/vhost.c line=521 column=66
m
ain_s;
534
535    if : true=0, false=0
i
f (! : true=0, false=0
!
s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname) {
536        s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname = : enter=0, leave=0
=
 ap_get_local_host : enter=0, leave=0

ap_get_local_host : include/httpd.h line=1829 column=7
a
p_get_local_host(p : server/vhost.c line=521 column=51
p
);
537    }
538
539    /* initialize the tails */
540    for : true=0, false=0
f
or (i : server/vhost.c line=526 column=9
i
 = : pass=0
=
 0; i : server/vhost.c line=526 column=9
i
 < : true=0, false=0
<
 IPHASH_TABLE_SIZE; ++ : pass=0
+
+i : server/vhost.c line=526 column=9
i
) {
541        iphash_table_tail : server/vhost.c line=527 column=20
i
phash_table_tail[i : server/vhost.c line=526 column=9
i
= : enter=0, leave=0
=
 &iphash_table : server/vhost.c line=87 column=22
i
phash_table[] : enter=0, leave=0
[
i : server/vhost.c line=526 column=9
i
];
542    }
543
544    /* The first things to go into the hash table are the NameVirtualHosts
545     * Since name_vhost_list is in the same order that the directives
546     * occured in the config file, we'll copy it in that order.
547     */
548    for : true=0, false=0
f
or (sar : server/vhost.c line=523 column=22
s
ar = : pass=0
=
 name_vhost_list : server/vhost.c line=96 column=25
n
ame_vhost_list; sar : server/vhost.c line=523 column=22
s
ar; sar : server/vhost.c line=523 column=22
s
ar = : pass=0
=
 sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>next : include/httpd.h line=1160 column=22
n
ext) {
549        char inaddr_any[16] = {0}; /* big enough to handle IPv4 or IPv6 */
550        unsigned bucket = hash_addr : enter=0, leave=0

hash_addr : server/vhost.c line=331 column=28
h
ash_addr(sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr);
551        ipaddr_chain *ic = new_ipaddr_chain : enter=0, leave=0

new_ipaddr_chain : server/vhost.c line=343 column=22
n
ew_ipaddr_chain(p : server/vhost.c line=521 column=51
p
, NULL, sar : server/vhost.c line=523 column=22
s
ar);
552
553        if : true=0, false=0
i
f (memcmp : enter=0, leave=0

memcmp : /usr/include/string.h line=68 column=12
m
emcmp(sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr-> : enter=0, leave=0
-
>ipaddr_ptr : /usr/include/apr-1/apr_network_io.h line=231 column=11 ipaddr_ptr, inaddr_any : server/vhost.c line=549 column=14
i
naddr_any,
554                   sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr-> : enter=0, leave=0
-
>ipaddr_len : /usr/include/apr-1/apr_network_io.h line=225 column=9 ipaddr_len)) { /* not IN[6]ADDR_ANY */
555            *iphash_table_tail : server/vhost.c line=527 column=20
i
phash_table_tail[] : enter=0, leave=0
[
bucket : server/vhost.c line=550 column=18
b
ucket] = : enter=0, leave=0
=
 ic : server/vhost.c line=551 column=23
i
c;
556            iphash_table_tail : server/vhost.c line=527 column=20
i
phash_table_tail[bucket : server/vhost.c line=550 column=18
b
ucket] = : enter=0, leave=0
=
 &ic : server/vhost.c line=551 column=23
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext;
557        }
558        else {
559            /* A wildcard NameVirtualHost goes on the default_list so
560             * that it can catch incoming requests on any address.
561             */
562            ic : server/vhost.c line=551 column=23
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext = : enter=0, leave=0
=
 default_list : server/vhost.c line=93 column=22
d
efault_list;
563            default_list : server/vhost.c line=93 column=22
d
efault_list = : pass=0
=
 ic : server/vhost.c line=551 column=23
i
c;
564        }
565        /* Notice that what we've done is insert an ipaddr_chain with
566         * both server and names NULL. This fact is used to spot name-
567         * based vhosts in add_name_vhost_config().
568         */
569    }
570
571    /* The next things to go into the hash table are the virtual hosts
572     * themselves.  They're listed off of main_s->next in the reverse
573     * order they occured in the config file, so we insert them at
574     * the iphash_table_tail but don't advance the tail.
575     */
576
577    for : true=0, false=0
f
or (s : server/vhost.c line=525 column=17
s
 = : pass=0
=
 main_s : server/vhost.c line=521 column=66
m
ain_s-> : enter=0, leave=0
-
>next : include/httpd.h line=1176 column=17
n
ext; s : server/vhost.c line=525 column=17
s
s : server/vhost.c line=525 column=17
s
 = : pass=0
=
 s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>next : include/httpd.h line=1176 column=17
n
ext) {
578        has_default_vhost_addr : server/vhost.c line=524 column=9
h
as_default_vhost_addr = : pass=0
=
 0;
579        for : true=0, false=0
f
or (sar : server/vhost.c line=523 column=22
s
ar = : pass=0
=
 s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs; sar : server/vhost.c line=523 column=22
s
ar; sar : server/vhost.c line=523 column=22
s
ar = : pass=0
=
 sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>next : include/httpd.h line=1160 column=22
n
ext) {
580            ipaddr_chain *ic;
581            char inaddr_any[16] = {0}; /* big enough to handle IPv4 or IPv6 */
582
583            if : true=0, false=0
i
f ((sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr-> : enter=0, leave=0
-
>family : /usr/include/apr-1/apr_network_io.h line=221 column=17 family == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= AF_INET && : true=0, false=0
&
&
584                 sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr-> : enter=0, leave=0
-
>sa : /usr/include/apr-1/apr_network_io.h line=248 column=7 sa.sin : /usr/include/apr-1/apr_network_io.h line=238 column=28 sin.sin_addr : /usr/include/netinet/in.h line=243 column=20 sin_addr.s_addr : /usr/include/netinet/in.h line=35 column=15 s_addr == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= DEFAULT_VHOST_ADDR)
585                || : true=0, false=0
|
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
memcmp : enter=0, leave=0

memcmp : /usr/include/string.h line=68 column=12
m
emcmp(sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr-> : enter=0, leave=0
-
>ipaddr_ptr : /usr/include/apr-1/apr_network_io.h line=231 column=11 ipaddr_ptr, inaddr_any : server/vhost.c line=581 column=18
i
naddr_any, sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr-> : enter=0, leave=0
-
>ipaddr_len : /usr/include/apr-1/apr_network_io.h line=225 column=9 ipaddr_len)) {
586                ic : server/vhost.c line=580 column=27
i
= : pass=0
=
 find_default_server : enter=0, leave=0

find_default_server : server/vhost.c line=390 column=22
f
ind_default_server(sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
587                if : true=0, false=0
i
f (! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
ic : server/vhost.c line=580 column=27
i
|| : true=0, false=0
|
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
add_name_vhost_config : enter=0, leave=0

add_name_vhost_config : server/vhost.c line=473 column=12
a
dd_name_vhost_config(p : server/vhost.c line=521 column=51
p
main_s : server/vhost.c line=521 column=66
m
ain_s, s : server/vhost.c line=525 column=17
s
sar : server/vhost.c line=523 column=22
s
ar, ic : server/vhost.c line=580 column=27
i
c)) {
588                    if : true=0, false=0
i
f (MC/DC independently affect : true=0, false=0

ic : server/vhost.c line=580 column=27
iTF
&& : true=0, false=0
&
ic : server/vhost.c line=580 column=27
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
= 0) {
589                        ap_log_error : enter=0, leave=0

ap_log_error : include/http_log.h line=171 column=18
a
p_log_error(APLOG_MARK, APLOG_WARNING,
590                                     0, main_s : server/vhost.c line=521 column=66
m
ain_s, "_default_ VirtualHost "
591                                     "overlap on port %u, the first has "
592                                     "precedence", sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
593                    }
594                    ic : server/vhost.c line=580 column=27
i
= : pass=0
=
 new_ipaddr_chain : enter=0, leave=0

new_ipaddr_chain : server/vhost.c line=343 column=22
n
ew_ipaddr_chain(p : server/vhost.c line=521 column=51
p
s : server/vhost.c line=525 column=17
s
sar : server/vhost.c line=523 column=22
s
ar);
595                    ic : server/vhost.c line=580 column=27
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext = : enter=0, leave=0
=
 default_list : server/vhost.c line=93 column=22
d
efault_list;
596                    default_list : server/vhost.c line=93 column=22
d
efault_list = : pass=0
=
 ic : server/vhost.c line=580 column=27
i
c;
597                }
598                has_default_vhost_addr : server/vhost.c line=524 column=9
h
as_default_vhost_addr = : pass=0
=
 1;
599            }
600            else {
601                /* see if it matches something we've already got */
602                ic : server/vhost.c line=580 column=27
i
= : pass=0
=
 find_ipaddr : enter=0, leave=0

find_ipaddr : server/vhost.c line=370 column=33
f
ind_ipaddr(sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr);
603
604                if : true=0, false=0
i
f (! : true=0, false=0
!
ic : server/vhost.c line=580 column=27
i
c) {
605                    unsigned bucket = hash_addr : enter=0, leave=0

hash_addr : server/vhost.c line=331 column=28
h
ash_addr(sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr);
606
607                    ic : server/vhost.c line=580 column=27
i
= : pass=0
=
 new_ipaddr_chain : enter=0, leave=0

new_ipaddr_chain : server/vhost.c line=343 column=22
n
ew_ipaddr_chain(p : server/vhost.c line=521 column=51
p
s : server/vhost.c line=525 column=17
s
sar : server/vhost.c line=523 column=22
s
ar);
608                    ic : server/vhost.c line=580 column=27
i
c-> : enter=0, leave=0
-
>next : server/vhost.c line=64 column=19
n
ext = : enter=0, leave=0
=
 * dereference : enter=0, leave=0
*
iphash_table_tail : server/vhost.c line=527 column=20
i
phash_table_tail[] : enter=0, leave=0
[
bucket : server/vhost.c line=605 column=30
b
ucket];
609                    *iphash_table_tail : server/vhost.c line=527 column=20
i
phash_table_tail[] : enter=0, leave=0
[
bucket : server/vhost.c line=605 column=30
b
ucket] = : enter=0, leave=0
=
 ic : server/vhost.c line=580 column=27
i
c;
610                }
611                else if : true=0, false=0
i
f (! : true=0, false=0
!
add_name_vhost_config : enter=0, leave=0

add_name_vhost_config : server/vhost.c line=473 column=12
a
dd_name_vhost_config(p : server/vhost.c line=521 column=51
p
main_s : server/vhost.c line=521 column=66
m
ain_s, s : server/vhost.c line=525 column=17
s
sar : server/vhost.c line=523 column=22
s
ar, ic : server/vhost.c line=580 column=27
i
c)) {
612                    ap_log_error : enter=0, leave=0

ap_log_error : include/http_log.h line=171 column=18
a
p_log_error(APLOG_MARK, APLOG_WARNING,
613                                 0, main_s : server/vhost.c line=521 column=66
m
ain_s, "VirtualHost %s:%u overlaps "
614                                 "with VirtualHost %s:%u, the first has "
615                                 "precedence, perhaps you need a "
616                                 "NameVirtualHost directive",
617                                 sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>virthost : include/httpd.h line=1166 column=11
v
irthost, sar : server/vhost.c line=523 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port,
618                                 ic : server/vhost.c line=580 column=27
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>virthost : include/httpd.h line=1166 column=11
v
irthost, ic : server/vhost.c line=580 column=27
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port);
619                    ic : server/vhost.c line=580 column=27
i
c-> : enter=0, leave=0
-
>sar : server/vhost.c line=65 column=22
s
ar = : enter=0, leave=0
=
 sar : server/vhost.c line=523 column=22
s
ar;
620                    ic : server/vhost.c line=580 column=27
i
c-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver = : enter=0, leave=0
=
 s : server/vhost.c line=525 column=17
s
;
621                }
622            }
623        }
624
625        /* Ok now we want to set up a server_hostname if the user was
626         * silly enough to forget one.
627         * XXX: This is silly we should just crash and burn.
628         */
629        if : true=0, false=0
i
f (! : true=0, false=0
!
s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname) {
630            if : true=0, false=0
i
f (has_default_vhost_addr : server/vhost.c line=524 column=9
h
as_default_vhost_addr) {
631                s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname = : enter=0, leave=0
=
 main_s : server/vhost.c line=521 column=66
m
ain_s-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname;
632            }
633            else if : true=0, false=0
i
f (! : true=0, false=0
!
s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs) {
634                /* what else can we do?  at this point this vhost has
635                    no configured name, probably because they used
636                    DNS in the VirtualHost statement.  It's disabled
637                    anyhow by the host matching code.  -djg */
638                s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname = : enter=0, leave=0
=
639                    apr_pstrdup : enter=0, leave=0

apr_pstrdup : /usr/include/apr-1/apr_strings.h line=95 column=21
a
pr_pstrdup(p : server/vhost.c line=521 column=51
p
, "bogus_host_without_forward_dns");
640            }
641            else {
642                apr_status_t rv;
643                char *hostname;
644
645                rv : server/vhost.c line=642 column=30
r
= : pass=0
=
 apr_getnameinfo : enter=0, leave=0

apr_getnameinfo : /usr/include/apr-1/apr_network_io.h line=386 column=27
a
pr_getnameinfo(&hostname : server/vhost.c line=643 column=23
h
ostname, s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr, 0);
646                if : true=0, false=0
i
f (rv : server/vhost.c line=642 column=30
r
== : true=0, false=0
=
= APR_SUCCESS) {
647                    s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname = : enter=0, leave=0
=
 apr_pstrdup : enter=0, leave=0

apr_pstrdup : /usr/include/apr-1/apr_strings.h line=95 column=21
a
pr_pstrdup(p : server/vhost.c line=521 column=51
p
hostname : server/vhost.c line=643 column=23
h
ostname);
648                }
649                else {
650                    /* again, what can we do?  They didn't specify a
651                       ServerName, and their DNS isn't working. -djg */
652                    char *ipaddr_str;
653
654                    apr_sockaddr_ip_get : enter=0, leave=0

apr_sockaddr_ip_get : /usr/include/apr-1/apr_network_io.h line=675 column=27
a
pr_sockaddr_ip_get(&ipaddr_str : server/vhost.c line=652 column=27
i
paddr_str, s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs-> : enter=0, leave=0
-
>host_addr : include/httpd.h line=1162 column=21
h
ost_addr);
655                    ap_log_error : enter=0, leave=0

ap_log_error : include/http_log.h line=171 column=18
a
p_log_error(APLOG_MARK, APLOG_ERR, rv : server/vhost.c line=642 column=30
r
v, main_s : server/vhost.c line=521 column=66
m
ain_s,
656                                 "Failed to resolve server name "
657                                 "for %s (check DNS) -- or specify an explicit "
658                                 "ServerName",
659                                 ipaddr_str : server/vhost.c line=652 column=27
i
paddr_str);
660                    s : server/vhost.c line=525 column=17
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname = : enter=0, leave=0
=
661                        apr_pstrdup : enter=0, leave=0

apr_pstrdup : /usr/include/apr-1/apr_strings.h line=95 column=21
a
pr_pstrdup(p : server/vhost.c line=521 column=51
p
, "bogus_host_without_reverse_dns");
662                }
663            }
664        }
665    }
666
667    /* now go through and delete any NameVirtualHosts that didn't have any
668     * hosts associated with them.  Lamers.
669     */
670    for : true=0, false=0
f
or (i : server/vhost.c line=526 column=9
i
 = : pass=0
=
 0; i : server/vhost.c line=526 column=9
i
 < : true=0, false=0
<
 IPHASH_TABLE_SIZE; ++ : pass=0
+
+i : server/vhost.c line=526 column=9
i
) {
671        remove_unused_name_vhosts : enter=0, leave=0

remove_unused_name_vhosts : server/vhost.c line=503 column=13
r
emove_unused_name_vhosts(main_s : server/vhost.c line=521 column=66
m
ain_s, &iphash_table : server/vhost.c line=87 column=22
i
phash_table[] : enter=0, leave=0
[
i : server/vhost.c line=526 column=9
i
]);
672    }
673    remove_unused_name_vhosts : enter=0, leave=0

remove_unused_name_vhosts : server/vhost.c line=503 column=13
r
emove_unused_name_vhosts(main_s : server/vhost.c line=521 column=66
m
ain_s, &default_list : server/vhost.c line=93 column=22
d
efault_list);
674
675#ifdef IPHASH_STATISTICS
676    dump_iphash_statistics(main_s);
677#endif
678    if : true=0, false=0
i
f (ap_exists_config_define : enter=0, leave=0

ap_exists_config_define : include/http_core.h line=281 column=17
a
p_exists_config_define("DUMP_VHOSTS")) {
679        apr_file_t *thefile = NULL;
680        apr_file_open_stdout : enter=0, leave=0

apr_file_open_stdout : /usr/include/apr-1/apr_file_io.h line=332 column=27
a
pr_file_open_stdout(&thefile : server/vhost.c line=679 column=21
t
hefile, p : server/vhost.c line=521 column=51
p
);
681        dump_vhost_config : enter=0, leave=0

dump_vhost_config : server/vhost.c line=451 column=13
d
ump_vhost_config(thefile : server/vhost.c line=679 column=21
t
hefile);
682    }
683}
684
685
686/*****************************************************************************
687 * run-time vhost matching functions
688 */
689
690/* Lowercase and remove any trailing dot and/or :port from the hostname,
691 * and check that it is sane.
692 *
693 * In most configurations the exact syntax of the hostname isn't
694 * important so strict sanity checking isn't necessary. However, in
695 * mass hosting setups (using mod_vhost_alias or mod_rewrite) where
696 * the hostname is interpolated into the filename, we need to be sure
697 * that the interpolation doesn't expose parts of the filesystem.
698 * We don't do strict RFC 952 / RFC 1123 syntax checking in order
699 * to support iDNS and people who erroneously use underscores.
700 * Instead we just check for filesystem metacharacters: directory
701 * separators / and \ and sequences of more than one dot.
702 */
703static void fix_hostname : call=0
f
ix_hostname(request_rec *r)
704{
705    char *host, *scope_id;
706    char *dst;
707    apr_port_t port;
708    apr_status_t rv;
709    const char *c;
710
711    /* According to RFC 2616, Host header field CAN be blank. */
712    if : true=0, false=0
i
f (! : true=0, false=0
!
* dereference : enter=0, leave=0
*
r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname) {
713        return : pass=0
r
eturn;
714    }
715
716    /* apr_parse_addr_port will interpret a bare integer as a port
717     * which is incorrect in this context.  So treat it separately.
718     */
719    for : true=0, false=0
f
or (c : server/vhost.c line=709 column=17
c
 = : pass=0
=
 r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname; apr_isdigit(* dereference : enter=0, leave=0
*
c : server/vhost.c line=709 column=17
c
); ++ : pass=0
+
+c : server/vhost.c line=709 column=17
c
);
720    if : true=0, false=0
i
f (! : true=0, false=0
!
* dereference : enter=0, leave=0
*
c : server/vhost.c line=709 column=17
c
) {  /* pure integer */
721        return : pass=0
r
eturn;
722    }
723
724    rv : server/vhost.c line=708 column=18
r
= : pass=0
=
 apr_parse_addr_port : enter=0, leave=0

apr_parse_addr_port : /usr/include/apr-1/apr_network_io.h line=420 column=27
a
pr_parse_addr_port(&host : server/vhost.c line=705 column=11
h
ost, &scope_id : server/vhost.c line=705 column=18
s
cope_id, &port : server/vhost.c line=707 column=16
p
ort, r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname, r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool);
725    if : true=0, false=0
i
f (rv : server/vhost.c line=708 column=18
r
!= : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
= APR_SUCCESS || : true=0, false=0
|
MC/DC independently affect : true=0, false=0

scope_id : server/vhost.c line=705 column=18
sTF
cope_id) {
726        goto : pass=0
g
oto bad;
727    }
728
729    if : true=0, false=0
i
f (port : server/vhost.c line=707 column=16
p
ort) {
730        /* Don't throw the Host: header's port number away:
731           save it in parsed_uri -- ap_get_server_port() needs it! */
732        /* @@@ XXX there should be a better way to pass the port.
733         *         Like r->hostname, there should be a r->portno
734         */
735        r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>parsed_uri : include/httpd.h line=959 column=15
p
arsed_uri.port : /usr/include/apr-1/apr_uri.h line=109 column=16 port = : pass=0
=
 port : server/vhost.c line=707 column=16
p
ort;
736        r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>parsed_uri : include/httpd.h line=959 column=15
p
arsed_uri.port_str : /usr/include/apr-1/apr_uri.h line=97 column=11 port_str = : pass=0
=
 apr_itoa : enter=0, leave=0

apr_itoa : /usr/include/apr-1/apr_strings.h line=283 column=21
a
pr_itoa(r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, (int)port : server/vhost.c line=707 column=16
p
ort);
737    }
738
739    /* if the hostname is an IPv6 numeric address string, it was validated
740     * already; otherwise, further validation is needed
741     */
742    if : true=0, false=0
i
f (r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname[] : enter=0, leave=0
[
0] != : true=0, false=0
!
= '[') {
743        for : true=0, false=0
f
or (dst : server/vhost.c line=706 column=11
d
st = : pass=0
=
 host : server/vhost.c line=705 column=11
h
ost; * dereference : enter=0, leave=0
*
dst : server/vhost.c line=706 column=11
d
st; dst : server/vhost.c line=706 column=11
d
st++ : pass=0
+
+) {
744            if : true=0, false=0
i
f (apr_islower(* dereference : enter=0, leave=0
*
dst : server/vhost.c line=706 column=11
d
st)) {
745                /* leave char unchanged */
746            }
747            else if : true=0, false=0
i
f (* dereference : enter=0, leave=0
*
dst : server/vhost.c line=706 column=11
d
st == : true=0, false=0
=
= '.') {
748                if : true=0, false=0
i
f (* dereference : enter=0, leave=0
*
(dst : server/vhost.c line=706 column=11
d
st + : pass=0
+
 1) == : true=0, false=0
=
= '.') {
749                    goto : pass=0
g
oto bad;
750                }
751            }
752            else if : true=0, false=0
i
f (apr_isupper(* dereference : enter=0, leave=0
*
dst : server/vhost.c line=706 column=11
d
st)) {
753                *dst : server/vhost.c line=706 column=11
d
st = : enter=0, leave=0
=
 apr_tolower(* dereference : enter=0, leave=0
*
dst : server/vhost.c line=706 column=11
d
st);
754            }
755            else if : true=0, false=0
i
f (* dereference : enter=0, leave=0
*
dst : server/vhost.c line=706 column=11
d
st == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '/' || : true=0, false=0
|
* dereference : enter=0, leave=0
*
dst : server/vhost.c line=706 column=11
d
st == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '\\') {
756                goto : pass=0
g
oto bad;
757            }
758        }
759        /* strip trailing gubbins */
760        if : true=0, false=0
i
f (dst : server/vhost.c line=706 column=11
d
st > : true=0, false=0
MC/DC independently affect : true=0, false=0
>TF
 host : server/vhost.c line=705 column=11
h
ost && : true=0, false=0
&
dst : server/vhost.c line=706 column=11
d
st[] : enter=0, leave=0
[
-1] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '.') {
761            dst : server/vhost.c line=706 column=11
d
st[-1] = : enter=0, leave=0
=
 '\0';
762        }
763    }
764    r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname = : enter=0, leave=0
=
 host : server/vhost.c line=705 column=11
h
ost;
765    return : pass=0
r
eturn;
766
767bad:
768    r : server/vhost.c line=703 column=39
r
-> : enter=0, leave=0
-
>status : include/httpd.h line=822 column=9
s
tatus = : enter=0, leave=0
=
 HTTP_BAD_REQUEST;
769    ap_log_rerror : enter=0, leave=0

ap_log_rerror : include/http_log.h line=219 column=18
a
p_log_rerror(APLOG_MARK, APLOG_ERR, 0, r : server/vhost.c line=703 column=39
r
,
770                  "Client sent malformed Host header");
771    return : pass=0
r
eturn;
772}
773
774
775/* return 1 if host matches ServerName or ServerAliases */
776static int matches_aliases : call=0
m
atches_aliases(server_rec *s, const char *host)
777{
778    int i;
779    apr_array_header_t *names;
780
781    /* match ServerName */
782    if : true=0, false=0
i
f (! : true=0, false=0
!
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(host : server/vhost.c line=776 column=55
h
ost, s : server/vhost.c line=776 column=40
s
-> : enter=0, leave=0
-
>server_hostname : include/httpd.h line=1188 column=11
s
erver_hostname)) {
783        return : pass=0
r
eturn 1;
784    }
785
786    /* search all the aliases from ServerAlias directive */
787    names : server/vhost.c line=779 column=25
n
ames = : pass=0
=
 s : server/vhost.c line=776 column=40
s
-> : enter=0, leave=0
-
>names : include/httpd.h line=1230 column=25
n
ames;
788    if : true=0, false=0
i
f (names : server/vhost.c line=779 column=25
n
ames) {
789        char **name = (char **) names : server/vhost.c line=779 column=25
n
ames-> : enter=0, leave=0
-
>elts : /usr/include/apr-1/apr_tables.h line=62 column=11 elts;
790        for : true=0, false=0
f
or (i : server/vhost.c line=778 column=9
i
 = : pass=0
=
 0; i : server/vhost.c line=778 column=9
i
 < : true=0, false=0
<
 names : server/vhost.c line=779 column=25
n
ames-> : enter=0, leave=0
-
>nelts : /usr/include/apr-1/apr_tables.h line=58 column=9 nelts; ++ : pass=0
+
+i : server/vhost.c line=778 column=9
i
) {
791            if : true=0, false=0
i
f(! : true=0, false=0
!
name : server/vhost.c line=789 column=16
n
ame[] : enter=0, leave=0
[
i : server/vhost.c line=778 column=9
i
]) continue : pass=0
c
ontinue;
792            if : true=0, false=0
i
f (! : true=0, false=0
!
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(host : server/vhost.c line=776 column=55
h
ost, name : server/vhost.c line=789 column=16
n
ame[] : enter=0, leave=0
[
i : server/vhost.c line=778 column=9
i
]))
793                return : pass=0
r
eturn 1;
794        }
795    }
796    names : server/vhost.c line=779 column=25
n
ames = : pass=0
=
 s : server/vhost.c line=776 column=40
s
-> : enter=0, leave=0
-
>wild_names : include/httpd.h line=1232 column=25
w
ild_names;
797    if : true=0, false=0
i
f (names : server/vhost.c line=779 column=25
n
ames) {
798        char **name = (char **) names : server/vhost.c line=779 column=25
n
ames-> : enter=0, leave=0
-
>elts : /usr/include/apr-1/apr_tables.h line=62 column=11 elts;
799        for : true=0, false=0
f
or (i : server/vhost.c line=778 column=9
i
 = : pass=0
=
 0; i : server/vhost.c line=778 column=9
i
 < : true=0, false=0
<
 names : server/vhost.c line=779 column=25
n
ames-> : enter=0, leave=0
-
>nelts : /usr/include/apr-1/apr_tables.h line=58 column=9 nelts; ++ : pass=0
+
+i : server/vhost.c line=778 column=9
i
) {
800            if : true=0, false=0
i
f(! : true=0, false=0
!
name : server/vhost.c line=798 column=16
n
ame[] : enter=0, leave=0
[
i : server/vhost.c line=778 column=9
i
]) continue : pass=0
c
ontinue;
801            if : true=0, false=0
i
f (! : true=0, false=0
!
ap_strcasecmp_match : enter=0, leave=0

ap_strcasecmp_match : include/httpd.h line=1636 column=17
a
p_strcasecmp_match(host : server/vhost.c line=776 column=55
h
ost, name : server/vhost.c line=798 column=16
n
ame[] : enter=0, leave=0
[
i : server/vhost.c line=778 column=9
i
]))
802                return : pass=0
r
eturn 1;
803        }
804    }
805    return : pass=0
r
eturn 0;
806}
807
808
809/* Suppose a request came in on the same socket as this r, and included
810 * a header "Host: host:port", would it map to r->server?  It's more
811 * than just that though.  When we do the normal matches for each request
812 * we don't even bother considering Host: etc on non-namevirtualhosts,
813 * we just call it a match.  But here we require the host:port to match
814 * the ServerName and/or ServerAliases.
815 */
816AP_DECLARE(int) ap_matches_request_vhost : call=0
a
p_matches_request_vhost(request_rec *r, const char *host,
817                                         apr_port_t port)
818{
819    server_rec *s;
820    server_addr_rec *sar;
821
822    s : server/vhost.c line=819 column=17
s
 = : pass=0
=
 r : server/vhost.c line=816 column=55
r
-> : enter=0, leave=0
-
>server : include/httpd.h line=784 column=17
s
erver;
823
824    /* search all the <VirtualHost> values */
825    /* XXX: If this is a NameVirtualHost then we may not be doing the Right Thing
826     * consider:
827     *
828     *     NameVirtualHost 10.1.1.1
829     *     <VirtualHost 10.1.1.1>
830     *     ServerName v1
831     *     </VirtualHost>
832     *     <VirtualHost 10.1.1.1>
833     *     ServerName v2
834     *     </VirtualHost>
835     *
836     * Suppose r->server is v2, and we're asked to match "10.1.1.1".  We'll say
837     * "yup it's v2", when really it isn't... if a request came in for 10.1.1.1
838     * it would really go to v1.
839     */
840    for : true=0, false=0
f
or (sar : server/vhost.c line=820 column=22
s
ar = : pass=0
=
 s : server/vhost.c line=819 column=17
s
-> : enter=0, leave=0
-
>addrs : include/httpd.h line=1214 column=22
a
ddrs; sar : server/vhost.c line=820 column=22
s
ar; sar : server/vhost.c line=820 column=22
s
ar = : pass=0
=
 sar : server/vhost.c line=820 column=22
s
ar-> : enter=0, leave=0
-
>next : include/httpd.h line=1160 column=22
n
ext) {
841        if : true=0, false=0
i
f ((sar : server/vhost.c line=820 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= 0 || : true=0, false=0
|
port : server/vhost.c line=817 column=53
p
ort == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
sar : server/vhost.c line=820 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port)
842            && : true=0, false=0
&
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(host : server/vhost.c line=816 column=70
h
ost, sar : server/vhost.c line=820 column=22
s
ar-> : enter=0, leave=0
-
>virthost : include/httpd.h line=1166 column=11
v
irthost)) {
843            return : pass=0
r
eturn 1;
844        }
845    }
846
847    /* the Port has to match now, because the rest don't have ports associated
848     * with them. */
849    if : true=0, false=0
i
f (port : server/vhost.c line=817 column=53
p
ort != : true=0, false=0
!
s : server/vhost.c line=819 column=17
s
-> : enter=0, leave=0
-
>port : include/httpd.h line=1190 column=16
p
ort) {
850        return : pass=0
r
eturn 0;
851    }
852
853    return : pass=0
r
eturn matches_aliases : enter=0, leave=0

matches_aliases : server/vhost.c line=776 column=12
m
atches_aliases(s : server/vhost.c line=819 column=17
s
host : server/vhost.c line=816 column=70
h
ost);
854}
855
856
857static void check_hostalias : call=0
c
heck_hostalias(request_rec *r)
858{
859    /*
860     * Even if the request has a Host: header containing a port we ignore
861     * that port.  We always use the physical port of the socket.  There
862     * are a few reasons for this:
863     *
864     * - the default of 80 or 443 for SSL is easier to handle this way
865     * - there is less of a possibility of a security problem
866     * - it simplifies the data structure
867     * - the client may have no idea that a proxy somewhere along the way
868     *   translated the request to another ip:port
869     * - except for the addresses from the VirtualHost line, none of the other
870     *   names we'll match have ports associated with them
871     */
872    const char *host = r : server/vhost.c line=857 column=42
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname;
873    apr_port_t port;
874    server_rec *s;
875    server_rec *last_s;
876    name_chain *src;
877
878    last_s : server/vhost.c line=875 column=17
l
ast_s = : pass=0
=
 NULL;
879
880    port : server/vhost.c line=873 column=16
p
ort = : pass=0
=
 r : server/vhost.c line=857 column=42
r
-> : enter=0, leave=0
-
>connection : include/httpd.h line=782 column=15
c
onnection-> : enter=0, leave=0
-
>local_addr : include/httpd.h line=1055 column=21
l
ocal_addr-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port;
881
882    /* Recall that the name_chain is a list of server_addr_recs, some of
883     * whose ports may not match.  Also each server may appear more than
884     * once in the chain -- specifically, it will appear once for each
885     * address from its VirtualHost line which matched.  We only want to
886     * do the full ServerName/ServerAlias comparisons once for each
887     * server, fortunately we know that all the VirtualHost addresses for
888     * a single server are adjacent to each other.
889     */
890
891    for : true=0, false=0
f
or (src : server/vhost.c line=876 column=17
s
rc = : pass=0
=
 r : server/vhost.c line=857 column=42
r
-> : enter=0, leave=0
-
>connection : include/httpd.h line=782 column=15
c
onnection-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data; src : server/vhost.c line=876 column=17
s
rc; src : server/vhost.c line=876 column=17
s
rc = : pass=0
=
 src : server/vhost.c line=876 column=17
s
rc-> : enter=0, leave=0
-
>next : server/vhost.c line=53 column=17
n
ext) {
892        server_addr_rec *sar;
893
894        /* We only consider addresses on the name_chain which have a matching
895         * port
896         */
897        sar : server/vhost.c line=892 column=26
s
ar = : pass=0
=
 src : server/vhost.c line=876 column=17
s
rc-> : enter=0, leave=0
-
>sar : server/vhost.c line=54 column=22
s
ar;
898        if : true=0, false=0
i
f (sar : server/vhost.c line=892 column=26
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
= 0 && : true=0, false=0
&
port : server/vhost.c line=873 column=16
p
ort != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
sar : server/vhost.c line=892 column=26
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port) {
899            continue : pass=0
c
ontinue;
900        }
901
902        s : server/vhost.c line=874 column=17
s
 = : pass=0
=
 src : server/vhost.c line=876 column=17
s
rc-> : enter=0, leave=0
-
>server : server/vhost.c line=56 column=17
s
erver;
903
904        /* does it match the virthost from the sar? */
905        if : true=0, false=0
i
f (! : true=0, false=0
!
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(host : server/vhost.c line=872 column=17
h
ost, sar : server/vhost.c line=892 column=26
s
ar-> : enter=0, leave=0
-
>virthost : include/httpd.h line=1166 column=11
v
irthost)) {
906            goto : pass=0
g
oto found;
907        }
908
909        if : true=0, false=0
i
f (s : server/vhost.c line=874 column=17
s
 == : true=0, false=0
=
last_s : server/vhost.c line=875 column=17
l
ast_s) {
910            /* we've already done ServerName and ServerAlias checks for this
911             * vhost
912             */
913            continue : pass=0
c
ontinue;
914        }
915        last_s : server/vhost.c line=875 column=17
l
ast_s = : pass=0
=
 s : server/vhost.c line=874 column=17
s
;
916
917        if : true=0, false=0
i
f (matches_aliases : enter=0, leave=0

matches_aliases : server/vhost.c line=776 column=12
m
atches_aliases(s : server/vhost.c line=874 column=17
s
host : server/vhost.c line=872 column=17
h
ost)) {
918            goto : pass=0
g
oto found;
919        }
920    }
921    return : pass=0
r
eturn;
922
923found:
924    /* s is the first matching server, we're done */
925    r : server/vhost.c line=857 column=42
r
-> : enter=0, leave=0
-
>server : include/httpd.h line=784 column=17
s
erver = : enter=0, leave=0
=
 s : server/vhost.c line=874 column=17
s
;
926}
927
928
929static void check_serverpath : call=0
c
heck_serverpath(request_rec *r)
930{
931    server_rec *s;
932    server_rec *last_s;
933    name_chain *src;
934    apr_port_t port;
935
936    port : server/vhost.c line=934 column=16
p
ort = : pass=0
=
 r : server/vhost.c line=929 column=43
r
-> : enter=0, leave=0
-
>connection : include/httpd.h line=782 column=15
c
onnection-> : enter=0, leave=0
-
>local_addr : include/httpd.h line=1055 column=21
l
ocal_addr-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port;
937
938    /*
939     * This is in conjunction with the ServerPath code in http_core, so we
940     * get the right host attached to a non- Host-sending request.
941     *
942     * See the comment in check_hostalias about how each vhost can be
943     * listed multiple times.
944     */
945
946    last_s : server/vhost.c line=932 column=17
l
ast_s = : pass=0
=
 NULL;
947    for : true=0, false=0
f
or (src : server/vhost.c line=933 column=17
s
rc = : pass=0
=
 r : server/vhost.c line=929 column=43
r
-> : enter=0, leave=0
-
>connection : include/httpd.h line=782 column=15
c
onnection-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data; src : server/vhost.c line=933 column=17
s
rc; src : server/vhost.c line=933 column=17
s
rc = : pass=0
=
 src : server/vhost.c line=933 column=17
s
rc-> : enter=0, leave=0
-
>next : server/vhost.c line=53 column=17
n
ext) {
948        /* We only consider addresses on the name_chain which have a matching
949         * port
950         */
951        if : true=0, false=0
i
f (src : server/vhost.c line=933 column=17
s
rc-> : enter=0, leave=0
-
>sar : server/vhost.c line=54 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
= 0 && : true=0, false=0
&
port : server/vhost.c line=934 column=16
p
ort != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
src : server/vhost.c line=933 column=17
s
rc-> : enter=0, leave=0
-
>sar : server/vhost.c line=54 column=22
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port) {
952            continue : pass=0
c
ontinue;
953        }
954
955        s : server/vhost.c line=931 column=17
s
 = : pass=0
=
 src : server/vhost.c line=933 column=17
s
rc-> : enter=0, leave=0
-
>server : server/vhost.c line=56 column=17
s
erver;
956        if : true=0, false=0
i
f (s : server/vhost.c line=931 column=17
s
 == : true=0, false=0
=
last_s : server/vhost.c line=932 column=17
l
ast_s) {
957            continue : pass=0
c
ontinue;
958        }
959        last_s : server/vhost.c line=932 column=17
l
ast_s = : pass=0
=
 s : server/vhost.c line=931 column=17
s
;
960
961        if : true=0, false=0
i
f (s : server/vhost.c line=931 column=17
s
MC/DC independently affect : true=0, false=0
-> : enter=0, leave=0
-TF
>path : include/httpd.h line=1225 column=17
p
ath && : true=0, false=0
&
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strncmp : enter=0, leave=0

strncmp : /usr/include/string.h line=146 column=12
s
trncmp(r : server/vhost.c line=929 column=43
r
-> : enter=0, leave=0
-
>uri : include/httpd.h line=946 column=11
u
ri, s : server/vhost.c line=931 column=17
s
-> : enter=0, leave=0
-
>path : include/httpd.h line=1225 column=17
p
ath, s : server/vhost.c line=931 column=17
s
-> : enter=0, leave=0
-
>pathlen : include/httpd.h line=1227 column=9
p
athlen) && : true=0, false=0
&
&
962            (s : server/vhost.c line=931 column=17
s
-> : enter=0, leave=0
-
>path : include/httpd.h line=1225 column=17
p
ath[] : enter=0, leave=0
[
s : server/vhost.c line=931 column=17
s
-> : enter=0, leave=0
-
>pathlen : include/httpd.h line=1227 column=9
p
athlen - : pass=0
-
 1] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '/' || : true=0, false=0
|
|
963             r : server/vhost.c line=929 column=43
r
-> : enter=0, leave=0
-
>uri : include/httpd.h line=946 column=11
u
ri[] : enter=0, leave=0
[
s : server/vhost.c line=931 column=17
s
-> : enter=0, leave=0
-
>pathlen : include/httpd.h line=1227 column=9
p
athlen] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '/' || : true=0, false=0
|
|
964             r : server/vhost.c line=929 column=43
r
-> : enter=0, leave=0
-
>uri : include/httpd.h line=946 column=11
u
ri[] : enter=0, leave=0
[
s : server/vhost.c line=931 column=17
s
-> : enter=0, leave=0
-
>pathlen : include/httpd.h line=1227 column=9
p
athlen] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '\0')) {
965            r : server/vhost.c line=929 column=43
r
-> : enter=0, leave=0
-
>server : include/httpd.h line=784 column=17
s
erver = : enter=0, leave=0
=
 s : server/vhost.c line=931 column=17
s
;
966            return : pass=0
r
eturn;
967        }
968    }
969}
970
971
972AP_DECLARE(void) ap_update_vhost_from_headers : call=0
a
p_update_vhost_from_headers(request_rec *r)
973{
974    /* must set this for HTTP/1.1 support */
975    if : true=0, false=0
i
f (r : server/vhost.c line=972 column=60
r
MC/DC independently affect : true=0, false=0
-> : enter=0, leave=0
-TF
>hostname : include/httpd.h line=814 column=17
h
ostname || : true=0, false=0
|
| (r : server/vhost.c line=972 column=60
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname MC/DC independently affect : true=0, false=0
= : enter=0, leave=0
=TF
 apr_table_get : enter=0, leave=0

apr_table_get : /usr/include/apr-1/apr_tables.h line=258 column=27
a
pr_table_get(r : server/vhost.c line=972 column=60
r
-> : enter=0, leave=0
-
>headers_in : include/httpd.h line=901 column=18
h
eaders_in, "Host"))) {
976        fix_hostname : enter=0, leave=0

fix_hostname : server/vhost.c line=703 column=13
f
ix_hostname(r : server/vhost.c line=972 column=60
r
);
977        if : true=0, false=0
i
f (r : server/vhost.c line=972 column=60
r
-> : enter=0, leave=0
-
>status : include/httpd.h line=822 column=9
s
tatus != : true=0, false=0
!
= HTTP_OK)
978            return : pass=0
r
eturn;
979    }
980    /* check if we tucked away a name_chain */
981    if : true=0, false=0
i
f (r : server/vhost.c line=972 column=60
r
-> : enter=0, leave=0
-
>connection : include/httpd.h line=782 column=15
c
onnection-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data) {
982        if : true=0, false=0
i
f (r : server/vhost.c line=972 column=60
r
-> : enter=0, leave=0
-
>hostname : include/httpd.h line=814 column=17
h
ostname)
983            check_hostalias : enter=0, leave=0

check_hostalias : server/vhost.c line=857 column=13
c
heck_hostalias(r : server/vhost.c line=972 column=60
r
);
984        else
985            check_serverpath : enter=0, leave=0

check_serverpath : server/vhost.c line=929 column=13
c
heck_serverpath(r : server/vhost.c line=972 column=60
r
);
986    }
987}
988
989/**
990 * For every virtual host on this connection, call func_cb.
991 */
992AP_DECLARE(int) ap_vhost_iterate_given_conn : call=0
a
p_vhost_iterate_given_conn(conn_rec *conn,
993                                            ap_vhost_iterate_conn_cb func_cb,
994                                            void* baton)
995{
996    server_rec *s;
997    server_rec *last_s;
998    name_chain *src;
999    apr_port_t port;
1000    int rv = 0;
1001
1002    if : true=0, false=0
i
f (conn : server/vhost.c line=992 column=55
c
onn-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data) {
1003        last_s : server/vhost.c line=997 column=17
l
ast_s = : pass=0
=
 NULL;
1004        port : server/vhost.c line=999 column=16
p
ort = : pass=0
=
 conn : server/vhost.c line=992 column=55
c
onn-> : enter=0, leave=0
-
>local_addr : include/httpd.h line=1055 column=21
l
ocal_addr-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port;
1005
1006        for : true=0, false=0
f
or (src : server/vhost.c line=998 column=17
s
rc = : pass=0
=
 conn : server/vhost.c line=992 column=55
c
onn-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data; src : server/vhost.c line=998 column=17
s
rc; src : server/vhost.c line=998 column=17
s
rc = : pass=0
=
 src : server/vhost.c line=998 column=17
s
rc-> : enter=0, leave=0
-
>next : server/vhost.c line=53 column=17
n
ext) {
1007            server_addr_rec *sar;
1008
1009            /* We only consider addresses on the name_chain which have a
1010             * matching port.
1011             */
1012            sar : server/vhost.c line=1007 column=30
s
ar = : pass=0
=
 src : server/vhost.c line=998 column=17
s
rc-> : enter=0, leave=0
-
>sar : server/vhost.c line=54 column=22
s
ar;
1013            if : true=0, false=0
i
f (sar : server/vhost.c line=1007 column=30
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
= 0 && : true=0, false=0
&
port : server/vhost.c line=999 column=16
p
ort != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
sar : server/vhost.c line=1007 column=30
s
ar-> : enter=0, leave=0
-
>host_port : include/httpd.h line=1164 column=16
h
ost_port) {
1014                continue : pass=0
c
ontinue;
1015            }
1016
1017            s : server/vhost.c line=996 column=17
s
 = : pass=0
=
 src : server/vhost.c line=998 column=17
s
rc-> : enter=0, leave=0
-
>server : server/vhost.c line=56 column=17
s
erver;
1018
1019            if : true=0, false=0
i
f (s : server/vhost.c line=996 column=17
s
 == : true=0, false=0
=
last_s : server/vhost.c line=997 column=17
l
ast_s) {
1020                /* we've already done a callback for this vhost. */
1021                continue : pass=0
c
ontinue;
1022            }
1023
1024            last_s : server/vhost.c line=997 column=17
l
ast_s = : pass=0
=
 s : server/vhost.c line=996 column=17
s
;
1025
1026            rv : server/vhost.c line=1000 column=9
r
= : pass=0
=
 func_cb : enter=0, leave=0

func_cb : server/vhost.c line=993 column=70
f
unc_cb(baton : server/vhost.c line=994 column=51
b
aton, conn : server/vhost.c line=992 column=55
c
onn, s : server/vhost.c line=996 column=17
s
);
1027
1028            if : true=0, false=0
i
f (rv : server/vhost.c line=1000 column=9
r
!= : true=0, false=0
!
= 0) {
1029                break : pass=0
b
reak;
1030            }
1031        }
1032    }
1033    else {
1034        rv : server/vhost.c line=1000 column=9
r
= : pass=0
=
 func_cb : enter=0, leave=0

func_cb : server/vhost.c line=993 column=70
f
unc_cb(baton : server/vhost.c line=994 column=51
b
aton, conn : server/vhost.c line=992 column=55
c
onn, conn : server/vhost.c line=992 column=55
c
onn-> : enter=0, leave=0
-
>base_server : include/httpd.h line=1049 column=17
b
ase_server);
1035    }
1036
1037    return : pass=0
r
eturn rv : server/vhost.c line=1000 column=9
r
v;
1038}
1039
1040/* Called for a new connection which has a known local_addr.  Note that the
1041 * new connection is assumed to have conn->server == main server.
1042 */
1043AP_DECLARE(void) ap_update_vhost_given_ip : call=0
a
p_update_vhost_given_ip(conn_rec *conn)
1044{
1045    ipaddr_chain *trav;
1046    apr_port_t port;
1047
1048    /* scan the hash table for an exact match first */
1049    trav : server/vhost.c line=1045 column=19
t
rav = : pass=0
=
 find_ipaddr : enter=0, leave=0

find_ipaddr : server/vhost.c line=370 column=33
f
ind_ipaddr(conn : server/vhost.c line=1043 column=53
c
onn-> : enter=0, leave=0
-
>local_addr : include/httpd.h line=1055 column=21
l
ocal_addr);
1050
1051    if : true=0, false=0
i
f (trav : server/vhost.c line=1045 column=19
t
rav) {
1052        /* save the name_chain for later in case this is a name-vhost */
1053        conn : server/vhost.c line=1043 column=53
c
onn-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data = : enter=0, leave=0
=
 trav : server/vhost.c line=1045 column=19
t
rav-> : enter=0, leave=0
-
>names : server/vhost.c line=69 column=17
n
ames;
1054        conn : server/vhost.c line=1043 column=53
c
onn-> : enter=0, leave=0
-
>base_server : include/httpd.h line=1049 column=17
b
ase_server = : enter=0, leave=0
=
 trav : server/vhost.c line=1045 column=19
t
rav-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver;
1055        return : pass=0
r
eturn;
1056    }
1057
1058    /* maybe there's a default server or wildcard name-based vhost
1059     * matching this port
1060     */
1061    port : server/vhost.c line=1046 column=16
p
ort = : pass=0
=
 conn : server/vhost.c line=1043 column=53
c
onn-> : enter=0, leave=0
-
>local_addr : include/httpd.h line=1055 column=21
l
ocal_addr-> : enter=0, leave=0
-
>port : /usr/include/apr-1/apr_network_io.h line=219 column=16 port;
1062
1063    trav : server/vhost.c line=1045 column=19
t
rav = : pass=0
=
 find_default_server : enter=0, leave=0

find_default_server : server/vhost.c line=390 column=22
f
ind_default_server(port : server/vhost.c line=1046 column=16
p
ort);
1064    if : true=0, false=0
i
f (trav : server/vhost.c line=1045 column=19
t
rav) {
1065        conn : server/vhost.c line=1043 column=53
c
onn-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data = : enter=0, leave=0
=
 trav : server/vhost.c line=1045 column=19
t
rav-> : enter=0, leave=0
-
>names : server/vhost.c line=69 column=17
n
ames;
1066        conn : server/vhost.c line=1043 column=53
c
onn-> : enter=0, leave=0
-
>base_server : include/httpd.h line=1049 column=17
b
ase_server = : enter=0, leave=0
=
 trav : server/vhost.c line=1045 column=19
t
rav-> : enter=0, leave=0
-
>server : server/vhost.c line=68 column=17
s
erver;
1067        return : pass=0
r
eturn;
1068    }
1069
1070    /* otherwise we're stuck with just the main server
1071     * and no name-based vhosts
1072     */
1073    conn : server/vhost.c line=1043 column=53
c
onn-> : enter=0, leave=0
-
>vhost_lookup_data : include/httpd.h line=1051 column=11
v
host_lookup_data = : enter=0, leave=0
=
 NULL;
1074}
1075[EOF]


Generated by expcov