From: Fabian Keil <fk@fabiankeil.de>
Date: Mon, 13 Jul 2009 17:10:57 +0000 (+0000)
Subject: If keep-alive support is disabled, don't let the client's Keep-Alive header through.
X-Git-Tag: v_3_0_14~40
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/faq/user-manual/@proxy-info-url@?a=commitdiff_plain;h=1cf19c9f0e26eaf18c6267bb35a059037f4ea956;p=privoxy.git

If keep-alive support is disabled, don't let the client's Keep-Alive header through.

Anonymously reported in #2818986.
---

diff --git a/parsers.c b/parsers.c
index 456c1921..ef0fde2d 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.195 2009/07/11 11:17:35 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.196 2009/07/11 11:20:12 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -1691,6 +1691,14 @@ static jb_err client_keep_alive(struct client_state *csp, char **header)
    unsigned int keep_alive_timeout;
    const char *timeout_position = strstr(*header, ": ");
 
+   if (!(csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE))
+   {
+      log_error(LOG_LEVEL_HEADER,
+         "keep-alive support is disabled. Crunching: %s.", *header);
+      freez(*header);
+      return JB_ERR_OK;
+   }
+
    if ((NULL == timeout_position)
     || (1 != sscanf(timeout_position, ": %u", &keep_alive_timeout)))
    {