Welcome! Log In Create A New Profile

Advanced

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

Ruslan Ermilov
September 24, 2014 01:58AM
details: http://hg.nginx.org/nginx/rev/1b8459a53e4b
branches:
changeset: 5856:1b8459a53e4b
user: Gu Feng <flygoast@126.com>
date: Wed Sep 17 22:52:02 2014 +0800
description:
Avoided to add duplicate hash key in ngx_http_types_slot().

diffstat:

src/http/ngx_http.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r a0a14319968b -r 1b8459a53e4b src/http/ngx_http.c
--- a/src/http/ngx_http.c Mon Sep 22 19:48:23 2014 +0400
+++ b/src/http/ngx_http.c Wed 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;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

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

Ruslan Ermilov 585 September 24, 2014 01:58AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready