aboutsummaryrefslogtreecommitdiff
path: root/proxy.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-01-27 09:53:43 +0000
committerOmar Polo <op@omarpolo.com>2022-01-27 09:53:43 +0000
commit89efa81bcc2b069fa1cca7c1868bd056f2a38f74 (patch)
treea28f74264c9de746480433503ae70c25e00f4ccf /proxy.c
parentb9b77f5344ba6d6116044360feb3a7927778169f (diff)
set REQUEST_PROXY only when proxy_init is successful
Diffstat (limited to 'proxy.c')
-rw-r--r--proxy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/proxy.c b/proxy.c
index 6f892c0..fa31674 100644
--- a/proxy.c
+++ b/proxy.c
@@ -347,12 +347,12 @@ proxy_init(struct client *c)
{
struct proxy *p = c->proxy;
- c->type = REQUEST_PROXY;
-
- if (p->notls) {
+ if (!p->notls && proxy_setup_tls(c) == -1)
+ return -1;
+ else if (p->notls)
proxy_enqueue_req(c);
- return 0;
- }
- return proxy_setup_tls(c);
+ c->type = REQUEST_PROXY;
+
+ return 0;
}