continue_https_chat(): Explicitly unset CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE
authorFabian Keil <fk@fabiankeil.de>
Mon, 1 Feb 2021 12:14:16 +0000 (13:14 +0100)
committerFabian Keil <fk@fabiankeil.de>
Wed, 3 Feb 2021 10:56:50 +0000 (11:56 +0100)
... if process_encrypted_request() fails.

This makes it more obvious that the connection will not be reused.
Previously serve() relied on CSP_FLAG_SERVER_CONTENT_LENGTH_SET
and CSP_FLAG_CHUNKED being unset.

Inspired by a patch from Joshua Rogers.

jcc.c

diff --git a/jcc.c b/jcc.c
index 8c34236..8283add 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -2907,6 +2907,7 @@ static void continue_https_chat(struct client_state *csp)
 
    if (JB_ERR_OK != process_encrypted_request(csp))
    {
+      csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE;
       return;
    }