]> granicus.if.org Git - apache/commitdiff
Merge r1730723 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 13 Jun 2016 13:00:34 +0000 (13:00 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 13 Jun 2016 13:00:34 +0000 (13:00 +0000)
Add 451... Needed to adjust RESPONSE_CODES which
was not in the provided patch
BUGZ# 58985
Reviewed/backported by: jim

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

STATUS
include/httpd.h
modules/http/http_protocol.c

diff --git a/STATUS b/STATUS
index c39acba8aa60b36d0368170c4ff83736f3a6b407..398a8fde460bb6c76ea22628dae5377bf5c25414 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -114,11 +114,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) http: Add 451 status code
-     trunk patch: http://svn.apache.org/r1730723
-     2.4.x: trunk works
-     +1: jailletc36, jim, trawick
-
   *) mod_dav: Add dav_get_provider_name() function to obtain the name
      of the provider from mod_dav.
      trunk patch: http://svn.apache.org/r1747946
index ba5167e3c028158cd65c337f9e67add0778ef5b5..72b83945278bea54b158c9c810c588cd8e9cdffe 100644 (file)
@@ -481,7 +481,7 @@ AP_DECLARE(const char *) ap_get_server_built(void);
  * When adding a new code here add it to status_lines as well.
  * A future version should dynamically generate the apr_table_t at startup.
  */
-#define RESPONSE_CODES 83
+#define RESPONSE_CODES 103
 
 #define HTTP_CONTINUE                        100
 #define HTTP_SWITCHING_PROTOCOLS             101
@@ -530,6 +530,7 @@ AP_DECLARE(const char *) ap_get_server_built(void);
 #define HTTP_PRECONDITION_REQUIRED           428
 #define HTTP_TOO_MANY_REQUESTS               429
 #define HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
+#define HTTP_UNAVAILABLE_FOR_LEGAL_REASONS   451
 #define HTTP_INTERNAL_SERVER_ERROR           500
 #define HTTP_NOT_IMPLEMENTED                 501
 #define HTTP_BAD_GATEWAY                     502
index 9aa0549b11165ceb8619a1e26de02645c1106355..582d87e3b0429e44f843464b2e459815b4883407 100644 (file)
@@ -146,7 +146,27 @@ static const char * const status_lines[RESPONSE_CODES] =
     "429 Too Many Requests",
     NULL, /* 430 */
     "431 Request Header Fields Too Large",
-#define LEVEL_500 71
+    NULL, /* 432 */
+    NULL, /* 433 */
+    NULL, /* 434 */
+    NULL, /* 435 */
+    NULL, /* 436 */
+    NULL, /* 437 */
+    NULL, /* 438 */
+    NULL, /* 439 */
+    NULL, /* 440 */
+    NULL, /* 441 */
+    NULL, /* 442 */
+    NULL, /* 443 */
+    NULL, /* 444 */
+    NULL, /* 445 */
+    NULL, /* 446 */
+    NULL, /* 447 */
+    NULL, /* 448 */
+    NULL, /* 449 */
+    NULL, /* 450 */
+    "451 Unavailable For Legal Reasons",
+#define LEVEL_500 91
     "500 Internal Server Error",
     "501 Not Implemented",
     "502 Bad Gateway",
@@ -1298,6 +1318,12 @@ static const char *get_canned_error_string(int status,
                "request as the requested host name does not match\n"
                "the Server Name Indication (SNI) in use for this\n"
                "connection.</p>\n");
+    case HTTP_UNAVAILABLE_FOR_LEGAL_REASONS:
+        s1 = apr_pstrcat(p,
+                         "<p>Access to ", ap_escape_html(r->pool, r->uri),
+                         "\nhas been denied for legal reasons.<br />\n",
+                         NULL);
+        return(add_optional_notes(r, s1, "error-notes", "</p>\n"));
     default:                    /* HTTP_INTERNAL_SERVER_ERROR */
         /*
          * This comparison to expose error-notes could be modified to