If RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE is disabled, don't let 'Connection: keep...
authorFabian Keil <fk@fabiankeil.de>
Sun, 19 Jul 2009 11:48:32 +0000 (11:48 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 19 Jul 2009 11:48:32 +0000 (11:48 +0000)
parsers.c

index fba1f22..7dafdc7 100644 (file)
--- 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. */