-const char parsers_rcs[] = "$Id: parsers.c,v 1.197 2009/07/13 17:10:57 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.198 2009/07/14 17:50:34 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
 static jb_err server_save_content_length(struct client_state *csp, char **header);
 static jb_err server_keep_alive(struct client_state *csp, char **header);
+static jb_err server_proxy_connection(struct client_state *csp, char **header);
 static jb_err client_keep_alive(struct client_state *csp, char **header);
 #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
 
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
    { "Content-Length:",          15, server_save_content_length },
    { "Keep-Alive:",              11, server_keep_alive },
+   { "Proxy-Connection:",        17, server_proxy_connection },
 #else
    { "Keep-Alive:",              11, crumble },
 #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
 }
 
 
+/*********************************************************************
+ *
+ * Function    :  server_proxy_connection
+ *
+ * Description :  Figures out whether or not we should add a
+ *                Proxy-Connection header.
+ *
+ * Parameters  :
+ *          1  :  csp = Current client state (buffers, headers, etc...)
+ *          2  :  header = On input, pointer to header to modify.
+ *                On output, pointer to the modified header, or NULL
+ *                to remove the header.  This function frees the
+ *                original string if necessary.
+ *
+ * Returns     :  JB_ERR_OK.
+ *
+ *********************************************************************/
+static jb_err server_proxy_connection(struct client_state *csp, char **header)
+{
+   csp->flags |= CSP_FLAG_SERVER_PROXY_CONNECTION_HEADER_SET;
+   return JB_ERR_OK;
+}
+
+
 /*********************************************************************
  *
  * Function    :  client_keep_alive
    jb_err err = JB_ERR_OK;
 
    if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)
-    && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED))
+    && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)
+    && !(csp->flags & CSP_FLAG_SERVER_PROXY_CONNECTION_HEADER_SET))
    {
       log_error(LOG_LEVEL_HEADER, "Adding: %s", proxy_connection_header);
       err = enlist(csp->headers, proxy_connection_header);
 
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.146 2009/07/14 17:45:05 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.147 2009/07/14 17:50:34 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
  */
 #define CSP_FLAG_SERVER_SOCKET_TAINTED          0x00040000U
 
+/**
+ * Flag for csp->flags: Set if the Proxy-Connection header
+ * is among the server headers.
+ */
+#define CSP_FLAG_SERVER_PROXY_CONNECTION_HEADER_SET 0x00080000U
+
 /*
  * Flags for use in return codes of child processes
  */