]> granicus.if.org Git - apache/commitdiff
Merge r1392347 from trunk:
authorJim Jagielski <jim@apache.org>
Thu, 4 Oct 2012 12:59:50 +0000 (12:59 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 4 Oct 2012 12:59:50 +0000 (12:59 +0000)
core: ErrorDocument now works for requests without a Host header.

PR: 48357

Submitted by: trawick
Reviewed/backported by: jim

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

CHANGES
STATUS
server/protocol.c

diff --git a/CHANGES b/CHANGES
index 2fc37ff3223d989f5ffe6fa2532d4c5eeeed7167..b7ccb2655590175ff166510ea133d9d20456ed10 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.4
  
+  *) core: ErrorDocument now works for requests without a Host header.
+     PR 48357.  [Jeff Trawick]
+
   *) prefork: Avoid logging harmless errors during graceful stop.
      [Joe Orton, Jeff Trawick]
 
diff --git a/STATUS b/STATUS
index 92264abbee97f30128c0ad3a2ddfbb125c34059e..d70328382076c42658cfd36e341e394d2b192bf9 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -89,12 +89,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
   
-   * core: ErrorDocument now works for requests without a Host header.
-     (PR 48357)
-     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1392347
-     2.4.x patch: trunk patch works (minus CHANGES)
-     +1: trawick, minfrin, jim
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 30b3cd5eeff20a891bf7bdf46913e4d69a82297b..b0da156eec5413925e59c04645bf5785625e02d8 100644 (file)
@@ -918,7 +918,7 @@ request_rec *ap_read_request(conn_rec *conn)
     request_rec *r;
     apr_pool_t *p;
     const char *expect;
-    int access_status;
+    int access_status = HTTP_OK;
     apr_bucket_brigade *tmp_bb;
     apr_socket_t *csd;
     apr_interval_time_t cur_timeout;
@@ -1086,7 +1086,7 @@ request_rec *ap_read_request(conn_rec *conn)
          * HTTP/1.1 mentions twice (S9, S14.23) that a request MUST contain
          * a Host: header, and the server MUST respond with 400 if it doesn't.
          */
-        r->status = HTTP_BAD_REQUEST;
+        access_status = HTTP_BAD_REQUEST;
         ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00569)
                       "client sent HTTP/1.1 request without hostname "
                       "(see RFC2616 section 14.23): %s", r->uri);
@@ -1102,14 +1102,8 @@ request_rec *ap_read_request(conn_rec *conn)
     ap_add_input_filter_handle(ap_http_input_filter_handle,
                                NULL, r, r->connection);
 
-    if (r->status != HTTP_OK) {
-        ap_send_error_response(r, 0);
-        ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
-        ap_run_log_transaction(r);
-        goto traceout;
-    }
-
-    if ((access_status = ap_run_post_read_request(r))) {
+    if (access_status != HTTP_OK
+        || (access_status = ap_run_post_read_request(r))) {
         ap_die(access_status, r);
         ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
         ap_run_log_transaction(r);