annotate src/core/ngx_hash.h @ 138:8e6d4d96ec4c NGINX_0_3_16

nginx 0.3.16 *) Feature: the ngx_http_map_module. *) Feature: the "types_hash_max_size" and "types_hash_bucket_size" directives. *) Feature: the "ssi_value_length" directive. *) Feature: the "worker_rlimit_core" directive. *) Workaround: the connection number in logs was always 1 if nginx was built by the icc 8.1 or 9.0 compilers with optimization for Pentium 4. *) Bugfix: the "config timefmt" SSI command set incorrect time format. *) Bugfix: nginx did not close connection to IMAP/POP3 backend for the SSL connections; bug appeared in 0.3.13. Thanks to Rob Mueller. *) Bugfix: segmentation fault may occurred in at SSL shutdown; bug appeared in 0.3.13.
author Igor Sysoev <http://sysoev.ru>
date Fri, 16 Dec 2005 00:00:00 +0300
parents b55cbf18157e
children 84910468f6de
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
1
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
2 /*
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
4 */
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
5
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
6
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
7 #ifndef _NGX_HASH_H_INCLUDED_
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
8 #define _NGX_HASH_H_INCLUDED_
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
9
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
10
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
11 #include <ngx_config.h>
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
12 #include <ngx_core.h>
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
13
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
14
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
15 typedef struct {
138
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
16 void *value;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
17 u_char len;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
18 u_char name[1];
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
19 } ngx_hash_elt_t;
56
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
20
138
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
21
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
22 typedef struct {
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
23 ngx_hash_elt_t **buckets;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
24 ngx_uint_t size;
56
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
25 } ngx_hash_t;
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
26
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
27
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
28 typedef struct {
138
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
29 ngx_hash_t hash;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
30 void *value;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
31 } ngx_hash_wildcard_t;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
32
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
33
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
34 typedef struct {
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
35 ngx_str_t key;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
36 ngx_uint_t key_hash;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
37 void *value;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
38 } ngx_hash_key_t;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
39
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
40
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
41 typedef ngx_uint_t (*ngx_hash_key_pt) (u_char *data, size_t len);
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
42
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
43
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
44 typedef struct {
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
45 ngx_hash_t *hash;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
46 ngx_hash_key_pt key;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
47
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
48 ngx_uint_t max_size;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
49 ngx_uint_t bucket_size;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
50
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
51 char *name;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
52 ngx_pool_t *pool;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
53 ngx_pool_t *temp_pool;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
54 } ngx_hash_init_t;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
55
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
56
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
57 typedef struct {
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
58 void **buckets;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
59 ngx_uint_t hash_size;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
60
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
61 ngx_uint_t max_size;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
62 ngx_uint_t bucket_limit;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
63 size_t bucket_size;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
64 char *name;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
65 ngx_uint_t min_buckets;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
66 } ngx_hash0_t;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
67
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
68
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
69 typedef struct {
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
70 ngx_uint_t hash;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
71 ngx_str_t key;
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
72 ngx_str_t value;
56
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
73 } ngx_table_elt_t;
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
74
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
75
138
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
76 void *ngx_hash_find(ngx_hash_t *hash, ngx_uint_t key, u_char *name, size_t len);
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
77 void *ngx_hash_find_wildcard(ngx_hash_wildcard_t *hwc, u_char *name,
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
78 size_t len);
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
79
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
80 ngx_int_t ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names,
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
81 ngx_uint_t nelts);
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
82 ngx_int_t ngx_hash_wildcard_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names,
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
83 ngx_uint_t nelts);
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
84
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
85 #define ngx_hash(key, c) key * 31 + c
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
86 ngx_uint_t ngx_hash_key(u_char *data, size_t len);
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
87 ngx_uint_t ngx_hash_key_lc(u_char *data, size_t len);
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
88
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
89
8e6d4d96ec4c nginx 0.3.16
Igor Sysoev <http://sysoev.ru>
parents: 58
diff changeset
90 ngx_int_t ngx_hash0_init(ngx_hash0_t *hash, ngx_pool_t *pool, void *names,
58
b55cbf18157e nginx 0.1.29
Igor Sysoev <http://sysoev.ru>
parents: 56
diff changeset
91 ngx_uint_t nelts);
56
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
92
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
93
3050baa54a26 nginx 0.1.28
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
94 #endif /* _NGX_HASH_H_INCLUDED_ */