diff options
author | Omar Polo <op@omarpolo.com> | 2023-06-08 15:59:53 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-06-08 15:59:53 +0000 |
commit | fc9cc497e075cf321fe0dcf4c6783e2eeb8b9d43 (patch) | |
tree | 058efc155e1106b20ffd5efad5123a4200668856 /utils.c | |
parent | e69e1151f696b01d1fe80570901d21bc78ed5ab1 (diff) |
move some new_* functions from parse.y to utils.c
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -241,3 +241,37 @@ end: X509_STORE_CTX_free(ctx); return ret; } + +struct vhost * +new_vhost(void) +{ + struct vhost *h; + + h = xcalloc(1, sizeof(*h)); + TAILQ_INIT(&h->locations); + TAILQ_INIT(&h->params); + TAILQ_INIT(&h->aliases); + TAILQ_INIT(&h->proxies); + return h; +} + +struct location * +new_location(void) +{ + struct location *l; + + l = xcalloc(1, sizeof(*l)); + l->dirfd = -1; + l->fcgi = -1; + return l; +} + +struct proxy * +new_proxy(void) +{ + struct proxy *p; + + p = xcalloc(1, sizeof(*p)); + p->protocols = TLS_PROTOCOLS_DEFAULT; + return p; +} |