For HTTP/1.1 requests other than CONNECT requests, assume persistence unless the...
[privoxy.git] / jcc.c
diff --git a/jcc.c b/jcc.c
index 85be466..ed17ba8 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.262 2009/07/05 12:02:25 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.264 2009/07/07 16:42:26 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -1415,6 +1415,15 @@ static jb_err parse_client_request(struct client_state *csp)
    struct http_request *http = csp->http;
    jb_err err;
 
+#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+   if ((!strcmpic(csp->http->ver, "HTTP/1.1"))
+    && (csp->http->ssl == 0))
+   {
+      /* Assume persistence until further notice */
+      csp->flags |= CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE;
+   }
+#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
+
    err = sed(csp, FILTER_CLIENT_HEADERS);
    if (JB_ERR_OK != err)
    {
@@ -1632,7 +1641,6 @@ static void chat(struct client_state *csp)
 
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
    if ((csp->sfd != JB_INVALID_SOCKET)
-      && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)
       && socket_is_still_usable(csp->sfd)
       && connection_destination_matches(&csp->server_connection, http, fwd))
    {