comparison src/http/ngx_http_core_module.c @ 4204:657aaedcc0e3

Fixed two minor bugs in "types" parsing code.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 12 Oct 2011 09:36:21 +0000
parents a949b15df739
children 1a94a56a4e5d
comparison
equal deleted inserted replaced
4203:a949b15df739 4204:657aaedcc0e3
2992 ngx_hash_key_t *type; 2992 ngx_hash_key_t *type;
2993 2993
2994 value = cf->args->elts; 2994 value = cf->args->elts;
2995 2995
2996 if (ngx_strcmp(value[0].data, "include") == 0) { 2996 if (ngx_strcmp(value[0].data, "include") == 0) {
2997 if (cf->args->nelts != 2) {
2998 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2999 "invalid number of arguments"
3000 " in \"include\" directive");
3001 return NGX_CONF_ERROR;
3002 }
2997 file = value[1]; 3003 file = value[1];
2998 3004
2999 if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { 3005 if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) {
3000 return NGX_CONF_ERROR; 3006 return NGX_CONF_ERROR;
3001 } 3007 }
3025 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, 3031 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
3026 "duplicate extension \"%V\", " 3032 "duplicate extension \"%V\", "
3027 "content type: \"%V\", " 3033 "content type: \"%V\", "
3028 "previous content type: \"%V\"", 3034 "previous content type: \"%V\"",
3029 &value[i], content_type, old); 3035 &value[i], content_type, old);
3030 continue; 3036 goto next;
3031 } 3037 }
3032 } 3038 }
3033 3039
3034 3040
3035 type = ngx_array_push(clcf->types); 3041 type = ngx_array_push(clcf->types);
3038 } 3044 }
3039 3045
3040 type->key = value[i]; 3046 type->key = value[i];
3041 type->key_hash = hash; 3047 type->key_hash = hash;
3042 type->value = content_type; 3048 type->value = content_type;
3049
3050 next:
3051 continue;
3043 } 3052 }
3044 3053
3045 return NGX_CONF_OK; 3054 return NGX_CONF_OK;
3046 } 3055 }
3047 3056