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 VirtualServer* vs_new() {
32 VirtualServer *vs = malloc(
sizeof(VirtualServer));
33 vs->objects =
NULL;
34 vs->document_root = sstr(
"docs");
35 vs->acls =
NULL;
36 vs->log =
NULL;
37 vs->ref =
1;
38 return vs;
39 }
40
41 VirtualServer* vs_copy(VirtualServer *vs,
pool_handle_t *pool) {
42 VirtualServer *newvs = malloc(
sizeof(VirtualServer));
43 newvs->ref =
1;
44 newvs->document_root = sstrdup_pool(pool, vs->document_root);
45 newvs->host = sstrdup_pool(pool, vs->host);
46 newvs->name = sstrdup_pool(pool, vs->name);
47 newvs->objectfile = sstrdup_pool(pool, vs->objectfile);
48 newvs->acls = vs->acls;
49 acl_data_ref(newvs->acls);
50 newvs->log = vs->log;
51
52 newvs->objects = vs->objects;
53
54 return newvs;
55 }
56
57
58
59
60
61
62
63 char* vs_translate_uri(
const VirtualServer *vs,
const char *uri) {
64
65 return NULL;
66 }
67