[PATCH]Avoided to add duplicate hash key in ngx_http_types_slot().

Ruslan Ermilov ru at nginx.com
Wed Sep 24 05:57:45 UTC 2014


On Wed, Sep 17, 2014 at 11:08:39PM +0800, flygoast wrote:
> # HG changeset patch
> # User Gu Feng <flygoast at 126.com>
> # Date 1410965522 -28800
> #      Wed Sep 17 22:52:02 2014 +0800
> # Node ID 5af55dbe8c301357e021bfefb99f0c359cfde7fd
> # Parent  cda4fcb9294c8f5a0998e7c5d57c5143457db766
> Avoided to add duplicate hash key in ngx_http_types_slot().
> 
> 
> diff -r cda4fcb9294c -r 5af55dbe8c30 src/http/ngx_http.c
> --- a/src/http/ngx_http.cTue Sep 16 21:12:51 2014 +0400
> +++ b/src/http/ngx_http.cWed Sep 17 22:52:02 2014 +0800
> @@ -2005,7 +2005,7 @@ ngx_http_types_slot(ngx_conf_t *cf, ngx_
>              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_
>          type->key = value[i];
>          type->key_hash = hash;
>          type->value = (void *) 4;
> +
> +    next:
> +
> +        continue;
>      }
>  
>      return NGX_CONF_OK;
> 

Committed, thanks!



More information about the nginx-devel mailing list