aboutsummaryrefslogtreecommitdiff
path: root/proxy.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-01-02 16:33:28 +0000
committerOmar Polo <op@omarpolo.com>2022-01-02 16:33:28 +0000
commitb7967bc1f695126e1bf2705bfd486bbc32aaf8b0 (patch)
treed24f103eb78223a61049bfcebedb1686bd628c3c /proxy.c
parente2f167afb3444d3ba55fdffe234ef7812cac72f0 (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 'proxy.c')
-rw-r--r--proxy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proxy.c b/proxy.c
index 3c55ca2..6f892c0 100644
--- a/proxy.c
+++ b/proxy.c
@@ -233,7 +233,7 @@ proxy_error(struct bufferevent *bev, short error, void *d)
static void
proxy_enqueue_req(struct client *c)
{
- struct proxy *p = &c->host->proxy;
+ struct proxy *p = c->proxy;
struct evbuffer *evb;
char iribuf[GEMINI_URL_LEN];
@@ -294,7 +294,7 @@ proxy_handshake(int fd, short event, void *d)
static int
proxy_setup_tls(struct client *c)
{
- struct proxy *p = &c->host->proxy;
+ struct proxy *p = c->proxy;
struct tls_config *conf = NULL;
if ((conf = tls_config_new()) == NULL)
@@ -324,7 +324,7 @@ proxy_setup_tls(struct client *c)
if (tls_configure(c->proxyctx, conf) == -1)
goto err;
- if (tls_connect_socket(c->proxyctx, c->pfd, c->domain) == -1)
+ if (tls_connect_socket(c->proxyctx, c->pfd, p->host) == -1)
goto err;
event_set(&c->proxyev, c->pfd, EV_READ|EV_WRITE, proxy_handshake, c);
@@ -345,7 +345,7 @@ err:
int
proxy_init(struct client *c)
{
- struct proxy *p = &c->host->proxy;
+ struct proxy *p = c->proxy;
c->type = REQUEST_PROXY;