]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
If a request fails and the client will be redirected to another URL
authorJeff Trawick <trawick@apache.org>
Sat, 18 Oct 2003 14:15:58 +0000 (14:15 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 18 Oct 2003 14:15:58 +0000 (14:15 +0000)
due to ErrorDocument, see if we need to drop the connection after
sending the 302 response.  This fixes a problem where Apache treated
the body of the failed request as the next request on a keepalive
connection.  The subsequent 501 error sent to the browser prevented
some browsers from fetching the error document.

Reviewed by:  roy, jim

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

STATUS
src/CHANGES
src/main/http_request.c

diff --git a/STATUS b/STATUS
index 413121844d050615c5f89849168562bd2a54731e..e391210466b1e6a9ab9120677ffc98376feb33b6 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 1.3 STATUS:                                             -*-text-*-
-  Last modified at [$Date: 2003/10/18 12:55:12 $]
+  Last modified at [$Date: 2003/10/18 14:15:58 $]
 
 Release:
 
@@ -58,11 +58,6 @@ RELEASE SHOWSTOPPERS:
        Message-Id: <3F8C56E3.8050501@attglobal.net>
         +1: jeff, jim
 
-   * ap_die() should see if it needs to drop the connection before
-     replacing r->status with 302
-     Message-ID: <3F904295.6060701@attglobal.net>
-        +1: jeff, roy, jim
-
    * fix wording of warning for ErrorDocument 401 full-URL
      Message-ID: <3F8BE7D2.6060209@attglobal.net>
         +1: jeff, jim
index 84676f4968255e32c3082468704f7cec7eeae837..fcae7ac590ad4314caeaa3ed1bc29844e7a83c25 100644 (file)
@@ -1,5 +1,12 @@
 Changes with Apache 1.3.29
 
+  *) If a request fails and the client will be redirected to another URL
+     due to ErrorDocument, see if we need to drop the connection after
+     sending the 302 response.  This fixes a problem where Apache treated
+     the body of the failed request as the next request on a keepalive
+     connection.  The subsequent 501 error sent to the browser prevented 
+     some browsers from fetching the error document.  [Jeff Trawick]
+
   *) Fixed mod_usertrack to not get false positive matches on the
      user-tracking cookie's name.  PR 16661.
      [Manni Wood <manniwood@planet-save.com>]
index 4858c0d5fb2260910798bd8029a6a4cd80e87acb..d1d8803ee906d2f0c468ca778e2d83cc048dcf2f 100644 (file)
@@ -1117,7 +1117,15 @@ API_EXPORT(void) ap_die(int type, request_rec *r)
              * apache code, and continue with the usual REDIRECT handler.
              * But note that the client will ultimately see the wrong
              * status...
+             *
+             * Also, before updating r->status, we may need to ensure that
+             * the connection is dropped.  For example, there may be
+             * unread request body that would confuse us if we try
+             * to read another request.
              */
+            if (ap_status_drops_connection(r->status)) {
+                r->connection->keepalive = -1;
+            }
             r->status = REDIRECT;
             ap_table_setn(r->headers_out, "Location", custom_response);
         }