]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
To be honest, I'd prefer testing being done to this version instead
authorJim Jagielski <jim@apache.org>
Sat, 28 Aug 2004 15:07:42 +0000 (15:07 +0000)
committerJim Jagielski <jim@apache.org>
Sat, 28 Aug 2004 15:07:42 +0000 (15:07 +0000)
since this is likely the "best" solution without more intrusive
changes... Folding this in makes it easier to test and hopefully
provide better feedback if we still want to try for a release soon.

PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@104883 13f79535-47bb-0310-9956-ffa450edef68

src/main/http_protocol.c

index 8211a4466051fd7c1f061d196f1a828b14388d19..9c86708573a1c0176d0244c90b22d065e5cef325 100644 (file)
@@ -391,7 +391,6 @@ API_EXPORT(int) ap_set_keepalive(request_rec *r)
     int wimpy = ap_find_token(r->pool,
                            ap_table_get(r->headers_out, "Connection"), "close");
     const char *conn = ap_table_get(r->headers_in, "Connection");
-    const char *herebefore = ap_table_get(r->notes, "ap_set_keepalive-called");
 
     /* The following convoluted conditional determines whether or not
      * the current connection should remain persistent after this response
@@ -442,17 +441,19 @@ API_EXPORT(int) ap_set_keepalive(request_rec *r)
        ) {
         int left = r->server->keep_alive_max - r->connection->keepalives;
 
-        r->connection->keepalive = 1;
        /*
         * ap_set_keepalive could be called multiple times (eg: in
         * ap_die() followed by ap_send_http_header()) during this
         * one single request. To ensure that we don't incorrectly
         * increment the keepalives counter for each call, we
-        * use notes to store a state flag.
+        * assume that only here do we set keepalive. So if keepalive
+        * is already set to 1, we must have already been here and
+        * we should not increment the keepalives counter since we
+        * already done so for this request.
         */
-       if (!herebefore) {
+        if (r->connection->keepalive != 1) {
+            r->connection->keepalive = 1;
             r->connection->keepalives++;
-            ap_table_setn(r->notes, "ap_set_keepalive-called", "1");
        }
 
         /* If they sent a Keep-Alive token, send one back */