1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include "vserver.h"
30
31 #include <cx/hash_map.h>
32
33 VirtualServer* vs_new(
pool_handle_t *pool) {
34 VirtualServer *vs = pool_malloc(pool,
sizeof(VirtualServer));
35 ZERO(vs,
sizeof(VirtualServer));
36 vs->pool = pool;
37 vs->objects =
NULL;
38 vs->document_root = cx_mutstr(
"docs");
39 vs->acls =
NULL;
40 vs->log =
NULL;
41 vs->ref =
1;
42 return vs;
43 }
44
45 int vs_add_host(VirtualServer *vs, cxstring host) {
46 cxmutstr host_cp = cx_strdup_a(pool_allocator(vs->pool), host);
47 if(!vs->host.ptr) {
48 vs->host = host_cp;
49 }
50
51
52 return 0;
53 }
54
55
56
57
58 char* vs_translate_uri(
const VirtualServer *vs,
const char *uri) {
59
60 return NULL;
61 }
62