From b7967bc1f695126e1bf2705bfd486bbc32aaf8b0 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Sun, 2 Jan 2022 16:33:28 +0000 Subject: 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. --- gmid.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'gmid.c') diff --git a/gmid.c b/gmid.c index a6e0d1b..2abdce0 100644 --- a/gmid.c +++ b/gmid.c @@ -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); } -- cgit v1.2.3