components/apache2/patches/bug48357.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Thu, 22 Nov 2012 06:15:30 -0800
branchs11-update
changeset 2429 cf97b079f90d
child 4696 96b9957387bf
permissions -rw-r--r--
15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2429
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     1
https://issues.apache.org/bugzilla/show_bug.cgi?id=48357
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     2
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     3
--- server/protocol.c	Tue Jan 24 12:02:19 2012
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     4
+++ server/protocol.c	Mon Oct  1 04:53:41 2012
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     5
@@ -869,7 +869,7 @@
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     6
     request_rec *r;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     7
     apr_pool_t *p;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     8
     const char *expect;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     9
-    int access_status;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    10
+    int access_status = HTTP_OK;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    11
     apr_bucket_brigade *tmp_bb;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    12
     apr_socket_t *csd;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    13
     apr_interval_time_t cur_timeout;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    14
@@ -1021,7 +1021,7 @@
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    15
          * HTTP/1.1 mentions twice (S9, S14.23) that a request MUST contain
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    16
          * a Host: header, and the server MUST respond with 400 if it doesn't.
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    17
          */
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    18
-        r->status = HTTP_BAD_REQUEST;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    19
+        access_status = HTTP_BAD_REQUEST;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    20
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    21
                       "client sent HTTP/1.1 request without hostname "
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    22
                       "(see RFC2616 section 14.23): %s", r->uri);
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    23
@@ -1037,14 +1037,8 @@
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    24
     ap_add_input_filter_handle(ap_http_input_filter_handle,
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    25
                                NULL, r, r->connection);
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    26
 
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    27
-    if (r->status != HTTP_OK) {
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    28
-        ap_send_error_response(r, 0);
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    29
-        ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    30
-        ap_run_log_transaction(r);
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    31
-        return r;
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    32
-    }
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    33
-
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    34
-    if ((access_status = ap_run_post_read_request(r))) {
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    35
+    if (access_status != HTTP_OK
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    36
+        || (access_status = ap_run_post_read_request(r))) {
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    37
         ap_die(access_status, r);
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    38
         ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
cf97b079f90d 15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    39
         ap_run_log_transaction(r);