]> git.kaiwu.me - nginx.git/commitdiff
Avoided to add duplicate hash key in ngx_http_types_slot().
authorGu Feng <flygoast@126.com>
Wed, 17 Sep 2014 14:52:02 +0000 (22:52 +0800)
committerGu Feng <flygoast@126.com>
Wed, 17 Sep 2014 14:52:02 +0000 (22:52 +0800)
src/http/ngx_http.c

index 31577f9a28e571506fe70624941f01e80ff8f20c..9c8d6cba48e87ec1b8c34c4b486cd4b9e5cc556a 100644 (file)
@@ -2005,7 +2005,7 @@ ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             if (ngx_strcmp(value[i].data, type[n].key.data) == 0) {
                 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
                                    "duplicate MIME type \"%V\"", &value[i]);
-                continue;
+                goto next;
             }
         }
 
@@ -2017,6 +2017,10 @@ ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         type->key = value[i];
         type->key_hash = hash;
         type->value = (void *) 4;
+
+    next:
+
+        continue;
     }
 
     return NGX_CONF_OK;