aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-01-01 20:16:14 +0000
committerOmar Polo <op@omarpolo.com>2022-01-01 20:16:14 +0000
commit593e412b4988ca8b72bb7ef9b1cc663cb1184215 (patch)
tree55599fb76ec918b214af8b5fd7e4e1af1d51aaca /server.c
parent294a57275af3dafa948119e60a8db979be25e1f7 (diff)
allow to disable TLS when proxying requests
Diffstat (limited to 'server.c')
-rw-r--r--server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.c b/server.c
index a0edd85..2a4ed66 100644
--- a/server.c
+++ b/server.c
@@ -1239,7 +1239,8 @@ client_close(struct client *c)
if (event_pending(&c->proxyev, EV_READ|EV_WRITE, NULL))
event_del(&c->proxyev);
- if (c->pfd != -1) {
+ if (c->pfd != -1 && c->proxyctx != NULL) {
+ /* shut down the proxy TLS connection */
client_proxy_close(c->pfd, 0, c->proxyctx);
c->pfd = -1;
}