]> granicus.if.org Git - apache/commitdiff
Merge r1610813 from trunk:
authorChristophe Jaillet <jailletc36@apache.org>
Thu, 16 Oct 2014 21:42:45 +0000 (21:42 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Thu, 16 Oct 2014 21:42:45 +0000 (21:42 +0000)
http_protocol: fix logic in ap_method_list_(add|remove) in order:
       - to correctly reset bits
       - not to modify the 'method_mask' bitfield unnecessarily

Submitted by: jailletc36
Reviewed by: jailletc36, ylavic, rjung
Backported by: jailletc36

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

CHANGES
STATUS
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index 903f81ca7bf8a6b664a2fe06ed63db2e9d4ea455..55e07c094f7d2a5c03aff5270943caf5338e6875 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,11 @@ Changes with Apache 2.4.11
      request headers earlier.  Adds "MergeTrailers" directive to restore
      legacy behavior.  [Edward Lu, Yann Ylavic, Joe Orton, Eric Covener]
 
+  *) http_protocol: fix logic in ap_method_list_(add|remove) in order:
+       - to correctly reset bits
+       - not to modify the 'method_mask' bitfield unnecessarily
+     [Christophe Jaillet]
+
   *) mod_slotmem_shm: Increase log level for some originally debug messages.
      [Jim Jagielski]
 
diff --git a/STATUS b/STATUS
index 56c9a6eca157c9f15ef591c072fcec4d74ebc04b..eb754cede24b9a3090b839612968a64d497e040a 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -108,13 +108,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: trunk works
      +1: jkaluza, ylavic, rjung
 
-   * http_protocol: fix logic in ap_method_list_(add|remove) in order:
-       - to correctly reset bits
-       - not to modify the 'method_mask' bitfield unnecessarily
-     trunk patch: http://svn.apache.org/r1610813
-     2.4.x patch: trunk patch works (modulo CHANGES)
-     +1: jailletc36, ylavic, rjung
-
    * mod_proxy_http: Avoid (unlikely) access to freed memory.
      trunk patch: http://svn.apache.org/r1599486
      2.4.x patch: trunk works
index fe2cc208798ec9b2fd4ddf8454813cd96484462f..a7f30fcf98c4907ad71886a890a18d2ab6393dff 100644 (file)
@@ -1608,8 +1608,8 @@ AP_DECLARE(void) ap_method_list_add(ap_method_list_t *l, const char *method)
      * bitmask.
      */
     methnum = ap_method_number_of(method);
-    l->method_mask |= (AP_METHOD_BIT << methnum);
     if (methnum != M_INVALID) {
+        l->method_mask |= (AP_METHOD_BIT << methnum);
         return;
     }
     /*
@@ -1641,15 +1641,15 @@ AP_DECLARE(void) ap_method_list_remove(ap_method_list_t *l,
      * by a module, use the bitmask.
      */
     methnum = ap_method_number_of(method);
-    l->method_mask |= ~(AP_METHOD_BIT << methnum);
     if (methnum != M_INVALID) {
+        l->method_mask &= ~(AP_METHOD_BIT << methnum);
         return;
     }
     /*
      * Otherwise, see if the method name is in the array of string names.
      */
     if (l->method_list->nelts != 0) {
-        register int i, j, k;
+        int i, j, k;
         methods = (char **)l->method_list->elts;
         for (i = 0; i < l->method_list->nelts; ) {
             if (strcmp(method, methods[i]) == 0) {