]> granicus.if.org Git - apache/commitdiff
fix logic in ap_method_list_(add|remove) in order:
authorChristophe Jaillet <jailletc36@apache.org>
Tue, 15 Jul 2014 19:09:06 +0000 (19:09 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Tue, 15 Jul 2014 19:09:06 +0000 (19:09 +0000)
       - to correctly reset bits
       - not to modify the 'method_mask' bitfield unnecessarily

Also remove a useless 'register' in the declaration of a variable.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610813 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index ee54b061744e02d7da2badf40c3ad2c798257eeb..d1b782f47ccef5caf7711386b53e5ceaab202eaf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) http_protocol: fix logic in ap_method_list_(add|remove) in order:
+       - to correctly reset bits
+       - not to modify the 'method_mask' bitfield unnecessarily
+
   *) mod_log_config: Allow three character log formats to be registered. For
      backwards compatibility, the first character of a three-character format
      must be the '^' (caret) character.  [Eric Covener]
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) {