From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 7 Apr 2009 11:43:50 +0000 (+0000)
Subject: If the server rudely resets the connection directly after sending the
X-Git-Tag: v_3_0_13~136
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/developer-manual/faq/@default-cgi@/static/coding.html?a=commitdiff_plain;h=4100d2841b0da122abc352e14265f8fc093cb1e7;p=privoxy.git

If the server rudely resets the connection directly after sending the
headers, pass the mess to the client instead of sending an incorrect
connect-failed message. Fixes #2698674 reported by mybugaccount.
---

diff --git a/jcc.c b/jcc.c
index 3a37efda..390408ed 100644
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.237 2009/03/27 14:32:04 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.238 2009/03/27 14:42:30 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.237 2009/03/27 14:32:04 fabiankeil Exp $"
  *
  * Revisions   :
  *    $Log: jcc.c,v $
+ *    Revision 1.238  2009/03/27 14:42:30  fabiankeil
+ *    Correct the status code for CONNECTION_TIMEOUT_RESPONSE.
+ *
  *    Revision 1.237  2009/03/27 14:32:04  fabiankeil
  *    If spawning a child in listen_loop() fails, send a real
  *    HTTP response to the client and continue listening for
@@ -2960,14 +2963,11 @@ static void chat(struct client_state *csp)
                mark_server_socket_tainted(csp);
                return;
             }
-
-            rsp = error_response(csp, "connect-failed", errno);
-            if (rsp)
-            {
-               send_crunch_response(csp, rsp);
-            }
-
-            return;
+            /*
+             * XXX: Consider handling the cases above the same.
+             */
+            mark_server_socket_tainted(csp);
+            len = 0;
          }
 
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE