comparison src/http/ngx_http_core_module.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 ebc68d8ca496
comparison
equal deleted inserted replaced
592:8b2e7f727cd0 593:425af804d968
71 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1]; 71 ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1];
72 72
73 ngx_hash0_t headers_in_hash; 73 ngx_hash0_t headers_in_hash;
74 ngx_hash0_t variables_hash; 74 ngx_hash0_t variables_hash;
75 75
76 ngx_uint_t server_names_hash; 76 ngx_uint_t server_names_hash_max_size;
77 ngx_uint_t server_names_hash_threshold; 77 ngx_uint_t server_names_hash_bucket_size;
78
79 size_t max_server_name_len;
80 78
81 ngx_array_t variables; /* ngx_http_variable_t */ 79 ngx_array_t variables; /* ngx_http_variable_t */
82 ngx_array_t all_variables; /* ngx_http_variable_t */ 80 ngx_array_t all_variables; /* ngx_http_variable_t */
83 } ngx_http_core_main_conf_t; 81 } ngx_http_core_main_conf_t;
84 82
97 ngx_array_t server_names; 95 ngx_array_t server_names;
98 96
99 /* server ctx */ 97 /* server ctx */
100 ngx_http_conf_ctx_t *ctx; 98 ngx_http_conf_ctx_t *ctx;
101 99
100 ngx_str_t server_name;
101
102 size_t connection_pool_size; 102 size_t connection_pool_size;
103 size_t request_pool_size; 103 size_t request_pool_size;
104 size_t client_header_buffer_size; 104 size_t client_header_buffer_size;
105 105
106 ngx_bufs_t large_client_header_buffers; 106 ngx_bufs_t large_client_header_buffers;
113 } ngx_http_core_srv_conf_t; 113 } ngx_http_core_srv_conf_t;
114 114
115 115
116 /* list of structures to find core_srv_conf quickly at run time */ 116 /* list of structures to find core_srv_conf quickly at run time */
117 117
118
119 typedef struct {
120 in_addr_t addr;
121 /* the default server configuration for this address:port */
122 ngx_http_core_srv_conf_t *core_srv_conf;
123 ngx_http_virtual_names_t *virtual_names;
124 } ngx_http_in_addr_t;
125
126
118 typedef struct { 127 typedef struct {
119 in_port_t port; 128 in_port_t port;
120 ngx_str_t port_text; 129 ngx_str_t port_text;
121 ngx_array_t addrs; /* array of ngx_http_in_addr_t */ 130 ngx_http_in_addr_t *addrs;
131 ngx_uint_t naddrs;
122 } ngx_http_in_port_t; 132 } ngx_http_in_port_t;
123 133
124 134
125 struct ngx_http_in_addr_s { 135 typedef struct {
136 in_port_t port;
137 ngx_array_t addrs; /* array of ngx_http_conf_in_addr_t */
138 } ngx_http_conf_in_port_t;
139
140
141 typedef struct {
126 in_addr_t addr; 142 in_addr_t addr;
127 143
128 ngx_array_t names; /* array of ngx_http_server_name_t */ 144 ngx_hash_t hash;
129 ngx_array_t *hash; /* hash of ngx_http_server_name_t */ 145 ngx_hash_wildcard_t *dns_wildcards;
130 ngx_array_t wildcards; /* array of ngx_http_server_name_t */ 146
147 ngx_array_t names; /* array of ngx_http_server_name_t */
131 148
132 /* the default server configuration for this address:port */ 149 /* the default server configuration for this address:port */
133 ngx_http_core_srv_conf_t *core_srv_conf; 150 ngx_http_core_srv_conf_t *core_srv_conf;
134 151
135 ngx_http_listen_conf_t conf; 152 unsigned default_server:1;
136 }; 153 unsigned bind:1;
154
155 ngx_http_listen_conf_t *listen_conf;
156 } ngx_http_conf_in_addr_t;
137 157
138 158
139 typedef struct { 159 typedef struct {
140 ngx_str_t name; 160 ngx_str_t name;
141 ngx_http_core_srv_conf_t *core_srv_conf; /* virtual name server conf */ 161 ngx_http_core_srv_conf_t *core_srv_conf; /* virtual name server conf */
142
143 ngx_uint_t wildcard; /* unsigned wildcard:1 */
144 } ngx_http_server_name_t; 162 } ngx_http_server_name_t;
145
146
147 #define ngx_http_server_names_hash_key(key, name, len, prime) \
148 { \
149 ngx_uint_t n0; \
150 for (key = 0, n0 = 0; n0 < len; n0++) { \
151 key += name[n0]; \
152 } \
153 key %= prime; \
154 }
155 163
156 164
157 typedef struct { 165 typedef struct {
158 ngx_int_t status; 166 ngx_int_t status;
159 ngx_int_t overwrite; 167 ngx_int_t overwrite;