comparison src/core/ngx_hash.h @ 593:425af804d968 release-0.3.18

nginx-0.3.18-RELEASE import *) Feature: the "server_names" directive supports the ".domain.tld" names. *) Feature: the "server_names" directive uses the hash for the "*.domain.tld" names and more effective hash for usual names. *) Change: the "server_names_hash_max_size" and "server_names_hash_bucket_size" directives. *) Change: the "server_names_hash" and "server_names_hash_threshold" directives were canceled. *) Feature: the "valid_referers" directive uses the hash site names. *) Change: now the "valid_referers" directive checks the site names only without the URI part. *) Bugfix: some ".domain.tld" names incorrectly processed by the ngx_http_map_module. *) Bugfix: segmentation fault was occurred if configuration file did not exist; the bug had appeared in 0.3.12. *) Bugfix: on 64-bit platforms segmentation fault may occurred on start; the bug had appeared in 0.3.16.
author Igor Sysoev <igor@sysoev.ru>
date Mon, 26 Dec 2005 17:07:48 +0000
parents d4e858a5751a
children 9262f520ce21
comparison
equal deleted inserted replaced
592:8b2e7f727cd0 593:425af804d968
52 ngx_pool_t *pool; 52 ngx_pool_t *pool;
53 ngx_pool_t *temp_pool; 53 ngx_pool_t *temp_pool;
54 } ngx_hash_init_t; 54 } ngx_hash_init_t;
55 55
56 56
57 #define NGX_HASH_SMALL 1
58 #define NGX_HASH_LARGE 2
59
60 #define NGX_HASH_LARGE_ASIZE 16384
61 #define NGX_HASH_LARGE_HSIZE 10007
62
63 #define NGX_HASH_WILDCARD_KEY 1
64
65
66 typedef struct {
67 ngx_uint_t hsize;
68
69 ngx_pool_t *pool;
70 ngx_pool_t *temp_pool;
71
72 ngx_array_t keys;
73 ngx_array_t *keys_hash;
74
75 ngx_array_t dns_wildcards;
76 ngx_array_t *dns_wildcards_hash;
77 } ngx_hash_keys_arrays_t;
78
79
57 typedef struct { 80 typedef struct {
58 void **buckets; 81 void **buckets;
59 ngx_uint_t hash_size; 82 ngx_uint_t hash_size;
60 83
61 ngx_uint_t max_size; 84 ngx_uint_t max_size;
84 107
85 #define ngx_hash(key, c) key * 31 + c 108 #define ngx_hash(key, c) key * 31 + c
86 ngx_uint_t ngx_hash_key(u_char *data, size_t len); 109 ngx_uint_t ngx_hash_key(u_char *data, size_t len);
87 ngx_uint_t ngx_hash_key_lc(u_char *data, size_t len); 110 ngx_uint_t ngx_hash_key_lc(u_char *data, size_t len);
88 111
112 ngx_int_t ngx_hash_keys_array_init(ngx_hash_keys_arrays_t *ha, ngx_uint_t type);
113 ngx_int_t ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key,
114 void *value, ngx_uint_t flags);
115
89 116
90 ngx_int_t ngx_hash0_init(ngx_hash0_t *hash, ngx_pool_t *pool, void *names, 117 ngx_int_t ngx_hash0_init(ngx_hash0_t *hash, ngx_pool_t *pool, void *names,
91 ngx_uint_t nelts); 118 ngx_uint_t nelts);
92 119
93 120