comparison src/core/ngx_hash.h @ 142:84910468f6de NGINX_0_3_18

nginx 0.3.18 *) 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; bug appeared in 0.3.12. *) Bugfix: on 64-bit platforms segmentation fault may occurred on start; bug appeared in 0.3.16.
author Igor Sysoev <http://sysoev.ru>
date Mon, 26 Dec 2005 00:00:00 +0300
parents 8e6d4d96ec4c
children 36af50a5582d
comparison
equal deleted inserted replaced
141:249e67502bf3 142:84910468f6de
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