diff options
author | Omar Polo <op@omarpolo.com> | 2022-01-02 16:33:28 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2022-01-02 16:33:28 +0000 |
commit | b7967bc1f695126e1bf2705bfd486bbc32aaf8b0 (patch) | |
tree | d24f103eb78223a61049bfcebedb1686bd628c3c /gmid.c | |
parent | e2f167afb3444d3ba55fdffe234ef7812cac72f0 (diff) |
proxy: allow multiple proxy blocks, matching options and validations
as a side effect the order of the content of a server block is relaxed:
options, location or proxy blocks can be put in any order.
Diffstat (limited to 'gmid.c')
-rw-r--r-- | gmid.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -279,6 +279,7 @@ free_config(void) { struct vhost *h, *th; struct location *l, *tl; + struct proxy *p, *tp; struct envlist *e, *te; struct alist *a, *ta; int v, i; @@ -331,6 +332,17 @@ free_config(void) free(a); } + TAILQ_FOREACH_SAFE(p, &h->proxies, proxies, tp) { + TAILQ_REMOVE(&h->proxies, p, proxies); + + free(p->match_proto); + free(p->match_host); + free(p->host); + tls_unload_file(p->cert, p->certlen); + tls_unload_file(p->key, p->keylen); + free(p); + } + free((char*)h->domain); free((char*)h->cert); free((char*)h->key); @@ -338,10 +350,6 @@ free_config(void) free((char*)h->cgi); free((char*)h->entrypoint); - free(h->proxy.host); - tls_unload_file(h->proxy.cert, h->proxy.certlen); - tls_unload_file(h->proxy.key, h->proxy.keylen); - TAILQ_REMOVE(&hosts, h, vhosts); free(h); } |