From 789fe02641785d03530f1da98319b5e2fdca11bf Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 19 Jul 2009 11:48:32 +0000
Subject: [PATCH] If RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE is disabled, don't
 let 'Connection: keep-alive' headers through.

---
 parsers.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/parsers.c b/parsers.c
index fba1f225..7dafdc72 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.200 2009/07/19 09:24:17 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.201 2009/07/19 10:06:33 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -1811,17 +1811,18 @@ static jb_err client_connection(struct client_state *csp, char **header)
             *header);
          csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE;
       }
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
    }
-   else
+   else if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE))
    {
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
       log_error(LOG_LEVEL_HEADER,
          "Keeping the client header '%s' around. "
          "The server connection will be kept alive if possible.",
          *header);
       csp->flags |= CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE;
-#else
+#endif  /* def FEATURE_CONNECTION_KEEP_ALIVE */
+   }
+   else
+   {
       char *old_header = *header;
 
       *header = strdup(connection_close);
@@ -1832,7 +1833,6 @@ static jb_err client_connection(struct client_state *csp, char **header)
       log_error(LOG_LEVEL_HEADER,
          "Replaced: \'%s\' with \'%s\'", old_header, *header);
       freez(old_header);
-#endif  /* def FEATURE_CONNECTION_KEEP_ALIVE */
    }
 
    /* Signal client_connection_adder() to return early. */
-- 
2.49.0