From 2d8fefc484274b740933541778ae7ce1ae1045e7 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 6 Mar 2021 11:52:10 +0100 Subject: [PATCH] serve(): Close the client socket as well ... if the server socket for an inspected connection has been closed. Privoxy currently can't establish a new server connection when the client socket is reused and would drop the connection in continue_https_chat() anyway. --- jcc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/jcc.c b/jcc.c index ee408b3c..cd7bf710 100644 --- a/jcc.c +++ b/jcc.c @@ -4847,6 +4847,22 @@ static void serve(struct client_state *csp) #endif close_socket(csp->server_connection.sfd); mark_connection_closed(&csp->server_connection); +#ifdef FEATURE_HTTPS_INSPECTION + if (continue_chatting && client_use_ssl(csp)) + { + /* + * Close the client socket as well as Privoxy currently + * can't establish a new server connection when the client + * socket is reused and would drop the connection in + * continue_https_chat() anyway. + */ + continue_chatting = 0; + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; + log_error(LOG_LEVEL_CONNECT, + "Client socket %d is no longer usable. " + "The server socket has been closed.", csp->cfd); + } +#endif } } -- 2.39.2