From 6ac6aa521ca25b7fb6c95eeae8ff46321fc24ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Rodr=C3=ADguez?= Date: Tue, 20 Jul 2021 00:04:05 -0500 Subject: [PATCH] The sanitiser pointed out this problem And I believe it's right. Other-side-close should be done only for the 'A' (proxy-client-side) connection. --- examples/http-reverse-proxy/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/http-reverse-proxy/main.c b/examples/http-reverse-proxy/main.c index aa23e02d..7eebc0dd 100644 --- a/examples/http-reverse-proxy/main.c +++ b/examples/http-reverse-proxy/main.c @@ -64,7 +64,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { mg_tls_init(c, &opts); } } else if (ev == MG_EV_CLOSE) { - if (c2 != NULL) c2->is_closing = 1; + if (c->label[0] != 'B' && c2 != NULL) c2->is_closing = 1; c->fn_data = NULL; } }