If the status code isn't 200, don't assume a missing Connection header for a HTTP...
authorFabian Keil <fk@fabiankeil.de>
Tue, 30 Jun 2009 18:32:04 +0000 (18:32 +0000)
committerFabian Keil <fk@fabiankeil.de>
Tue, 30 Jun 2009 18:32:04 +0000 (18:32 +0000)
Seems to work around problems with some servers.

parsers.c

index a8d3683..021b63f 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.185 2009/06/27 11:25:33 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.186 2009/06/28 14:31:43 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -3411,8 +3411,17 @@ static jb_err server_connection_adder(struct client_state *csp)
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
     && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)
 #endif
+    && (csp->http->status == 200)
        )
    {
+      /*
+       * XXX: not doing this for status codes other than 200 works
+       * around problems with broken servers that will keep the
+       * connection open, but terminate the connection when the
+       * next request arrives. Once we are able to figure out which
+       * requests are safe to send again, this will probably no
+       * longer be necessary.
+       */
       log_error(LOG_LEVEL_HEADER, "A HTTP/1.1 response "
          "without Connection header implies keep-alive.");
       csp->flags |= CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE;