# HG changeset patch # User Gu Feng # Date 1410965522 -28800 # Node ID 1b8459a53e4bbd8a43402cbbf20b17524a0f056b # Parent a0a14319968b2d978d306f5a91e81e9e4e3e7ce6 Avoided to add duplicate hash key in ngx_http_types_slot(). diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -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;