aboutsummaryrefslogtreecommitdiff
path: root/gmid.h
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-01-01 17:08:39 +0000
committerOmar Polo <op@omarpolo.com>2022-01-01 17:08:39 +0000
commit7bdcc91ec70ddde092ac5d7b4f75d54915e7b221 (patch)
tree94066bd47c57b6610ae184e0e6c9b6a32cc440ad /gmid.h
parentbd5f79542cf6491ed9e30bca926286e3b9e2600c (diff)
simplify the proxying code
it doesn't make any sense to keep the proxying info per-location: proxying only one per-vhost. It can't work differently, it doesn't make sense anyway.
Diffstat (limited to 'gmid.h')
-rw-r--r--gmid.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/gmid.h b/gmid.h
index 1c9b061..7da15c2 100644
--- a/gmid.h
+++ b/gmid.h
@@ -97,6 +97,15 @@ struct fcgi {
};
extern struct fcgi fcgi[FCGI_MAX];
+struct proxy {
+ char *host;
+ const char *port;
+ uint8_t *cert;
+ size_t certlen;
+ uint8_t *key;
+ size_t keylen;
+};
+
TAILQ_HEAD(lochead, location);
struct location {
const char *match;
@@ -111,13 +120,6 @@ struct location {
int disable_log;
int fcgi;
- char *proxy_host;
- const char *proxy_port;
- uint8_t *proxy_cert;
- size_t proxy_cert_len;
- uint8_t *proxy_key;
- size_t proxy_key_len;
-
const char *dir;
int dirfd;
@@ -158,6 +160,7 @@ struct vhost {
struct envhead env;
struct envhead params;
struct aliashead aliases;
+ struct proxy proxy;
};
struct etm { /* extension to mime */
@@ -242,7 +245,6 @@ struct client {
struct sockaddr_storage addr;
struct vhost *host; /* host they're talking to */
size_t loc; /* location matched */
- struct location *l;
SPLAY_ENTRY(client) entry;
};
@@ -347,7 +349,6 @@ const char *vhost_default_mime(struct vhost*, const char*);
const char *vhost_index(struct vhost*, const char*);
int vhost_auto_index(struct vhost*, const char*);
int vhost_block_return(struct vhost*, const char*, int*, const char**);
-struct location *vhost_reverse_proxy(struct vhost *, const char *);
int vhost_fastcgi(struct vhost*, const char*);
int vhost_dirfd(struct vhost*, const char*, size_t*);
int vhost_strip(struct vhost*, const char*);