httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1670594 - in /httpd/httpd/trunk: CHANGES include/ap_mmn.h include/httpd.h modules/http/http_protocol.c
Date Wed, 01 Apr 2015 10:03:57 GMT
Author: minfrin
Date: Wed Apr  1 10:03:56 2015
New Revision: 1670594

URL: http://svn.apache.org/r1670594
Log:
http: Add support for RFC2324/RFC7168.

Sample implementation: http://people.apache.org/~minfrin/mod_teapot.c

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/include/httpd.h
    httpd/httpd/trunk/modules/http/http_protocol.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1670594&r1=1670593&r2=1670594&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Apr  1 10:03:56 2015
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) http: Add support for RFC2324/RFC7168. [Graham Leggett]
+
   *) mod_proxy_wstunnel: Avoid an empty response by failing with 502 (Bad
      Gateway) when no response is ever received from the backend.
      [Jan Kaluza]

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1670594&r1=1670593&r2=1670594&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Wed Apr  1 10:03:56 2015
@@ -481,6 +481,7 @@
  * 20150121.2 (2.5.0-dev)  Add response_code_exprs to http_core.h
  * 20150222.0 (2.5.0-dev)  ssl pre_handshake hook now indicates proxy|client
  * 20150222.1 (2.5.0-dev)  Add keep_alive_timeout_set to server_rec
+ * 20150222.2 (2.5.0-dev)  Add response code 418 as per RFC2324/RFC7168
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
@@ -488,7 +489,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20150222
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 1                 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 2                 /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=1670594&r1=1670593&r2=1670594&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Wed Apr  1 10:03:56 2015
@@ -518,6 +518,7 @@ AP_DECLARE(const char *) ap_get_server_b
 #define HTTP_UNSUPPORTED_MEDIA_TYPE          415
 #define HTTP_RANGE_NOT_SATISFIABLE           416
 #define HTTP_EXPECTATION_FAILED              417
+#define HTTP_IM_A_TEAPOT                     418
 #define HTTP_UNPROCESSABLE_ENTITY            422
 #define HTTP_LOCKED                          423
 #define HTTP_FAILED_DEPENDENCY               424
@@ -605,6 +606,8 @@ AP_DECLARE(const char *) ap_get_server_b
 #define M_BASELINE_CONTROL      24
 #define M_MERGE                 25
 #define M_INVALID               26      /** no valid method */
+#define M_BREW                  27      /** RFC 2324: HTCPCP/1.0 */
+#define M_WHEN                  28      /** RFC 2324: HTCPCP/1.0 */
 
 /**
  * METHODS needs to be equal to the number of bits

Modified: httpd/httpd/trunk/modules/http/http_protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_protocol.c?rev=1670594&r1=1670593&r2=1670594&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_protocol.c (original)
+++ httpd/httpd/trunk/modules/http/http_protocol.c Wed Apr  1 10:03:56 2015
@@ -132,7 +132,7 @@ static const char * const status_lines[R
     "415 Unsupported Media Type",
     "416 Requested Range Not Satisfiable",
     "417 Expectation Failed",
-    NULL, /* 418 */
+    "418 I'm A Teapot",
     NULL, /* 419 */
     NULL, /* 420 */
     NULL, /* 421 */
@@ -695,6 +695,8 @@ AP_DECLARE(void) ap_method_registry_init
     register_one_method(p, "MKACTIVITY", M_MKACTIVITY);
     register_one_method(p, "BASELINE-CONTROL", M_BASELINE_CONTROL);
     register_one_method(p, "MERGE", M_MERGE);
+    register_one_method(p, "BREW", M_BREW);
+    register_one_method(p, "WHEN", M_WHEN);
 }
 
 AP_DECLARE(int) ap_method_register(apr_pool_t *p, const char *methname)
@@ -793,6 +795,16 @@ static int lookup_builtin_method(const c
                     && method[2] == 'P'
                     && method[3] == 'Y'
                     ? M_COPY : UNKNOWN_METHOD);
+        case 'B':
+            return (method[1] == 'R'
+                    && method[2] == 'E'
+                    && method[3] == 'W'
+                    ? M_BREW : UNKNOWN_METHOD);
+        case 'W':
+            return (method[1] == 'H'
+                    && method[2] == 'E'
+                    && method[3] == 'N'
+                    ? M_WHEN : UNKNOWN_METHOD);
         default:
             return UNKNOWN_METHOD;
         }
@@ -1293,6 +1305,9 @@ static const char *get_canned_error_stri
     case HTTP_NETWORK_AUTHENTICATION_REQUIRED:
         return("<p>The client needs to authenticate to gain\n"
                "network access.</p>\n");
+    case HTTP_IM_A_TEAPOT:
+        return("<p>The resulting entity body MAY be short and\n"
+                "stout.</p>\n");
     default:                    /* HTTP_INTERNAL_SERVER_ERROR */
         /*
          * This comparison to expose error-notes could be modified to



Mime
View raw message